diff options
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/CGCXX.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/CGCall.cpp | 16 | ||||
-rw-r--r-- | lib/CodeGen/CGClass.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/CGDebugInfo.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/CGExprCXX.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGExprConstant.cpp | 26 | ||||
-rw-r--r-- | lib/CodeGen/CGExprScalar.cpp | 4 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCGNU.cpp | 6 | ||||
-rw-r--r-- | lib/CodeGen/CGObjCMac.cpp | 13 | ||||
-rw-r--r-- | lib/CodeGen/CGRecordLayoutBuilder.cpp | 10 | ||||
-rw-r--r-- | lib/CodeGen/CodeGenModule.cpp | 2 | ||||
-rw-r--r-- | lib/CodeGen/TargetInfo.cpp | 18 |
13 files changed, 61 insertions, 58 deletions
diff --git a/lib/CodeGen/CGCXX.cpp b/lib/CodeGen/CGCXX.cpp index 7c08650d27..18e2a1613b 100644 --- a/lib/CodeGen/CGCXX.cpp +++ b/lib/CodeGen/CGCXX.cpp @@ -53,7 +53,7 @@ bool CodeGenModule::TryEmitBaseDestructorAsAlias(const CXXDestructorDecl *D) { // destructor separately. for (CXXRecordDecl::field_iterator I = Class->field_begin(), E = Class->field_end(); I != E; ++I) - if ((*I)->getType().isDestructedType()) + if (I->getType().isDestructedType()) return true; // Try to find a unique base class with a non-trivial destructor. diff --git a/lib/CodeGen/CGCall.cpp b/lib/CodeGen/CGCall.cpp index 82ee4fc1ee..3ad1df1782 100644 --- a/lib/CodeGen/CGCall.cpp +++ b/lib/CodeGen/CGCall.cpp @@ -431,7 +431,7 @@ void CodeGenTypes::GetExpandedTypes(QualType type, for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); CharUnits FieldSize = getContext().getTypeSizeInChars(FD->getType()); @@ -445,10 +445,10 @@ void CodeGenTypes::GetExpandedTypes(QualType type, } else { for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; - assert(!FD->isBitField() && + const FieldDecl &FD = *i; + assert(!FD.isBitField() && "Cannot expand structure with bit-field members."); - GetExpandedTypes(FD->getType(), expandedTypes); + GetExpandedTypes(FD.getType(), expandedTypes); } } } else if (const ComplexType *CT = type->getAs<ComplexType>()) { @@ -483,7 +483,7 @@ CodeGenFunction::ExpandTypeFromArgs(QualType Ty, LValue LV, for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); CharUnits FieldSize = getContext().getTypeSizeInChars(FD->getType()); @@ -500,7 +500,7 @@ CodeGenFunction::ExpandTypeFromArgs(QualType Ty, LValue LV, } else { for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - FieldDecl *FD = *i; + FieldDecl *FD = &*i; QualType FT = FD->getType(); // FIXME: What are the right qualifiers here? @@ -1815,7 +1815,7 @@ void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; assert(!FD->isBitField() && "Cannot expand structure with bit-field members."); CharUnits FieldSize = getContext().getTypeSizeInChars(FD->getType()); @@ -1831,7 +1831,7 @@ void CodeGenFunction::ExpandTypeToArgs(QualType Ty, RValue RV, } else { for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - FieldDecl *FD = *i; + FieldDecl *FD = &*i; RValue FldRV = EmitRValueForField(LV, FD); ExpandTypeToArgs(FD->getType(), FldRV, Args, IRFuncTy); diff --git a/lib/CodeGen/CGClass.cpp b/lib/CodeGen/CGClass.cpp index 7062b9c621..174a44258b 100644 --- a/lib/CodeGen/CGClass.cpp +++ b/lib/CodeGen/CGClass.cpp @@ -808,7 +808,7 @@ HasTrivialDestructorBody(ASTContext &Context, // Check fields. for (CXXRecordDecl::field_iterator I = BaseClassDecl->field_begin(), E = BaseClassDecl->field_end(); I != E; ++I) { - const FieldDecl *Field = *I; + const FieldDecl *Field = &*I; if (!FieldHasTrivialDestructorBody(Context, Field)) return false; @@ -869,7 +869,7 @@ static bool CanSkipVTablePointerInitialization(ASTContext &Context, const CXXRecordDecl *ClassDecl = Dtor->getParent(); for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(), E = ClassDecl->field_end(); I != E; ++I) { - const FieldDecl *Field = *I; + const FieldDecl *Field = &*I; if (!FieldHasTrivialDestructorBody(Context, Field)) return false; @@ -1066,7 +1066,7 @@ void CodeGenFunction::EnterDtorCleanups(const CXXDestructorDecl *DD, SmallVector<const FieldDecl *, 16> FieldDecls; for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(), E = ClassDecl->field_end(); I != E; ++I) { - const FieldDecl *field = *I; + const FieldDecl *field = &*I; QualType type = field->getType(); QualType::DestructionKind dtorKind = type.isDestructedType(); if (!dtorKind) continue; diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 81cc15ebc6..af6e340b9d 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -797,7 +797,7 @@ CollectRecordFields(const RecordDecl *record, llvm::DIFile tunit, for (RecordDecl::field_iterator I = record->field_begin(), E = record->field_end(); I != E; ++I, ++fieldNo) { - FieldDecl *field = *I; + FieldDecl *field = &*I; if (IsMsStruct) { // Zero-length bitfields following non-bitfield members are ignored @@ -1332,7 +1332,7 @@ llvm::DIType CGDebugInfo::CreateType(const ObjCInterfaceType *Ty, for (ObjCContainerDecl::prop_iterator I = ID->prop_begin(), E = ID->prop_end(); I != E; ++I) { - const ObjCPropertyDecl *PD = *I; + const ObjCPropertyDecl *PD = &*I; SourceLocation Loc = PD->getLocation(); llvm::DIFile PUnit = getOrCreateFile(Loc); unsigned PLine = getLineNumber(Loc); @@ -2293,7 +2293,7 @@ void CGDebugInfo::EmitDeclare(const VarDecl *VD, unsigned Tag, for (RecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end(); I != E; ++I) { - FieldDecl *Field = *I; + FieldDecl *Field = &*I; llvm::DIType FieldTy = getOrCreateType(Field->getType(), Unit); StringRef FieldName = Field->getName(); diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 7b0e0f5157..d53cbc430f 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -352,7 +352,7 @@ void AggExprEmitter::EmitStdInitializerList(llvm::Value *destPtr, return; } LValue DestLV = CGF.MakeNaturalAlignAddrLValue(destPtr, initList->getType()); - LValue start = CGF.EmitLValueForFieldInitialization(DestLV, *field); + LValue start = CGF.EmitLValueForFieldInitialization(DestLV, &*field); llvm::Value *arrayStart = Builder.CreateStructGEP(alloc, 0, "arraystart"); CGF.EmitStoreThroughLValue(RValue::get(arrayStart), start); ++field; @@ -361,7 +361,7 @@ void AggExprEmitter::EmitStdInitializerList(llvm::Value *destPtr, CGF.ErrorUnsupported(initList, "weird std::initializer_list"); return; } - LValue endOrLength = CGF.EmitLValueForFieldInitialization(DestLV, *field); + LValue endOrLength = CGF.EmitLValueForFieldInitialization(DestLV, &*field); if (ctx.hasSameType(field->getType(), elementPtr)) { // End pointer. llvm::Value *arrayEnd = Builder.CreateStructGEP(alloc,numInits, "arrayend"); @@ -1005,7 +1005,7 @@ void AggExprEmitter::VisitInitListExpr(InitListExpr *E) { break; - LValue LV = CGF.EmitLValueForFieldInitialization(DestLV, *field); + LValue LV = CGF.EmitLValueForFieldInitialization(DestLV, &*field); // We never generate write-barries for initialized fields. LV.setNonGC(true); diff --git a/lib/CodeGen/CGExprCXX.cpp b/lib/CodeGen/CGExprCXX.cpp index f20617973a..dc318bedf9 100644 --- a/lib/CodeGen/CGExprCXX.cpp +++ b/lib/CodeGen/CGExprCXX.cpp @@ -1824,10 +1824,10 @@ void CodeGenFunction::EmitLambdaExpr(const LambdaExpr *E, AggValueSlot Slot) { i != e; ++i, ++CurField) { // Emit initialization - LValue LV = EmitLValueForFieldInitialization(SlotLV, *CurField); + LValue LV = EmitLValueForFieldInitialization(SlotLV, &*CurField); ArrayRef<VarDecl *> ArrayIndexes; if (CurField->getType()->isArrayType()) ArrayIndexes = E->getCaptureInitIndexVars(i); - EmitInitializerForField(*CurField, LV, *i, ArrayIndexes); + EmitInitializerForField(&*CurField, LV, *i, ArrayIndexes); } } diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp index bc9f9ef07b..4e308aefe4 100644 --- a/lib/CodeGen/CGExprConstant.cpp +++ b/lib/CodeGen/CGExprConstant.cpp @@ -386,20 +386,20 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) { if (IsMsStruct) { // Zero-length bitfields following non-bitfield members are // ignored: - if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((*Field), LastFD)) { + if (CGM.getContext().ZeroBitfieldFollowsNonBitfield(&*Field, LastFD)) { --FieldNo; continue; } - LastFD = (*Field); + LastFD = &*Field; } // If this is a union, skip all the fields that aren't being initialized. - if (RD->isUnion() && ILE->getInitializedFieldInUnion() != *Field) + if (RD->isUnion() && ILE->getInitializedFieldInUnion() != &*Field) continue; // Don't emit anonymous bitfields, they just affect layout. if (Field->isUnnamedBitfield()) { - LastFD = (*Field); + LastFD = &*Field; continue; } @@ -417,10 +417,10 @@ bool ConstStructBuilder::Build(InitListExpr *ILE) { if (!Field->isBitField()) { // Handle non-bitfield members. - AppendField(*Field, Layout.getFieldOffset(FieldNo), EltInit); + AppendField(&*Field, Layout.getFieldOffset(FieldNo), EltInit); } else { // Otherwise we have a bitfield. - AppendBitField(*Field, Layout.getFieldOffset(FieldNo), + AppendBitField(&*Field, Layout.getFieldOffset(FieldNo), cast<llvm::ConstantInt>(EltInit)); } } @@ -486,20 +486,20 @@ void ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD, if (IsMsStruct) { // Zero-length bitfields following non-bitfield members are // ignored: - if (CGM.getContext().ZeroBitfieldFollowsNonBitfield((*Field), LastFD)) { + if (CGM.getContext().ZeroBitfieldFollowsNonBitfield(&*Field, LastFD)) { --FieldNo; continue; } - LastFD = (*Field); + LastFD = &*Field; } // If this is a union, skip all the fields that aren't being initialized. - if (RD->isUnion() && Val.getUnionField() != *Field) + if (RD->isUnion() && Val.getUnionField() != &*Field) continue; // Don't emit anonymous bitfields, they just affect layout. if (Field->isUnnamedBitfield()) { - LastFD = (*Field); + LastFD = &*Field; continue; } @@ -512,10 +512,10 @@ void ConstStructBuilder::Build(const APValue &Val, const RecordDecl *RD, if (!Field->isBitField()) { // Handle non-bitfield members. - AppendField(*Field, Layout.getFieldOffset(FieldNo) + OffsetBits, EltInit); + AppendField(&*Field, Layout.getFieldOffset(FieldNo) + OffsetBits, EltInit); } else { // Otherwise we have a bitfield. - AppendBitField(*Field, Layout.getFieldOffset(FieldNo) + OffsetBits, + AppendBitField(&*Field, Layout.getFieldOffset(FieldNo) + OffsetBits, cast<llvm::ConstantInt>(EltInit)); } } @@ -1374,7 +1374,7 @@ static llvm::Constant *EmitNullConstant(CodeGenModule &CGM, // Fill in all the fields. for (RecordDecl::field_iterator I = record->field_begin(), E = record->field_end(); I != E; ++I) { - const FieldDecl *field = *I; + const FieldDecl *field = &*I; // Fill in non-bitfields. (Bitfields always use a zero pattern, which we // will fill in later.) diff --git a/lib/CodeGen/CGExprScalar.cpp b/lib/CodeGen/CGExprScalar.cpp index db4349b8e1..bce910ce18 100644 --- a/lib/CodeGen/CGExprScalar.cpp +++ b/lib/CodeGen/CGExprScalar.cpp @@ -1521,8 +1521,8 @@ Value *ScalarExprEmitter::VisitOffsetOfExpr(OffsetOfExpr *E) { // FIXME: It would be nice if we didn't have to loop here! for (RecordDecl::field_iterator Field = RD->field_begin(), FieldEnd = RD->field_end(); - Field != FieldEnd; (void)++Field, ++i) { - if (*Field == MemberDecl) + Field != FieldEnd; ++Field, ++i) { + if (&*Field == MemberDecl) break; } assert(i < RL.getFieldCount() && "offsetof field in wrong type"); diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index db0bd951c1..e783eb7794 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -1627,7 +1627,7 @@ void CGObjCGNU::GenerateProtocol(const ObjCProtocolDecl *PD) { iter = PD->prop_begin(), endIter = PD->prop_end(); iter != endIter ; iter++) { std::vector<llvm::Constant*> Fields; - ObjCPropertyDecl *property = (*iter); + ObjCPropertyDecl *property = &*iter; Fields.push_back(MakeConstantString(property->getNameAsString())); Fields.push_back(llvm::ConstantInt::get(Int8Ty, @@ -1877,8 +1877,8 @@ llvm::Constant *CGObjCGNU::GeneratePropertyList(const ObjCImplementationDecl *OI iter = OID->propimpl_begin(), endIter = OID->propimpl_end(); iter != endIter ; iter++) { std::vector<llvm::Constant*> Fields; - ObjCPropertyDecl *property = (*iter)->getPropertyDecl(); - ObjCPropertyImplDecl *propertyImpl = *iter; + ObjCPropertyDecl *property = iter->getPropertyDecl(); + ObjCPropertyImplDecl *propertyImpl = &*iter; bool isSynthesized = (propertyImpl->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize); diff --git a/lib/CodeGen/CGObjCMac.cpp b/lib/CodeGen/CGObjCMac.cpp index 7796f92aff..42c91cb8e2 100644 --- a/lib/CodeGen/CGObjCMac.cpp +++ b/lib/CodeGen/CGObjCMac.cpp @@ -2121,7 +2121,7 @@ PushProtocolProperties(llvm::SmallPtrSet<const IdentifierInfo*,16> &PropertySet, PushProtocolProperties(PropertySet, Properties, Container, (*P), ObjCTypes); for (ObjCContainerDecl::prop_iterator I = PROTO->prop_begin(), E = PROTO->prop_end(); I != E; ++I) { - const ObjCPropertyDecl *PD = *I; + const ObjCPropertyDecl *PD = &*I; if (!PropertySet.insert(PD->getIdentifier())) continue; llvm::Constant *Prop[] = { @@ -2152,7 +2152,7 @@ llvm::Constant *CGObjCCommonMac::EmitPropertyList(Twine Name, llvm::SmallPtrSet<const IdentifierInfo*, 16> PropertySet; for (ObjCContainerDecl::prop_iterator I = OCD->prop_begin(), E = OCD->prop_end(); I != E; ++I) { - const ObjCPropertyDecl *PD = *I; + const ObjCPropertyDecl *PD = &*I; PropertySet.insert(PD->getIdentifier()); llvm::Constant *Prop[] = { GetPropertyName(PD->getIdentifier()), @@ -2403,7 +2403,7 @@ void CGObjCMac::GenerateClass(const ObjCImplementationDecl *ID) { for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(), e = ID->propimpl_end(); i != e; ++i) { - ObjCPropertyImplDecl *PID = *i; + ObjCPropertyImplDecl *PID = &*i; if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize) { ObjCPropertyDecl *PD = PID->getPropertyDecl(); @@ -3818,7 +3818,10 @@ void CGObjCCommonMac::BuildAggrIvarRecordLayout(const RecordType *RT, bool &HasUnion) { const RecordDecl *RD = RT->getDecl(); // FIXME - Use iterator. - SmallVector<const FieldDecl*, 16> Fields(RD->field_begin(), RD->field_end()); + SmallVector<const FieldDecl*, 16> Fields; + for (RecordDecl::field_iterator i = RD->field_begin(), + e = RD->field_end(); i != e; ++i) + Fields.push_back(&*i); llvm::Type *Ty = CGM.getTypes().ConvertType(QualType(RT, 0)); const llvm::StructLayout *RecLayout = CGM.getTargetData().getStructLayout(cast<llvm::StructType>(Ty)); @@ -5001,7 +5004,7 @@ llvm::GlobalVariable * CGObjCNonFragileABIMac::BuildClassRoTInitializer( } for (ObjCImplementationDecl::propimpl_iterator i = ID->propimpl_begin(), e = ID->propimpl_end(); i != e; ++i) { - ObjCPropertyImplDecl *PID = *i; + ObjCPropertyImplDecl *PID = &*i; if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize){ ObjCPropertyDecl *PD = PID->getPropertyDecl(); diff --git a/lib/CodeGen/CGRecordLayoutBuilder.cpp b/lib/CodeGen/CGRecordLayoutBuilder.cpp index 7f69d6dc8a..12e26e16b7 100644 --- a/lib/CodeGen/CGRecordLayoutBuilder.cpp +++ b/lib/CodeGen/CGRecordLayoutBuilder.cpp @@ -538,7 +538,7 @@ void CGRecordLayoutBuilder::LayoutUnion(const RecordDecl *D) { fieldEnd = D->field_end(); field != fieldEnd; ++field, ++fieldNo) { assert(layout.getFieldOffset(fieldNo) == 0 && "Union field offset did not start at the beginning of record!"); - llvm::Type *fieldType = LayoutUnionField(*field, layout); + llvm::Type *fieldType = LayoutUnionField(&*field, layout); if (!fieldType) continue; @@ -820,7 +820,7 @@ bool CGRecordLayoutBuilder::LayoutFields(const RecordDecl *D) { if (IsMsStruct) { // Zero-length bitfields following non-bitfield members are // ignored: - const FieldDecl *FD = (*Field); + const FieldDecl *FD = &*Field; if (Types.getContext().ZeroBitfieldFollowsNonBitfield(FD, LastFD)) { --FieldNo; continue; @@ -828,7 +828,7 @@ bool CGRecordLayoutBuilder::LayoutFields(const RecordDecl *D) { LastFD = FD; } - if (!LayoutField(*Field, Layout.getFieldOffset(FieldNo))) { + if (!LayoutField(&*Field, Layout.getFieldOffset(FieldNo))) { assert(!Packed && "Could not layout fields even with a packed LLVM struct!"); return false; @@ -1063,7 +1063,7 @@ CGRecordLayout *CodeGenTypes::ComputeRecordLayout(const RecordDecl *D, const FieldDecl *LastFD = 0; bool IsMsStruct = D->hasAttr<MsStructAttr>(); for (unsigned i = 0, e = AST_RL.getFieldCount(); i != e; ++i, ++it) { - const FieldDecl *FD = *it; + const FieldDecl *FD = &*it; // For non-bit-fields, just check that the LLVM struct offset matches the // AST offset. @@ -1124,7 +1124,7 @@ void CGRecordLayout::print(raw_ostream &OS) const { const RecordDecl *RD = it->first->getParent(); unsigned Index = 0; for (RecordDecl::field_iterator - it2 = RD->field_begin(); *it2 != it->first; ++it2) + it2 = RD->field_begin(); &*it2 != it->first; ++it2) ++Index; BFIs.push_back(std::make_pair(Index, &it->second)); } diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp index 85f404d510..660cc8bae9 100644 --- a/lib/CodeGen/CodeGenModule.cpp +++ b/lib/CodeGen/CodeGenModule.cpp @@ -2344,7 +2344,7 @@ void CodeGenModule::EmitObjCPropertyImplementations(const ObjCImplementationDecl *D) { for (ObjCImplementationDecl::propimpl_iterator i = D->propimpl_begin(), e = D->propimpl_end(); i != e; ++i) { - ObjCPropertyImplDecl *PID = *i; + ObjCPropertyImplDecl *PID = &*i; // Dynamic is just for type-checking. if (PID->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize) { diff --git a/lib/CodeGen/TargetInfo.cpp b/lib/CodeGen/TargetInfo.cpp index 2b71fdd504..e5006772f1 100644 --- a/lib/CodeGen/TargetInfo.cpp +++ b/lib/CodeGen/TargetInfo.cpp @@ -161,7 +161,7 @@ static bool isEmptyRecord(ASTContext &Context, QualType T, bool AllowArrays) { for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) - if (!isEmptyField(Context, *i, AllowArrays)) + if (!isEmptyField(Context, &*i, AllowArrays)) return false; return true; } @@ -229,7 +229,7 @@ static const Type *isSingleElementStruct(QualType T, ASTContext &Context) { // Check for single element. for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; QualType FT = FD->getType(); // Ignore empty fields. @@ -301,7 +301,7 @@ static bool canExpandIndirectArgument(QualType Ty, ASTContext &Context) { for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; if (!is32Or64BitBasicType(FD->getType(), Context)) return false; @@ -534,7 +534,7 @@ bool X86_32ABIInfo::shouldReturnTypeInRegister(QualType Ty, // passed in a register. for (RecordDecl::field_iterator i = RT->getDecl()->field_begin(), e = RT->getDecl()->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; // Empty fields are ignored. if (isEmptyField(Context, FD, true)) @@ -2540,7 +2540,7 @@ static bool isHomogeneousAggregate(QualType Ty, const Type *&Base, Members = 0; for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; uint64_t FldMembers; if (!isHomogeneousAggregate(FD->getType(), Base, Context, &FldMembers)) return false; @@ -2683,7 +2683,7 @@ static bool isIntegerLikeType(QualType Ty, ASTContext &Context, unsigned idx = 0; for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i, ++idx) { - const FieldDecl *FD = *i; + const FieldDecl *FD = &*i; // Bit-fields are not addressable, we only need to verify they are "integer // like". We still have to disallow a subsequent non-bitfield, for example: @@ -3161,7 +3161,7 @@ llvm::Type* MipsABIInfo::HandleAggregates(QualType Ty) const { // double fields. for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); i != e; ++i, ++idx) { - const QualType Ty = (*i)->getType(); + const QualType Ty = i->getType(); const BuiltinType *BT = Ty->getAs<BuiltinType>(); if (!BT || BT->getKind() != BuiltinType::Double) @@ -3272,12 +3272,12 @@ MipsABIInfo::returnAggregateInRegs(QualType RetTy, uint64_t Size) const { if (FieldCnt && (FieldCnt <= 2) && !Layout.getFieldOffset(0)) { RecordDecl::field_iterator b = RD->field_begin(), e = RD->field_end(); for (; b != e; ++b) { - const BuiltinType *BT = (*b)->getType()->getAs<BuiltinType>(); + const BuiltinType *BT = b->getType()->getAs<BuiltinType>(); if (!BT || !BT->isFloatingPoint()) break; - RTList.push_back(CGT.ConvertType((*b)->getType())); + RTList.push_back(CGT.ConvertType(b->getType())); } if (b == e) |