[cfe-commits] r84447 - in /cfe/trunk: include/clang/AST/ include/clang/Basic/ lib/AST/ lib/Analysis/ lib/Basic/ lib/CodeGen/ lib/Frontend/ lib/Parse/ lib/Sema/

Daniel Dunbar daniel at zuster.org
Sun Oct 18 14:17:36 PDT 2009


Author: ddunbar
Date: Sun Oct 18 16:17:35 2009
New Revision: 84447

URL: http://llvm.org/viewvc/llvm-project?rev=84447&view=rev
Log:
PR5218: Replace IdentifierInfo::getName with StringRef version, now that clients
are updated.

Modified:
    cfe/trunk/include/clang/AST/Decl.h
    cfe/trunk/include/clang/Basic/IdentifierTable.h
    cfe/trunk/lib/AST/ASTContext.cpp
    cfe/trunk/lib/AST/DeclarationName.cpp
    cfe/trunk/lib/AST/Expr.cpp
    cfe/trunk/lib/AST/Type.cpp
    cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
    cfe/trunk/lib/Analysis/CFRefCount.cpp
    cfe/trunk/lib/Analysis/GRExprEngine.cpp
    cfe/trunk/lib/Analysis/LiveVariables.cpp
    cfe/trunk/lib/Basic/Diagnostic.cpp
    cfe/trunk/lib/Basic/IdentifierTable.cpp
    cfe/trunk/lib/CodeGen/CGObjCMac.cpp
    cfe/trunk/lib/CodeGen/Mangle.cpp
    cfe/trunk/lib/Frontend/AnalysisConsumer.cpp
    cfe/trunk/lib/Frontend/CacheTokens.cpp
    cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp
    cfe/trunk/lib/Frontend/RewriteMacros.cpp
    cfe/trunk/lib/Frontend/RewriteObjC.cpp
    cfe/trunk/lib/Parse/AttributeList.cpp
    cfe/trunk/lib/Parse/ParseInit.cpp
    cfe/trunk/lib/Parse/ParseStmt.cpp
    cfe/trunk/lib/Sema/SemaDecl.cpp
    cfe/trunk/lib/Sema/SemaDeclAttr.cpp

Modified: cfe/trunk/include/clang/AST/Decl.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Decl.h?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/Decl.h (original)
+++ cfe/trunk/include/clang/AST/Decl.h Sun Oct 18 16:17:35 2009
@@ -101,7 +101,7 @@
   /// identifier.
   llvm::StringRef getName() const {
     assert(getIdentifier() && "Name is not a simple identifier");
-    return getIdentifier()->getNameStr();
+    return getIdentifier()->getName();
   }
 
   /// getNameAsCString - Get the name of identifier for this declaration as a

Modified: cfe/trunk/include/clang/Basic/IdentifierTable.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/IdentifierTable.h?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/include/clang/Basic/IdentifierTable.h (original)
+++ cfe/trunk/include/clang/Basic/IdentifierTable.h Sun Oct 18 16:17:35 2009
@@ -104,13 +104,8 @@
     return (((unsigned) p[0]) | (((unsigned) p[1]) << 8)) - 1;
   }
 
