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/AST/DeclObjC.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/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index d7775d5aad..48fbbe0c2b 100644 --- a/lib/AST/DeclObjC.cpp +++ b/lib/AST/DeclObjC.cpp @@ -603,11 +603,10 @@ ObjCInterfaceDecl *ObjCInterfaceDecl::Create(ASTContext &C, ObjCInterfaceDecl:: ObjCInterfaceDecl(DeclContext *DC, SourceLocation atLoc, IdentifierInfo *Id, SourceLocation CLoc, bool FD, bool isInternal) - : ObjCContainerDecl(ObjCInterface, DC, atLoc, Id), + : ObjCContainerDecl(ObjCInterface, DC, Id, CLoc, atLoc), TypeForDecl(0), SuperClass(0), CategoryList(0), IvarList(0), - ForwardDecl(FD), InternalInterface(isInternal), ExternallyCompleted(false), - ClassLoc(CLoc) { + ForwardDecl(FD), InternalInterface(isInternal), ExternallyCompleted(false) { } void ObjCInterfaceDecl::LoadExternalDefinition() const { @@ -847,9 +846,10 @@ ObjCAtDefsFieldDecl //===----------------------------------------------------------------------===// ObjCProtocolDecl *ObjCProtocolDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L, - IdentifierInfo *Id) { - return new (C) ObjCProtocolDecl(DC, L, Id); + IdentifierInfo *Id, + SourceLocation nameLoc, + SourceLocation atStartLoc) { + return new (C) ObjCProtocolDecl(DC, Id, nameLoc, atStartLoc); } ObjCProtocolDecl *ObjCProtocolDecl::lookupProtocolNamed(IdentifierInfo *Name) { @@ -979,9 +979,12 @@ void ObjCCategoryDecl::setImplementation(ObjCCategoryImplDecl *ImplD) { ObjCCategoryImplDecl * ObjCCategoryImplDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L,IdentifierInfo *Id, - ObjCInterfaceDecl *ClassInterface) { - return new (C) ObjCCategoryImplDecl(DC, L, Id, ClassInterface); + IdentifierInfo *Id, + ObjCInterfaceDecl *ClassInterface, + SourceLocation nameLoc, + SourceLocation atStartLoc) { + return new (C) ObjCCategoryImplDecl(DC, Id, ClassInterface, + nameLoc, atStartLoc); } ObjCCategoryDecl *ObjCCategoryImplDecl::getCategoryDecl() const { @@ -1056,10 +1059,12 @@ raw_ostream &clang::operator<<(raw_ostream &OS, ObjCImplementationDecl * ObjCImplementationDecl::Create(ASTContext &C, DeclContext *DC, - SourceLocation L, ObjCInterfaceDecl *ClassInterface, - ObjCInterfaceDecl *SuperDecl) { - return new (C) ObjCImplementationDecl(DC, L, ClassInterface, SuperDecl); + ObjCInterfaceDecl *SuperDecl, + SourceLocation nameLoc, + SourceLocation atStartLoc) { + return new (C) ObjCImplementationDecl(DC, ClassInterface, SuperDecl, + nameLoc, atStartLoc); } void ObjCImplementationDecl::setIvarInitializers(ASTContext &C, |