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 | 712ef874534ee1bef41d1aa4664ae36148ec8b12 (patch) | |
tree | 9a56b13d87509a16a5235374885fb004bf468fc7 /lib/AST/DeclObjC.cpp | |
parent | 224bfeeaf046103937a5d1c8f8a9a7b79c6c14ed (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147210 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclObjC.cpp')
-rw-r--r-- | lib/AST/DeclObjC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/AST/DeclObjC.cpp b/lib/AST/DeclObjC.cpp index 2960b13d6d..a204e45bac 100644 --- a/lib/AST/DeclObjC.cpp +++ b/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); } |