]> granicus.if.org Git - clang/commitdiff
Random temporary string cleanup.
authorBenjamin Kramer <benny.kra@googlemail.com>
Wed, 11 Aug 2010 14:47:12 +0000 (14:47 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Wed, 11 Aug 2010 14:47:12 +0000 (14:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110807 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/Lexer.cpp
lib/Lex/LiteralSupport.cpp
lib/Lex/Preprocessor.cpp
lib/Lex/TokenLexer.cpp
lib/Sema/SemaChecking.cpp
lib/Sema/SemaExpr.cpp
lib/Sema/SemaTemplate.cpp

index b492d77691777ea9bc9b78806bb7efe25c90e718..7e6f7c1af6373bd5aa58397e80b50485b15014c7 100644 (file)
@@ -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;
 }
 
index 54d00ed07dbbd21135a5055d694cc671613e96a6..a12c4ae0d4014655ba76edba0a8929508d887649 100644 (file)
@@ -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;
   }
index fc1418ffef63d7eaaea6d49aa623ca82c6b0c338..77b88f7e47c45d8cfbdf1b0ab7ca746859110c0a 100644 (file)
@@ -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())
                  << "']";
   }
 
index 55609492a7f1e44548312fd0ea09f26e98f517dc..49dc016590ab96e738b0f61a851f06e3e5fe80eb 100644 (file)
@@ -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.
index e8223668425fb08961ab23301e8acfd216a10d1c..026d73aa50a7d9879e85c1329ced496393e41674 100644 (file)
@@ -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;
index d4b05389f4931656cd6c5ee0f9df4e74a66581fd..e108ab59cecbea6187f4fc3424342eb6516d5162 100644 (file)
@@ -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();
   }
 
index ee3f8b5487aacaac6820b5c9288ac75646a0f02a..2864e006294f7f81b77c2d97b0751721c7755d82 100644 (file)
@@ -3862,7 +3862,7 @@ Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec,
           else
             Diag(Param->getLocation(),
                  diag::note_partial_spec_unused_parameter)
-              << std::string("<anonymous>");
+              << "<anonymous>";
         }
       }
     }