Random temporary string cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110807 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Lex/Lexer.cpp b/lib/Lex/Lexer.cpp
index b492d77..7e6f7c1 100644
--- a/lib/Lex/Lexer.cpp
+++ b/lib/Lex/Lexer.cpp
@@ -671,7 +671,7 @@
}
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;
}
diff --git a/lib/Lex/LiteralSupport.cpp b/lib/Lex/LiteralSupport.cpp
index 54d00ed..a12c4ae 100644
--- a/lib/Lex/LiteralSupport.cpp
+++ b/lib/Lex/LiteralSupport.cpp
@@ -323,7 +323,7 @@
// 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 @@
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 @@
// 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 @@
// 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;
}
diff --git a/lib/Lex/Preprocessor.cpp b/lib/Lex/Preprocessor.cpp
index fc1418f..77b88f7 100644
--- a/lib/Lex/Preprocessor.cpp
+++ b/lib/Lex/Preprocessor.cpp
@@ -164,7 +164,7 @@
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())
<< "']";
}
diff --git a/lib/Lex/TokenLexer.cpp b/lib/Lex/TokenLexer.cpp
index 5560949..49dc016 100644
--- a/lib/Lex/TokenLexer.cpp
+++ b/lib/Lex/TokenLexer.cpp
@@ -492,7 +492,7 @@
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.
diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp
index e822366..026d73a 100644
--- a/lib/Sema/SemaChecking.cpp
+++ b/lib/Sema/SemaChecking.cpp
@@ -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 @@
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;
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index d4b0538..e108ab5 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2436,7 +2436,7 @@
// 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();
}
diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp
index ee3f8b5..2864e00 100644
--- a/lib/Sema/SemaTemplate.cpp
+++ b/lib/Sema/SemaTemplate.cpp
@@ -3862,7 +3862,7 @@
else
Diag(Param->getLocation(),
diag::note_partial_spec_unused_parameter)
- << std::string("<anonymous>");
+ << "<anonymous>";
}
}
}