diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-01-16 16:38:58 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-01-16 16:38:58 +0000 |
commit | 071676f42240cc06cb404f53d8f53c90b45fbc66 (patch) | |
tree | 479fc261b919f633ab0fde382fdc843f0c7f2fb7 /clang/lib/Sema/SemaDeclObjC.cpp | |
parent | 41cab696fc775041f2fd35b3e54b0ef5ddce2bce (diff) | |
download | bcm5719-llvm-071676f42240cc06cb404f53d8f53c90b45fbc66.tar.gz bcm5719-llvm-071676f42240cc06cb404f53d8f53c90b45fbc66.zip |
Improve location information for Objective-C category declarations. We
previously only had a single location (the @ in @interface); now we
know where the @ is (for the start of the declaration), where the
class name is (that's the normal "location" now for diagnostics), and
where the category name is. Also, eliminated the redundant "end"
location, since ObjCContainerDecl already has better @end information.
The only XFAIL'd test is temporary; will un-XFAIL-it once I've taught
CIndex how to use the new locations.
llvm-svn: 93639
Diffstat (limited to 'clang/lib/Sema/SemaDeclObjC.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index cfea87504d4..ba21df776e1 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/lib/Sema/SemaDeclObjC.cpp @@ -597,7 +597,8 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, const SourceLocation *ProtoLocs, SourceLocation EndProtoLoc) { ObjCCategoryDecl *CDecl = - ObjCCategoryDecl::Create(Context, CurContext, AtInterfaceLoc, CategoryName); + ObjCCategoryDecl::Create(Context, CurContext, AtInterfaceLoc, ClassLoc, + CategoryLoc, CategoryName); // FIXME: PushOnScopeChains? CurContext->addDecl(CDecl); @@ -631,7 +632,6 @@ ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, if (NumProtoRefs) { CDecl->setProtocolList((ObjCProtocolDecl**)ProtoRefs, NumProtoRefs, ProtoLocs, Context); - CDecl->setLocEnd(EndProtoLoc); // Protocols in the class extension belong to the class. if (!CDecl->getIdentifier()) IDecl->mergeClassExtensionProtocolList((ObjCProtocolDecl**)ProtoRefs, @@ -658,6 +658,7 @@ Sema::DeclPtrTy Sema::ActOnStartCategoryImplementation( // Category @implementation with no corresponding @interface. // Create and install one. CatIDecl = ObjCCategoryDecl::Create(Context, CurContext, SourceLocation(), + SourceLocation(), SourceLocation(), CatName); CatIDecl->setClassInterface(IDecl); CatIDecl->insertNextClassCategory(); |