-  // FIXME: Deprecated.
-  const char *getName() const {
-    return getNameStart();
-  }
-
-  /// getNameStr - Return the actual identifier string.
-  llvm::StringRef getNameStr() const {
+  /// getName - Return the actual identifier string.
+  llvm::StringRef getName() const {
     return llvm::StringRef(getNameStart(), getLength());
   }
 
@@ -477,7 +472,7 @@
                                       const IdentifierInfo *Name) {
     llvm::SmallString<100> SelectorName;
     SelectorName = "set";
-    SelectorName += Name->getNameStr();
+    SelectorName += Name->getName();
     SelectorName[3] = toupper(SelectorName[3]);
     IdentifierInfo *SetterName =
       &Idents.get(SelectorName.data(),

Modified: cfe/trunk/lib/AST/ASTContext.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ASTContext.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ASTContext.cpp (original)
+++ cfe/trunk/lib/AST/ASTContext.cpp Sun Oct 18 16:17:35 2009
@@ -2924,6 +2924,7 @@
   S += llvm::utostr(N);
 }
 
+// FIXME: Use SmallString for accumulating string.
 void ASTContext::getObjCEncodingForTypeImpl(QualType T, std::string& S,
                                             bool ExpandPointedToStructures,
                                             bool ExpandStructures,

Modified: cfe/trunk/lib/AST/DeclarationName.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclarationName.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/AST/DeclarationName.cpp (original)
+++ cfe/trunk/lib/AST/DeclarationName.cpp Sun Oct 18 16:17:35 2009
@@ -51,7 +51,7 @@
 bool operator<(DeclarationName LHS, DeclarationName RHS) {
   if (IdentifierInfo *LhsId = LHS.getAsIdentifierInfo())
     if (IdentifierInfo *RhsId = RHS.getAsIdentifierInfo())
-      return LhsId->getNameStr() < RhsId->getNameStr();
+      return LhsId->getName() < RhsId->getName();
 
   return LHS.getAsOpaqueInteger() < RHS.getAsOpaqueInteger();
 }

Modified: cfe/trunk/lib/AST/Expr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Expr.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Expr.cpp (original)
+++ cfe/trunk/lib/AST/Expr.cpp Sun Oct 18 16:17:35 2009
@@ -1754,7 +1754,7 @@
 bool ExtVectorElementExpr::containsDuplicateElements() const {
   // FIXME: Refactor this code to an accessor on the AST node which returns the
   // "type" of component access, and share with code below and in Sema.
-  llvm::StringRef Comp = Accessor->getNameStr();
+  llvm::StringRef Comp = Accessor->getName();
 
   // Halving swizzles do not contain duplicate elements.
   if (Comp == "hi" || Comp == "lo" || Comp == "even" || Comp == "odd")

Modified: cfe/trunk/lib/AST/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Type.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/AST/Type.cpp (original)
+++ cfe/trunk/lib/AST/Type.cpp Sun Oct 18 16:17:35 2009
@@ -1254,7 +1254,7 @@
 void TypedefType::getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const {
   if (!InnerString.empty())    // Prefix the basic type, e.g. 'typedefname X'.
     InnerString = ' ' + InnerString;
-  InnerString = getDecl()->getIdentifier()->getNameStr().str() + InnerString;
+  InnerString = getDecl()->getIdentifier()->getName().str() + InnerString;
 }
 
 void TemplateTypeParmType::getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const {
@@ -1265,7 +1265,7 @@
     InnerString = "type-parameter-" + llvm::utostr_32(Depth) + '-' +
       llvm::utostr_32(Index) + InnerString;
   else
-    InnerString = Name->getNameStr().str() + InnerString;
+    InnerString = Name->getName().str() + InnerString;
 }
 
 void SubstTemplateTypeParmType::getAsStringInternal(std::string &InnerString, const PrintingPolicy &Policy) const {
@@ -1541,7 +1541,7 @@
                                            TemplateArgs.getFlatArgumentList(),
                                            TemplateArgs.flat_size(),
                                            Policy);
-        MyPart = Spec->getIdentifier()->getNameStr().str() + TemplateArgsStr;
+        MyPart = Spec->getIdentifier()->getName().str() + TemplateArgsStr;
       } else if (TagDecl *Tag = dyn_cast<TagDecl>(DC)) {
         if (TypedefDecl *Typedef = Tag->getTypedefForAnonDecl())
           MyPart = Typedef->getIdentifier()->getName();

Modified: cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp (original)
+++ cfe/trunk/lib/Analysis/BasicObjCFoundationChecks.cpp Sun Oct 18 16:17:35 2009
@@ -115,7 +115,7 @@
     return false;
 
   if (isNSString(ReceiverType,
-                 ReceiverType->getDecl()->getIdentifier()->getNameStr()))
+                 ReceiverType->getDecl()->getIdentifier()->getName()))
     return AuditNSString(N, ME);
 
   return false;

Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
+++ cfe/trunk/lib/Analysis/CFRefCount.cpp Sun Oct 18 16:17:35 2009
@@ -213,7 +213,7 @@
 
   // Recursively walk the typedef stack, allowing typedefs of reference types.
   while (TypedefType* TD = dyn_cast<TypedefType>(RetTy.getTypePtr())) {
-    llvm::StringRef TDName = TD->getDecl()->getIdentifier()->getNameStr();
+    llvm::StringRef TDName = TD->getDecl()->getIdentifier()->getName();
     if (TDName.startswith(prefix) && TDName.endswith("Ref"))
       return true;
 

Modified: cfe/trunk/lib/Analysis/GRExprEngine.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/GRExprEngine.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/GRExprEngine.cpp (original)
+++ cfe/trunk/lib/Analysis/GRExprEngine.cpp Sun Oct 18 16:17:35 2009
@@ -207,7 +207,7 @@
   if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {
     // Precondition: the first argument of 'main' is an integer guaranteed
     //  to be > 0.
-    if (FD->getIdentifier()->getNameStr() == "main" &&
+    if (FD->getIdentifier()->getName() == "main" &&
         FD->getNumParams() > 0) {
       const ParmVarDecl *PD = FD->getParamDecl(0);
       QualType T = PD->getType();

Modified: cfe/trunk/lib/Analysis/LiveVariables.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/LiveVariables.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Analysis/LiveVariables.cpp (original)
+++ cfe/trunk/lib/Analysis/LiveVariables.cpp Sun Oct 18 16:17:35 2009
@@ -339,7 +339,7 @@
   for (AnalysisDataTy::decl_iterator I = AD.begin_decl(),
                                      E = AD.end_decl(); I!=E; ++I)
     if (V.getDeclBit(I->second)) {
-      llvm::errs() << "  " << I->first->getIdentifier()->getNameStr() << " <";
+      llvm::errs() << "  " << I->first->getIdentifier()->getName() << " <";
       I->first->getLocation().dump(SM);
       llvm::errs() << ">\n";
     }

Modified: cfe/trunk/lib/Basic/Diagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Diagnostic.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/Diagnostic.cpp (original)
+++ cfe/trunk/lib/Basic/Diagnostic.cpp Sun Oct 18 16:17:35 2009
@@ -794,7 +794,7 @@
         continue;
       }
 
-      llvm::raw_svector_ostream(OutStr) << '\'' << II->getNameStr() << '\'';
+      llvm::raw_svector_ostream(OutStr) << '\'' << II->getName() << '\'';
       break;
     }
     case Diagnostic::ak_qualtype:

Modified: cfe/trunk/lib/Basic/IdentifierTable.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/IdentifierTable.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Basic/IdentifierTable.cpp (original)
+++ cfe/trunk/lib/Basic/IdentifierTable.cpp Sun Oct 18 16:17:35 2009
@@ -306,7 +306,7 @@
   llvm::raw_svector_ostream OS(Str);
   for (keyword_iterator I = keyword_begin(), E = keyword_end(); I != E; ++I) {
     if (*I)
-      OS << (*I)->getNameStr();
+      OS << (*I)->getName();
     OS << ':';
   }
 
@@ -322,12 +322,12 @@
 
     // If the number of arguments is 0 then II is guaranteed to not be null.
     if (getNumArgs() == 0)
-      return II->getNameStr();
+      return II->getName();
 
     if (!II)
       return ":";
 
-    return II->getNameStr().str() + ":";
+    return II->getName().str() + ":";
   }
 
   // We have a multiple keyword selector (no embedded flags).

Modified: cfe/trunk/lib/CodeGen/CGObjCMac.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGObjCMac.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/CGObjCMac.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGObjCMac.cpp Sun Oct 18 16:17:35 2009
@@ -3502,11 +3502,11 @@
     llvm::raw_svector_ostream OS(Asm);
     for (llvm::SetVector<IdentifierInfo*>::iterator I = LazySymbols.begin(),
            e = LazySymbols.end(); I != e; ++I)
-      OS << "\t.lazy_reference .objc_class_name_" << (*I)->getNameStr() << "\n";
+      OS << "\t.lazy_reference .objc_class_name_" << (*I)->getName() << "\n";
     for (llvm::SetVector<IdentifierInfo*>::iterator I = DefinedSymbols.begin(),
            e = DefinedSymbols.end(); I != e; ++I)
-      OS << "\t.objc_class_name_" << (*I)->getNameStr() << "=0\n"
-         << "\t.globl .objc_class_name_" << (*I)->getNameStr() << "\n";
+      OS << "\t.objc_class_name_" << (*I)->getName() << "=0\n"
+         << "\t.globl .objc_class_name_" << (*I)->getName() << "\n";
 
     CGM.getModule().setModuleInlineAsm(OS.str());
   }
@@ -5673,7 +5673,7 @@
                                  llvm::GlobalValue::ExternalLinkage,
                                  0,
                                  ("OBJC_EHTYPE_$_" +
-                                  ID->getIdentifier()->getNameStr()));
+                                  ID->getIdentifier()->getName()));
   }
 
   // Otherwise we need to either make a new entry or fill in the
