forked from OSchip/llvm-project
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
This commit is contained in:
parent
8570abdc56
commit
87b4ae6cab
|
@ -814,7 +814,9 @@ public:
|
|||
}
|
||||
|
||||
void setSuperClass(ObjCInterfaceDecl * superCls) {
|
||||
data().SuperClass = superCls;
|
||||
data().SuperClass =
|
||||
(superCls && superCls->hasDefinition()) ? superCls->getDefinition()
|
||||
: superCls;
|
||||
}
|
||||
|
||||
ObjCCategoryDecl* getCategoryList() const {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -36,3 +36,16 @@ void *sel_registerName(const char *);
|
|||
return [super allocWithZone:zone];
|
||||
}
|
||||
@end
|
||||
|
||||
@interface XNSArray
|
||||
{
|
||||
Class isa;
|
||||
}
|
||||
@end
|
||||
|
||||
@class XNSArray;
|
||||
|
||||
@interface __NSArray0 : XNSArray
|
||||
@end
|
||||
|
||||
@implementation __NSArray0 @end
|
||||
|
|
Loading…
Reference in New Issue