[cfe-commits] r93981 - /cfe/trunk/lib/Frontend/InitPreprocessor.cpp

Daniel Dunbar daniel at zuster.org
Tue Jan 19 22:09:53 PST 2010


Author: ddunbar
Date: Wed Jan 20 00:09:53 2010
New Revision: 93981

URL: http://llvm.org/viewvc/llvm-project?rev=93981&view=rev
Log:
Fix an invalid Twine use spotty by abbeyj, it isn't safe to use Twine
temporaries (this is one reason I'm nervous about propagating their use beyond
particularly performance critical places).

Modified:
    cfe/trunk/lib/Frontend/InitPreprocessor.cpp

Modified: cfe/trunk/lib/Frontend/InitPreprocessor.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/InitPreprocessor.cpp?rev=93981&r1=93980&r2=93981&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/InitPreprocessor.cpp (original)
+++ cfe/trunk/lib/Frontend/InitPreprocessor.cpp Wed Jan 20 00:09:53 2010
@@ -137,7 +137,10 @@
                "1.79769313486231580793728971405301e+308L",
                "1.18973149535723176508575932662800702e+4932L");
 
-  llvm::Twine DefPrefix = "__" + Prefix + "_";
+  llvm::SmallString<32> DefPrefix;
+  DefPrefix = "__";
+  DefPrefix += Prefix;
+  DefPrefix += "_";
 
   Builder.defineMacro(DefPrefix + "DENORM_MIN__", DenormMin);
   Builder.defineMacro(DefPrefix + "HAS_DENORM__");





More information about the cfe-commits mailing list