@@ -5705,7 +5705,7 @@
                                      llvm::GlobalValue::WeakAnyLinkage,
                                      Init,
                                      ("OBJC_EHTYPE_$_" +
-                                      ID->getIdentifier()->getNameStr()));
+                                      ID->getIdentifier()->getName()));
   }
 
   if (CGM.getLangOptions().getVisibilityMode() == LangOptions::Hidden)

Modified: cfe/trunk/lib/CodeGen/Mangle.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/Mangle.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/CodeGen/Mangle.cpp (original)
+++ cfe/trunk/lib/CodeGen/Mangle.cpp Sun Oct 18 16:17:35 2009
@@ -1236,7 +1236,7 @@
   if (!isCharType(TemplateArgs[0].getAsType()))
     return false;
   
-  return SD->getIdentifier()->getNameStr() == Name;
+  return SD->getIdentifier()->getName() == Name;
 }
 
 bool CXXNameMangler::mangleStandardSubstitution(const NamedDecl *ND) {

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

==============================================================================
--- cfe/trunk/lib/Frontend/AnalysisConsumer.cpp (original)
+++ cfe/trunk/lib/Frontend/AnalysisConsumer.cpp Sun Oct 18 16:17:35 2009
@@ -196,7 +196,7 @@
     case Decl::Function: {
       FunctionDecl* FD = cast<FunctionDecl>(D);
 
-      if (Opts.AnalyzeSpecificFunction.size() > 0 &&
+      if (!Opts.AnalyzeSpecificFunction.empty() &&
           Opts.AnalyzeSpecificFunction != FD->getIdentifier()->getName())
         break;
 

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

==============================================================================
--- cfe/trunk/lib/Frontend/CacheTokens.cpp (original)
+++ cfe/trunk/lib/Frontend/CacheTokens.cpp Sun Oct 18 16:17:35 2009
@@ -586,7 +586,7 @@
   typedef data_type data_type_ref;
 
   static unsigned ComputeHash(PTHIdKey* key) {
-    return llvm::HashString(key->II->getNameStr());
+    return llvm::HashString(key->II->getName());
   }
 
   static std::pair<unsigned,unsigned>

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

==============================================================================
--- cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp (original)
+++ cfe/trunk/lib/Frontend/PrintPreprocessedOutput.cpp Sun Oct 18 16:17:35 2009
@@ -399,7 +399,7 @@
     }
 
     if (IdentifierInfo *II = Tok.getIdentifierInfo()) {
-      OS << II->getNameStr();
+      OS << II->getName();
     } else if (Tok.isLiteral() && !Tok.needsCleaning() &&
                Tok.getLiteralData()) {
       OS.write(Tok.getLiteralData(), Tok.getLength());
@@ -434,7 +434,7 @@
   struct SortMacrosByID {
     typedef std::pair<IdentifierInfo*, MacroInfo*> id_macro_pair;
     bool operator()(const id_macro_pair &LHS, const id_macro_pair &RHS) const {
-      return LHS.first->getNameStr() < RHS.first->getNameStr();
+      return LHS.first->getName() < RHS.first->getName();
     }
   };
 }

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

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteMacros.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteMacros.cpp Sun Oct 18 16:17:35 2009
@@ -128,12 +128,12 @@
       // comment the line out.
       if (RawTokens[CurRawTok].is(tok::identifier)) {
         const IdentifierInfo *II = RawTokens[CurRawTok].getIdentifierInfo();
-        if (II->getNameStr() == "warning") {
+        if (II->getName() == "warning") {
           // Comment out #warning.
           RB.InsertTextAfter(SM.getFileOffset(RawTok.getLocation()), "//");
-        } else if (II->getNameStr() == "pragma" &&
+        } else if (II->getName() == "pragma" &&
                    RawTokens[CurRawTok+1].is(tok::identifier) &&
-                   (RawTokens[CurRawTok+1].getIdentifierInfo()->getNameStr() ==
+                   (RawTokens[CurRawTok+1].getIdentifierInfo()->getName() ==
                     "mark")) {
           // Comment out #pragma mark.
           RB.InsertTextAfter(SM.getFileOffset(RawTok.getLocation()), "//");

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

==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Sun Oct 18 16:17:35 2009
@@ -2265,7 +2265,7 @@
   if (clsName) { // class message.
     // FIXME: We need to fix Sema (and the AST for ObjCMessageExpr) to handle
     // the 'super' idiom within a class method.
-    if (clsName->getNameStr() == "super") {
+    if (clsName->getName() == "super") {
       MsgSendFlavor = MsgSendSuperFunctionDecl;
       if (MsgSendStretFlavor)
         MsgSendStretFlavor = MsgSendSuperStretFunctionDecl;

Modified: cfe/trunk/lib/Parse/AttributeList.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/AttributeList.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/AttributeList.cpp (original)
+++ cfe/trunk/lib/Parse/AttributeList.cpp Sun Oct 18 16:17:35 2009
@@ -45,7 +45,7 @@
 }
 
 AttributeList::Kind AttributeList::getKind(const IdentifierInfo *Name) {
-  llvm::StringRef AttrName = Name->getNameStr();
+  llvm::StringRef AttrName = Name->getName();
 
   // Normalize the attribute name, __foo__ becomes foo.
   if (AttrName.startswith("__") && AttrName.endswith("__"))

Modified: cfe/trunk/lib/Parse/ParseInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseInit.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseInit.cpp (original)
+++ cfe/trunk/lib/Parse/ParseInit.cpp Sun Oct 18 16:17:35 2009
@@ -67,7 +67,7 @@
     const IdentifierInfo *FieldName = Tok.getIdentifierInfo();
 
     llvm::SmallString<256> NewSyntax;
-    llvm::raw_svector_ostream(NewSyntax) << '.' << FieldName->getNameStr()
+    llvm::raw_svector_ostream(NewSyntax) << '.' << FieldName->getName()
                                          << " = ";
 
     SourceLocation NameLoc = ConsumeToken(); // Eat the identifier.

Modified: cfe/trunk/lib/Parse/ParseStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseStmt.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseStmt.cpp (original)
+++ cfe/trunk/lib/Parse/ParseStmt.cpp Sun Oct 18 16:17:35 2009
@@ -1283,7 +1283,7 @@
       IdentifierInfo *II = Tok.getIdentifierInfo();
       ConsumeToken();
 
-      Names.push_back(II->getNameStr());
+      Names.push_back(II->getName());
       MatchRHSPunctuation(tok::r_square, Loc);
     } else
       Names.push_back(std::string());

Modified: cfe/trunk/lib/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDecl.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDecl.cpp Sun Oct 18 16:17:35 2009
@@ -218,7 +218,7 @@
       << &II << DC << SS->getRange();
   else if (isDependentScopeSpecifier(*SS)) {
     Diag(SS->getRange().getBegin(), diag::err_typename_missing)
-      << (NestedNameSpecifier *)SS->getScopeRep() << II.getName() 
+      << (NestedNameSpecifier *)SS->getScopeRep() << II.getName()
       << SourceRange(SS->getRange().getBegin(), IILoc)
       << CodeModificationHint::CreateInsertion(SS->getRange().getBegin(),
                                                "typename ");
@@ -3729,7 +3729,7 @@
       if (FTI.ArgInfo[i].Param == 0) {
         llvm::SmallString<256> Code;
         llvm::raw_svector_ostream(Code) << "  int "
-                                        << FTI.ArgInfo[i].Ident->getNameStr()
+                                        << FTI.ArgInfo[i].Ident->getName()
                                         << ";\n";
         Diag(FTI.ArgInfo[i].IdentLoc, diag::ext_param_not_declared)
           << FTI.ArgInfo[i].Ident
@@ -3996,7 +3996,7 @@
   }
 
   // Extension in C99.  Legal in C90, but warn about it.
-  if (II.getNameStr().startswith("__builtin_"))
+  if (II.getName().startswith("__builtin_"))
     Diag(Loc, diag::warn_builtin_unknown) << &II;
   else if (getLangOptions().C99)
     Diag(Loc, diag::ext_implicit_function_decl) << &II;

Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=84447&r1=84446&r2=84447&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Sun Oct 18 16:17:35 2009
@@ -1255,7 +1255,7 @@
   unsigned NumArgs  = getFunctionOrMethodNumArgs(d);
   unsigned FirstIdx = 1;
 
-  llvm::StringRef Format = Attr.getParameterName()->getNameStr();
+  llvm::StringRef Format = Attr.getParameterName()->getName();
 
   // Normalize the argument, __foo__ becomes foo.
   if (Format.startswith("__") && Format.endswith("__"))
@@ -1265,7 +1265,7 @@
   FormatAttrKind Kind = getFormatAttrKind(Format);
   if (Kind == InvalidFormat) {
     S.Diag(Attr.getLoc(), diag::warn_attribute_type_not_supported)
-      << "format" << Attr.getParameterName()->getNameStr();
+      << "format" << Attr.getParameterName()->getName();
     return;
   }
 
@@ -1503,7 +1503,7 @@
     return;
   }
 
-  llvm::StringRef Str = Attr.getParameterName()->getNameStr();
+  llvm::StringRef Str = Attr.getParameterName()->getName();
 
   // Normalize the attribute name, __foo__ becomes foo.
   if (Str.startswith("__") && Str.endswith("__"))





More information about the cfe-commits mailing list