Introduction the DeclarationName class, as a single, general method of
representing the names of declarations in the C family of
languages. DeclarationName is used in NamedDecl to store the name of
the declaration (naturally), and ObjCMethodDecl is now a NamedDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59441 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp
index e84cc4b..ee57816 100644
--- a/lib/AST/ASTContext.cpp
+++ b/lib/AST/ASTContext.cpp
@@ -33,7 +33,7 @@
unsigned size_reserve) :
CFConstantStringTypeDecl(0), ObjCFastEnumerationStateTypeDecl(0),
SourceMgr(SM), LangOpts(LOpts), Target(t),
- Idents(idents), Selectors(sels)
+ Idents(idents), Selectors(sels)
{
if (size_reserve > 0) Types.reserve(size_reserve);
InitBuiltinTypes();
@@ -996,7 +996,7 @@
/// alphabetically.
static bool CmpProtocolNames(const ObjCProtocolDecl *LHS,
const ObjCProtocolDecl *RHS) {
- return strcmp(LHS->getName(), RHS->getName()) < 0;
+ return LHS->getDeclName() < RHS->getDeclName();
}
static void SortAndUniqueProtocols(ObjCProtocolDecl **&Protocols,
@@ -1449,7 +1449,7 @@
// typedef <type> BOOL;
static bool isTypeTypedefedAsBOOL(QualType T) {
if (const TypedefType *TT = dyn_cast<TypedefType>(T))
- return !strcmp(TT->getDecl()->getName(), "BOOL");
+ return !strcmp(TT->getDecl()->getIdentifierName(), "BOOL");
return false;
}
@@ -2260,7 +2260,8 @@
unsigned size_reserve = D.ReadInt();
- ASTContext* A = new ASTContext(LOpts, SM, t, idents, sels, size_reserve);
+ ASTContext* A = new ASTContext(LOpts, SM, t, idents, sels,
+ size_reserve);
for (unsigned i = 0; i < size_reserve; ++i)
Type::Create(*A,i,D);