]> granicus.if.org Git - clang/commitdiff
Changing std::string to SmallString for r156826.
authorDavid Blaikie <dblaikie@gmail.com>
Tue, 15 May 2012 17:18:27 +0000 (17:18 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Tue, 15 May 2012 17:18:27 +0000 (17:18 +0000)
Based on code review feedback by Jordan Rose.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156827 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaChecking.cpp

index 9c637b89dd8f7c71085e54db74c550c57af30e13..1fc3c1aeff30d86105d8f75be077037f6704c970 100644 (file)
@@ -4084,11 +4084,11 @@ void DiagnoseFloatingLiteralImpCast(Sema &S, FloatingLiteral *FL, QualType T,
 
   SmallString<16> PrettySourceValue;
   Value.toString(PrettySourceValue);
-  std::string PrettyTargetValue;
+  SmallString<16> PrettyTargetValue;
   if (T->isSpecificBuiltinType(BuiltinType::Bool))
     PrettyTargetValue = IntegerValue == 0 ? "false" : "true";
   else
-    PrettyTargetValue = IntegerValue.toString(10);
+    IntegerValue.toString(PrettyTargetValue);
 
   S.Diag(FL->getExprLoc(), diag::warn_impcast_literal_float_to_integer)
     << FL->getType() << T.getUnqualifiedType() << PrettySourceValue