diff options
Diffstat (limited to 'lib/CodeGen/CGExpr.cpp')
| -rw-r--r-- | lib/CodeGen/CGExpr.cpp | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/lib/CodeGen/CGExpr.cpp b/lib/CodeGen/CGExpr.cpp index 35ba2543ef..5697c5f1a4 100644 --- a/lib/CodeGen/CGExpr.cpp +++ b/lib/CodeGen/CGExpr.cpp @@ -1574,23 +1574,13 @@ LValue CodeGenFunction::EmitLValueForBitfield(llvm::Value *BaseValue, /// that the base value is a pointer to the enclosing record, derive /// an lvalue for the ultimate field. LValue CodeGenFunction::EmitLValueForAnonRecordField(llvm::Value *BaseValue, - const FieldDecl *Field, + const IndirectFieldDecl *Field, unsigned CVRQualifiers) { - llvm::SmallVector<const FieldDecl *, 8> Path; - Path.push_back(Field); - - while (Field->getParent()->isAnonymousStructOrUnion()) { - const ValueDecl *VD = Field->getParent()->getAnonymousStructOrUnionObject(); - if (!isa<FieldDecl>(VD)) break; - Field = cast<FieldDecl>(VD); - Path.push_back(Field); - } - - llvm::SmallVectorImpl<const FieldDecl*>::reverse_iterator - I = Path.rbegin(), E = Path.rend(); + IndirectFieldDecl::chain_iterator I = Field->chain_begin(), + IEnd = Field->chain_end(); while (true) { - LValue LV = EmitLValueForField(BaseValue, *I, CVRQualifiers); - if (++I == E) return LV; + LValue LV = EmitLValueForField(BaseValue, cast<FieldDecl>(*I), CVRQualifiers); + if (++I == IEnd) return LV; assert(LV.isSimple()); BaseValue = LV.getAddress(); |
