aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGExprAgg.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-04-09 21:40:53 +0000
committerDouglas Gregor <dgregor@apple.com>2009-04-09 21:40:53 +0000
commit6ab3524f72a6e64aa04973fa9433b5559abb3525 (patch)
tree2af99c2d010cb635e630a31dc34512563db09f5c /lib/CodeGen/CGExprAgg.cpp
parentd296836d0d5570fe634cfe65580dc57fdd2bc8f1 (diff)
Propagate the ASTContext to various AST traversal and lookup functions.
No functionality change (really). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68726 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
-rw-r--r--lib/CodeGen/CGExprAgg.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp
index 095e2240cf..3b1580cc13 100644
--- a/lib/CodeGen/CGExprAgg.cpp
+++ b/lib/CodeGen/CGExprAgg.cpp
@@ -133,7 +133,9 @@ void AggExprEmitter::VisitCStyleCastExpr(CStyleCastExpr *E) {
// GCC union extension
if (E->getType()->isUnionType()) {
RecordDecl *SD = E->getType()->getAsRecordType()->getDecl();
- LValue FieldLoc = CGF.EmitLValueForField(DestPtr, *SD->field_begin(), true, 0);
+ LValue FieldLoc = CGF.EmitLValueForField(DestPtr,
+ *SD->field_begin(CGF.getContext()),
+ true, 0);
EmitInitializationToLValue(E->getSubExpr(), FieldLoc);
return;
}
@@ -398,8 +400,8 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
#ifndef NDEBUG
// Make sure that it's really an empty and not a failure of
// semantic analysis.
- for (RecordDecl::field_iterator Field = SD->field_begin(),
- FieldEnd = SD->field_end();
+ for (RecordDecl::field_iterator Field = SD->field_begin(CGF.getContext()),
+ FieldEnd = SD->field_end(CGF.getContext());
Field != FieldEnd; ++Field)
assert(Field->isUnnamedBitfield() && "Only unnamed bitfields allowed");
#endif
@@ -423,8 +425,8 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) {
// Here we iterate over the fields; this makes it simpler to both
// default-initialize fields and skip over unnamed fields.
- for (RecordDecl::field_iterator Field = SD->field_begin(),
- FieldEnd = SD->field_end();
+ for (RecordDecl::field_iterator Field = SD->field_begin(CGF.getContext()),
+ FieldEnd = SD->field_end(CGF.getContext());
Field != FieldEnd; ++Field) {
// We're done once we hit the flexible array member
if (Field->getType()->isIncompleteArrayType())