diff options
author | Francois Pichet <pichet2000@gmail.com> | 2010-12-04 09:14:42 +0000 |
---|---|---|
committer | Francois Pichet <pichet2000@gmail.com> | 2010-12-04 09:14:42 +0000 |
commit | 00eb3f9c5b33e3d99aee1f8b75dd9c9678fdd66b (patch) | |
tree | 7f3cca41dfa3b7d18548218fb444172b38b70ec2 /lib/CodeGen/CGObjC.cpp | |
parent | 74e40b70306b39d65fed16d474017df036ff3960 (diff) |
More anonymous struct/union redesign. This one deals with anonymous field used in a constructor initializer list:
struct X {
X() : au_i1(123) {}
union {
int au_i1;
float au_f1;
};
};
clang will now deal with au_i1 explicitly as an IndirectFieldDecl.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@120900 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index a8acb2b72f..b7a6224000 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -432,7 +432,7 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, if (ctor) { for (unsigned I = 0, E = IvarInitializers.size(); I != E; ++I) { CXXBaseOrMemberInitializer *IvarInit = IvarInitializers[I]; - FieldDecl *Field = IvarInit->getMember(); + FieldDecl *Field = IvarInit->getAnyMember(); QualType FieldType = Field->getType(); ObjCIvarDecl *Ivar = cast<ObjCIvarDecl>(Field); LValue LV = EmitLValueForIvar(TypeOfSelfObject(), @@ -448,7 +448,7 @@ void CodeGenFunction::GenerateObjCCtorDtorMethod(ObjCImplementationDecl *IMP, } else { // dtor for (size_t i = IvarInitializers.size(); i > 0; --i) { - FieldDecl *Field = IvarInitializers[i - 1]->getMember(); + FieldDecl *Field = IvarInitializers[i - 1]->getAnyMember(); QualType FieldType = Field->getType(); const ConstantArrayType *Array = getContext().getAsConstantArrayType(FieldType); |