diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2011-12-23 00:31:02 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2011-12-23 00:31:02 +0000 |
commit | 87b4ae6cab83798afe15c8c5a0b1ed952c7be26c (patch) | |
tree | 79b75361b63d274829ea39c16a218954317f2e67 /clang/lib/AST/DeclObjC.cpp | |
parent | 8570abdc56e4415500fd11cdf76e78ce5af3088b (diff) | |
download | bcm5719-llvm-87b4ae6cab83798afe15c8c5a0b1ed952c7be26c.tar.gz bcm5719-llvm-87b4ae6cab83798afe15c8c5a0b1ed952c7be26c.zip |
objective-c: Use class definition AST in several situations when
building related objc ASTs which require a class definition AST.
These were uncovered when testing objc rewriter.
llvm-svn: 147210
Diffstat (limited to 'clang/lib/AST/DeclObjC.cpp')
-rw-r--r-- | clang/lib/AST/DeclObjC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclObjC.cpp b/clang/lib/AST/DeclObjC.cpp index 2960b13d6de..a204e45bac9 100644 --- a/clang/lib/AST/DeclObjC.cpp +++ b/clang/lib/AST/DeclObjC.cpp @@ -1112,6 +1112,8 @@ ObjCCategoryImplDecl::Create(ASTContext &C, DeclContext *DC, SourceLocation nameLoc, SourceLocation atStartLoc, SourceLocation CategoryNameLoc) { + if (ClassInterface && ClassInterface->hasDefinition()) + ClassInterface = ClassInterface->getDefinition(); return new (C) ObjCCategoryImplDecl(DC, Id, ClassInterface, nameLoc, atStartLoc, CategoryNameLoc); } @@ -1196,6 +1198,8 @@ ObjCImplementationDecl::Create(ASTContext &C, DeclContext *DC, ObjCInterfaceDecl *SuperDecl, SourceLocation nameLoc, SourceLocation atStartLoc) { + if (ClassInterface && ClassInterface->hasDefinition()) + ClassInterface = ClassInterface->getDefinition(); return new (C) ObjCImplementationDecl(DC, ClassInterface, SuperDecl, nameLoc, atStartLoc); } |