void BuildAggrIvarRecordLayout(const RecordType *RT,
unsigned int BytePos, bool ForStrongLayout,
bool &HasUnion);
- void BuildAggrIvarLayout(const ObjCInterfaceDecl *OI,
+ void BuildAggrIvarLayout(const ObjCImplementationDecl *OI,
const llvm::StructLayout *Layout,
const RecordDecl *RD,
const llvm::SmallVectorImpl<FieldDecl*> &RecFields,
llvm::Constant *GetProtocolRef(const ObjCProtocolDecl *PD);
/// GetFieldBaseOffset - return's field byte offset.
- uint64_t GetFieldBaseOffset(const ObjCInterfaceDecl *OI,
+ uint64_t GetFieldBaseOffset(const ObjCImplementationDecl *OI,
const llvm::StructLayout *Layout,
const FieldDecl *Field);
}
/// GetFieldBaseOffset - return the field's byte offset.
-uint64_t CGObjCCommonMac::GetFieldBaseOffset(const ObjCInterfaceDecl *OI,
+uint64_t CGObjCCommonMac::GetFieldBaseOffset(const ObjCImplementationDecl *OI,
const llvm::StructLayout *Layout,
const FieldDecl *Field) {
// Is this a C struct?
ForStrongLayout, HasUnion);
}
-void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCInterfaceDecl *OI,
+void CGObjCCommonMac::BuildAggrIvarLayout(const ObjCImplementationDecl *OI,
const llvm::StructLayout *Layout,
const RecordDecl *RD,
const llvm::SmallVectorImpl<FieldDecl*> &RecFields,
SkipIvars.clear();
IvarsInfo.clear();
- BuildAggrIvarLayout(OI, 0, 0, RecFields, 0, ForStrongLayout, hasUnion);
+ BuildAggrIvarLayout(OMD, 0, 0, RecFields, 0, ForStrongLayout, hasUnion);
if (IvarsInfo.empty())
return llvm::Constant::getNullValue(PtrTy);
--- /dev/null
+// RUNX: llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o %t %s &&
+// RUN: clang-cc -triple x86_64-apple-darwin9 -fobjc-gc -emit-llvm -o %t %s &&
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"A\\00"' %t &&
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"\\11q\\10\\00"' %t &&
+// RUN: grep '@"\\01L_OBJC_CLASS_NAME_.*" = internal global .* c"!q\\00"' %t &&
+// RUN: true
+
+/*
+
+Here is a handy command for looking at llvm-gcc's output:
+llvm-gcc -m64 -fobjc-gc -emit-llvm -S -o - ivar-layout-64.m | \
+ grep 'OBJC_CLASS_NAME.* =.*global' | \
+ sed -e 's#, section.*# ...#' | \
+ sort
+
+*/
+
+@interface B @end
+
+@interface A {
+ struct s0 {
+ int f0;
+ int f1;
+ } f0;
+ id f1;
+__weak B *f2;
+ int f3 : 5;
+ struct s1 {
+ int *f0;
+ int *f1;
+ } f4[2][1];
+}
+@end
+
+@interface A()
+@property int p0;
+@property (assign) __strong id p1;
+@property (assign) __weak id p2;
+@end
+
+@implementation A
+@synthesize p0;
+@synthesize p1;
+@synthesize p2;
+@end