Remove more superfluous .str() and replace std::string concatenation with Twine.
[oota-llvm.git] / lib / IR / Attributes.cpp
index daac6b5f639a8a60adf42f5e2980647e35210a1c..52cc71018e5bef2ec10b99eecf2390c7f3bdea9c 100644 (file)
@@ -298,12 +298,12 @@ std::string Attribute::getAsString(bool InAttrGrp) const {
   //
   if (isStringAttribute()) {
     std::string Result;
-    Result += '\"' + getKindAsString().str() + '"';
+    Result += (Twine('"') + getKindAsString() + Twine('"')).str();
 
     StringRef Val = pImpl->getValueAsString();
     if (Val.empty()) return Result;
 
-    Result += "=\"" + Val.str() + '"';
+    Result += ("=\"" + Val + Twine('"')).str();
     return Result;
   }