diff options
author | Douglas Gregor <dgregor@apple.com> | 2008-11-17 14:58:09 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2008-11-17 14:58:09 +0000 |
commit | 2e1cd4264d363ca869bf37ef160902f211d21b8c (patch) | |
tree | b4e6314529ad811be3463a668f8b4e515f66fbcc /lib/AST/ASTContext.cpp | |
parent | b8abbdc90f902a2c09c566193b900c2c45a46672 (diff) |
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
Diffstat (limited to 'lib/AST/ASTContext.cpp')
-rw-r--r-- | lib/AST/ASTContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/AST/ASTContext.cpp b/lib/AST/ASTContext.cpp index e84cc4b307..ee57816da3 100644 --- a/lib/AST/ASTContext.cpp +++ b/lib/AST/ASTContext.cpp @@ -33,7 +33,7 @@ ASTContext::ASTContext(const LangOptions& LOpts, SourceManager &SM, 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 @@ QualType ASTContext::getObjCInterfaceType(ObjCInterfaceDecl *Decl) { /// 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 @@ QualType ASTContext::getObjCFastEnumerationStateType() // 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 @@ ASTContext* ASTContext::Create(llvm::Deserializer& D) { 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); |