forked from OSchip/llvm-project
Use DW_AT_APPLE_objc_class_extension attribute to identify interfaces that represent class extension.
Radar 9423077. llvm-svn: 131239
This commit is contained in:
parent
2409e7843b
commit
36882c8f24
|
@ -1241,9 +1241,14 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty,
|
|||
uint64_t Size = CGM.getContext().getTypeSize(Ty);
|
||||
uint64_t Align = CGM.getContext().getTypeAlign(Ty);
|
||||
|
||||
unsigned Flags = 0;
|
||||
if (ID->getFirstClassExtension() ||
|
||||
(ID->getImplementation() && !ID->getImplementation()->ivar_empty()))
|
||||
Flags |= llvm::DIDescriptor::FlagObjcClassExtension;
|
||||
|
||||
llvm::DIType RealDecl =
|
||||
DBuilder.createStructType(Unit, ID->getName(), DefUnit,
|
||||
Line, Size, Align, 0,
|
||||
Line, Size, Align, Flags,
|
||||
Elements, RuntimeLang);
|
||||
|
||||
// Now that we have a real decl for the struct, replace anything using the
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -masm-verbose -S -g %s -o - | FileCheck %s
|
||||
|
||||
// CHECK: AT_APPLE_objc_class_extension
|
||||
|
||||
@interface I1
|
||||
@end
|
||||
|
||||
@implementation I1 {
|
||||
int myi2;
|
||||
}
|
||||
int myi;
|
||||
@end
|
||||
|
||||
void foo(I1 *iptr) {}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
// RUN: %clang_cc1 -fobjc-nonfragile-abi -masm-verbose -S -g %s -o - | FileCheck %s
|
||||
// CHECK: AT_APPLE_objc_class_extension
|
||||
|
||||
@interface Foo {} @end
|
||||
|
||||
@interface Foo () {
|
||||
int *bar;
|
||||
}
|
||||
@end
|
||||
|
||||
@implementation Foo
|
||||
@end
|
||||
|
||||
void bar(Foo *fptr) {}
|
Loading…
Reference in New Issue