зеркало из https://github.com/microsoft/clang-1.git
Random temporary string cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110807 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
7f1c547ee6
Коммит
476d8b863c
|
@ -671,7 +671,7 @@ static char DecodeTrigraphChar(const char *CP, Lexer *L) {
|
|||
}
|
||||
|
||||
if (!L->isLexingRawMode())
|
||||
L->Diag(CP-2, diag::trigraph_converted) << std::string()+Res;
|
||||
L->Diag(CP-2, diag::trigraph_converted) << llvm::StringRef(&Res, 1);
|
||||
return Res;
|
||||
}
|
||||
|
||||
|
|
|
@ -323,7 +323,7 @@ NumericLiteralParser(const char *begin, const char *end,
|
|||
// Done.
|
||||
} else if (isxdigit(*s) && !(*s == 'e' || *s == 'E')) {
|
||||
PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-begin),
|
||||
diag::err_invalid_decimal_digit) << std::string(s, s+1);
|
||||
diag::err_invalid_decimal_digit) << llvm::StringRef(s, 1);
|
||||
hadError = true;
|
||||
return;
|
||||
} else if (*s == '.') {
|
||||
|
@ -439,7 +439,7 @@ NumericLiteralParser(const char *begin, const char *end,
|
|||
PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-begin),
|
||||
isFPConstant ? diag::err_invalid_suffix_float_constant :
|
||||
diag::err_invalid_suffix_integer_constant)
|
||||
<< std::string(SuffixBegin, ThisTokEnd);
|
||||
<< llvm::StringRef(SuffixBegin, ThisTokEnd-SuffixBegin);
|
||||
hadError = true;
|
||||
return;
|
||||
}
|
||||
|
@ -510,7 +510,7 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
|
|||
// Done.
|
||||
} else if (isxdigit(*s)) {
|
||||
PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-ThisTokBegin),
|
||||
diag::err_invalid_binary_digit) << std::string(s, s+1);
|
||||
diag::err_invalid_binary_digit) << llvm::StringRef(s, 1);
|
||||
hadError = true;
|
||||
}
|
||||
// Other suffixes will be diagnosed by the caller.
|
||||
|
@ -540,7 +540,7 @@ void NumericLiteralParser::ParseNumberStartingWithZero(SourceLocation TokLoc) {
|
|||
// the code is using an incorrect base.
|
||||
if (isxdigit(*s) && *s != 'e' && *s != 'E') {
|
||||
PP.Diag(PP.AdvanceToTokenCharacter(TokLoc, s-ThisTokBegin),
|
||||
diag::err_invalid_octal_digit) << std::string(s, s+1);
|
||||
diag::err_invalid_octal_digit) << llvm::StringRef(s, 1);
|
||||
hadError = true;
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -164,7 +164,7 @@ void Preprocessor::DumpToken(const Token &Tok, bool DumpFlags) const {
|
|||
llvm::errs() << " [ExpandDisabled]";
|
||||
if (Tok.needsCleaning()) {
|
||||
const char *Start = SourceMgr.getCharacterData(Tok.getLocation());
|
||||
llvm::errs() << " [UnClean='" << std::string(Start, Start+Tok.getLength())
|
||||
llvm::errs() << " [UnClean='" << llvm::StringRef(Start, Tok.getLength())
|
||||
<< "']";
|
||||
}
|
||||
|
||||
|
|
|
@ -492,7 +492,7 @@ bool TokenLexer::PasteTokens(Token &Tok) {
|
|||
PP.Diag(Loc,
|
||||
PP.getLangOptions().Microsoft ? diag::err_pp_bad_paste_ms
|
||||
: diag::err_pp_bad_paste)
|
||||
<< std::string(Buffer.begin(), Buffer.end());
|
||||
<< Buffer.str();
|
||||
}
|
||||
|
||||
// Do not consume the RHS.
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "clang/Lex/Preprocessor.h"
|
||||
#include "llvm/ADT/BitVector.h"
|
||||
#include "llvm/ADT/STLExtras.h"
|
||||
#include "llvm/ADT/StringExtras.h"
|
||||
#include "llvm/Support/raw_ostream.h"
|
||||
#include "clang/Basic/TargetBuiltins.h"
|
||||
#include "clang/Basic/TargetInfo.h"
|
||||
|
@ -315,8 +314,7 @@ bool Sema::CheckARMBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall) {
|
|||
unsigned Val = Result.getZExtValue();
|
||||
if (Val < l || Val > (u + l))
|
||||
return Diag(TheCall->getLocStart(), diag::err_argument_invalid_range)
|
||||
<< llvm::utostr(l) << llvm::utostr(u+l)
|
||||
<< TheCall->getArg(i)->getSourceRange();
|
||||
<< l << u+l << TheCall->getArg(i)->getSourceRange();
|
||||
|
||||
// FIXME: VFP Intrinsics should error if VFP not present.
|
||||
return false;
|
||||
|
|
|
@ -2436,7 +2436,7 @@ CheckExtVectorComponent(QualType baseType, SourceLocation OpLoc,
|
|||
// We didn't get to the end of the string. This means the component names
|
||||
// didn't come from the same set *or* we encountered an illegal name.
|
||||
Diag(OpLoc, diag::err_ext_vector_component_name_illegal)
|
||||
<< std::string(compStr,compStr+1) << SourceRange(CompLoc);
|
||||
<< llvm::StringRef(compStr, 1) << SourceRange(CompLoc);
|
||||
return QualType();
|
||||
}
|
||||
|
||||
|
|
|
@ -3862,7 +3862,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
|
|||
else
|
||||
Diag(Param->getLocation(),
|
||||
diag::note_partial_spec_unused_parameter)
|
||||
<< std::string("<anonymous>");
|
||||
<< "<anonymous>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче