diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-06-14 21:41:37 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-06-14 21:41:37 +0000 |
commit | 4c4c527dc1877999dd2bdae74ae9ffbddedaf819 (patch) | |
tree | 95907dd27922b2e38f642f24851fd97355177de2 /lib/CodeGen/CGExprConstant.cpp | |
parent | 4e36ccafee0622aa0ae0b7c62a45440449f54829 (diff) |
PR4390: Make sure to handle anonymous unions correctly while building
static intializers for structs.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73349 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index 0e21a00f30..0b109f9bee 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -198,16 +198,13 @@ public: // Copy initializer elements. Skip padding fields. unsigned EltNo = 0; // Element no in ILE - int FieldNo = 0; // Field no in RecordDecl bool RewriteType = false; for (RecordDecl::field_iterator Field = RD->field_begin(CGM.getContext()), FieldEnd = RD->field_end(CGM.getContext()); EltNo < ILE->getNumInits() && Field != FieldEnd; ++Field) { - FieldNo++; - if (!Field->getIdentifier()) - continue; - if (Field->isBitField()) { + if (!Field->getIdentifier()) + continue; InsertBitfieldIntoStruct(Elts, *Field, ILE->getInit(EltNo)); } else { unsigned FieldNo = CGM.getTypes().getLLVMFieldNo(*Field); |