]> granicus.if.org Git - clang/commitdiff
Eliminate a bunch of temporary strings.
authorBenjamin Kramer <benny.kra@googlemail.com>
Tue, 26 Jul 2011 16:59:25 +0000 (16:59 +0000)
committerBenjamin Kramer <benny.kra@googlemail.com>
Tue, 26 Jul 2011 16:59:25 +0000 (16:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136092 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaCodeComplete.cpp
tools/libclang/CIndexCodeCompletion.cpp

index 01e95174e2cd4e96b986600fbd5c6b908c5e1d16..f91d690796790c38ba7abe2c70f85796e7c6d276 100644 (file)
@@ -2490,7 +2490,7 @@ CodeCompletionResult::CreateCodeCompletionString(Sema &S,
         if (Idx > StartParameter)
           Result.AddChunk(CodeCompletionString::CK_HorizontalSpace);
         if (IdentifierInfo *II = Sel.getIdentifierInfoForSlot(Idx))
-          Keyword += II->getName().str();
+          Keyword += II->getName();
         Keyword += ":";
         if (Idx < StartParameter || AllParametersAreInformative)
           Result.AddInformativeChunk(Result.getAllocator().CopyString(Keyword));
@@ -2511,7 +2511,7 @@ CodeCompletionResult::CreateCodeCompletionString(Sema &S,
         Arg = "(" + Arg + ")";
         if (IdentifierInfo *II = (*P)->getIdentifier())
           if (DeclaringEntity || AllParametersAreInformative)
-            Arg += II->getName().str();
+            Arg += II->getName();
       }
       
       if (Method->isVariadic() && (P + 1) == PEnd)
@@ -5203,7 +5203,7 @@ void Sema::CodeCompleteObjCSelector(Scope *S, IdentifierInfo **SelIdents,
         }
       }
       
-      Accumulator += Sel.getNameForSlot(I).str();
+      Accumulator += Sel.getNameForSlot(I);
       Accumulator += ':';
     }
     Builder.AddTypedTextChunk(Builder.getAllocator().CopyString( Accumulator));
@@ -5530,7 +5530,7 @@ void Sema::CodeCompleteObjCPropertySynthesizeIvar(Scope *S,
   bool SawSimilarlyNamedIvar = false;
   std::string NameWithPrefix;
   NameWithPrefix += '_';
-  NameWithPrefix += PropertyName->getName().str();
+  NameWithPrefix += PropertyName->getName();
   std::string NameWithSuffix = PropertyName->getName().str();
   NameWithSuffix += '_';
   for(; Class; Class = Class->getSuperClass()) {
index 84050b2cfdcaee6c604aa6ea963ee3146d520e15..9dbc7fa2a8feb51fa50d317e85843d6178e07eef 100644 (file)
@@ -508,7 +508,7 @@ namespace {
           IdentifierInfo *selIdent = Context.getSelIdents()[i];
           if (selIdent != NULL) {
             StringRef selectorString = Context.getSelIdents()[i]->getName();
-            AllocatedResults.Selector += selectorString.str();
+            AllocatedResults.Selector += selectorString;
           }
           AllocatedResults.Selector += ":";
         }