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 | 77324f385482d592ef54b286ffbb00f47b9259ac (patch) | |
tree | 7c60f2f71c6e87fbc3242d87e24cf4b23cd9d435 /clang/lib/AST/ASTContext.cpp | |
parent | d1f5e5d30458080f3591251d29bd6758f667a448 (diff) | |
download | bcm5719-llvm-77324f385482d592ef54b286ffbb00f47b9259ac.tar.gz bcm5719-llvm-77324f385482d592ef54b286ffbb00f47b9259ac.zip |
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.
llvm-svn: 59441
Diffstat (limited to 'clang/lib/AST/ASTContext.cpp')
-rw-r--r-- | clang/lib/AST/ASTContext.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/AST/ASTContext.cpp b/clang/lib/AST/ASTContext.cpp index e84cc4b3078..ee57816da3f 100644 --- a/clang/lib/AST/ASTContext.cpp +++ b/clang/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); |