summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-04-02 18:30:49 +0000
committerSteve Naroff <snaroff@apple.com>2008-04-02 18:30:49 +0000
commit778927532d9624a5dd7c7b552f949d3d61aa3729 (patch)
tree5d7845053b0b32874a77389790ee48fded19b4c2 /clang/lib/Sema/SemaDeclObjC.cpp
parent586740f4011e0c2015cdfbb2c25ee13caca24bb8 (diff)
downloadbcm5719-llvm-778927532d9624a5dd7c7b552f949d3d61aa3729.tar.gz
bcm5719-llvm-778927532d9624a5dd7c7b552f949d3d61aa3729.zip
Change ObjCInterfaceDecl to inherit from NamedDecl (not TypeDecl). While ObjCInterfaceDecl is arguably a TypeDecl, it isn't a ScopedDecl. Since TypeDecl's are scoped, it makes sense to simply treat them as NamedDecl's. I could have fiddled a bit more with the hierarchy (in terms of creating a non-scoped TypeDecl), however this probably isn't worth the effort.
I also finished unifying access to scope decl change by converting Sema::getObjCInterfaceDecl() to use Sema::LookupDecl(). This is much cleaner now:-) llvm-svn: 49107
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 62e7c8af1e9..69a102203f4 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -101,10 +101,7 @@ Sema::DeclTy *Sema::ActOnStartClassInterface(
IDecl = ObjCInterfaceDecl::Create(Context, AtInterfaceLoc, NumProtocols,
ClassName);
- // Chain & install the interface decl into the identifier.
- IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
- ClassName->setFETokenInfo(IDecl);
-
+ ObjCInterfaceDecls[ClassName] = IDecl;
// Remember that this needs to be removed when the scope is popped.
TUScope->AddDecl(IDecl);
}
@@ -388,8 +385,7 @@ Sema::DeclTy *Sema::ActOnStartClassImplementation(
// Build, chain & install the interface decl into the identifier.
IDecl = ObjCInterfaceDecl::Create(Context, AtClassImplLoc, 0, ClassName,
false, true);
- IDecl->setNext(ClassName->getFETokenInfo<ScopedDecl>());
- ClassName->setFETokenInfo(IDecl);
+ ObjCInterfaceDecls[ClassName] = IDecl;
IDecl->setSuperClass(SDecl);
IDecl->setLocEnd(ClassLoc);
@@ -597,9 +593,7 @@ Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc,
if (!IDecl) { // Not already seen? Make a forward decl.
IDecl = ObjCInterfaceDecl::Create(Context, AtClassLoc, 0, IdentList[i],
true);
- // Chain & install the interface decl into the identifier.
- IDecl->setNext(IdentList[i]->getFETokenInfo<ScopedDecl>());
- IdentList[i]->setFETokenInfo(IDecl);
+ ObjCInterfaceDecls[IdentList[i]] = IDecl;
// Remember that this needs to be removed when the scope is popped.
TUScope->AddDecl(IDecl);
OpenPOWER on IntegriCloud