diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-10 23:56:17 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2009-08-10 23:56:17 +0000 |
commit | 8c64e007d9b2f719613f7d79b0b32d2f50da9332 (patch) | |
tree | bb32ec503e7f8588d28995a49923403336e8517b /lib/CodeGen/CGCXX.cpp | |
parent | 2ef13e5abef0570a9f567b4671367275c05d4d34 (diff) |
Support for anonymous union in ctor's initializer and
bunch of FIXMEs for their is-gen.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@78623 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXX.cpp')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 417dcf748c..18c06cffb6 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -855,7 +855,8 @@ void CodeGenFunction::SynthesizeCXXCopyConstructor(const CXXConstructorDecl *CD, // FIXME. How about copying arrays! assert(!getContext().getAsArrayType(FieldType) && "FIXME. Copying arrays NYI"); - + assert(!Field->isAnonymousStructOrUnion() && + "FIXME. anonymous data member NYI in copy constructor synthesis"); if (const RecordType *FieldClassType = FieldType->getAs<RecordType>()) { CXXRecordDecl *FieldClassDecl = cast<CXXRecordDecl>(FieldClassType->getDecl()); @@ -904,7 +905,12 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD) { QualType FieldType = getContext().getCanonicalType((Field)->getType()); assert(!getContext().getAsArrayType(FieldType) && "FIXME. Field arrays initialization unsupported"); - + DeclContext *Ctx = Field->getDeclContext(); + RecordDecl *Record = cast<RecordDecl>(Ctx); + assert(!Record->isAnonymousStructOrUnion() && + "FIXME. anonymous union initializer NYI in default constructor"); + (void)Record; + LoadOfThis = LoadCXXThis(); LValue LHS = EmitLValueForField(LoadOfThis, Field, false, 0); if (FieldType->getAs<RecordType>()) { @@ -921,10 +927,7 @@ void CodeGenFunction::EmitCtorPrologue(const CXXConstructorDecl *CD) { assert(Member->getNumArgs() == 1 && "Initializer count must be 1 only"); Expr *RhsExpr = *Member->arg_begin(); llvm::Value *RHS = EmitScalarExpr(RhsExpr, true); - if (LHS.isBitfield()) - EmitStoreThroughBitfieldLValue(RValue::get(RHS), LHS, FieldType, 0); - else - EmitStoreThroughLValue(RValue::get(RHS), LHS, FieldType); + EmitStoreThroughLValue(RValue::get(RHS), LHS, FieldType); } } |