diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-04 04:48:02 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-10-04 04:48:02 +0000 |
commit | 1711fc91efb36d131f7ba771f73f0154dc1abd1f (patch) | |
tree | ea5f1805dd7f1a99b466b8bb45994dcb3f2041ac /lib/Sema/SemaDeclObjC.cpp | |
parent | 55d78d2a41bed08f222a1eebf4feebec60ba1056 (diff) |
Improve location fidelity of objc decls.
-Add the location of the class name to all objc container decls, not just ObjCInterfaceDecl.
-Make objc decls consistent with the rest of the NamedDecls and have getLocation() point to the
class name, not the location of '@'.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@141061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index b4def893af..c1c000e030 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -376,9 +376,9 @@ ActOnStartClassInterface(SourceLocation AtInterfaceLoc, // FIXME: don't leak the objects passed in! return IDecl; } else { - IDecl->setLocation(AtInterfaceLoc); + IDecl->setLocation(ClassLoc); IDecl->setForwardDecl(false); - IDecl->setClassLoc(ClassLoc); + IDecl->setAtStartLoc(AtInterfaceLoc); // If the forward decl was in a PCH, we need to write it again in a // dependent AST file. IDecl->setChangedSinceDeserialization(true); @@ -595,8 +595,8 @@ Sema::ActOnStartProtocolInterface(SourceLocation AtProtoInterfaceLoc, // Repeat in dependent AST files. PDecl->setChangedSinceDeserialization(true); } else { - PDecl = ObjCProtocolDecl::Create(Context, CurContext, - AtProtoInterfaceLoc,ProtocolName); + PDecl = ObjCProtocolDecl::Create(Context, CurContext, ProtocolName, + ProtocolLoc, AtProtoInterfaceLoc); PushOnScopeChains(PDecl, TUScope); PDecl->setForwardDecl(false); } @@ -696,8 +696,8 @@ Sema::ActOnForwardProtocolDeclaration(SourceLocation AtProtocolLoc, ObjCProtocolDecl *PDecl = LookupProtocol(Ident, IdentList[i].second); bool isNew = false; if (PDecl == 0) { // Not already seen? - PDecl = ObjCProtocolDecl::Create(Context, CurContext, - IdentList[i].second, Ident); + PDecl = ObjCProtocolDecl::Create(Context, CurContext, Ident, + IdentList[i].second, AtProtocolLoc); PushOnScopeChains(PDecl, TUScope, false); isNew = true; } @@ -806,8 +806,8 @@ Decl *Sema::ActOnStartCategoryImplementation( } ObjCCategoryImplDecl *CDecl = - ObjCCategoryImplDecl::Create(Context, CurContext, AtCatImplLoc, CatName, - IDecl); + ObjCCategoryImplDecl::Create(Context, CurContext, CatName, IDecl, + ClassLoc, AtCatImplLoc); /// Check that class of this category is already completely declared. if (!IDecl || IDecl->isForwardDecl()) { Diag(ClassLoc, diag::err_undef_interface) << ClassName; @@ -925,8 +925,8 @@ Decl *Sema::ActOnStartClassImplementation( } ObjCImplementationDecl* IMPDecl = - ObjCImplementationDecl::Create(Context, CurContext, AtClassImplLoc, - IDecl, SDecl); + ObjCImplementationDecl::Create(Context, CurContext, IDecl, SDecl, + ClassLoc, AtClassImplLoc); if (CheckObjCDeclScope(IMPDecl)) return IMPDecl; |