}
public:
- typedef SpecificDecl* value_type;
- typedef SpecificDecl* reference;
+ typedef SpecificDecl value_type;
+ typedef SpecificDecl& reference;
typedef SpecificDecl* pointer;
typedef std::iterator_traits<DeclContext::decl_iterator>::difference_type
difference_type;
SkipToNextDecl();
}
- reference operator*() const { return cast<SpecificDecl>(*Current); }
- pointer operator->() const { return cast<SpecificDecl>(*Current); }
+ reference operator*() const { return *cast<SpecificDecl>(*Current); }
+ pointer operator->() const { return &**this; }
specific_decl_iterator& operator++() {
++Current;
ObjCMethodDecl *DeallocM = 0;
ObjCMethodDecl *FinalizeM = 0;
for (ObjCImplementationDecl::instmeth_iterator
- MI = (*I)->instmeth_begin(),
- ME = (*I)->instmeth_end(); MI != ME; ++MI) {
+ MI = I->instmeth_begin(),
+ ME = I->instmeth_end(); MI != ME; ++MI) {
ObjCMethodDecl *MD = *MI;
if (!MD->hasBody())
continue;
if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(D)) {
for (CXXRecordDecl::method_iterator
MI = RD->method_begin(), ME = RD->method_end(); MI != ME; ++MI) {
- if ((*MI)->isOutOfLine())
+ if (MI->isOutOfLine())
return true;
}
return false;
if (PrevAtProps->find(RawLoc) != PrevAtProps->end())
continue;
PropsTy &props = AtProps[RawLoc];
- props.push_back(*propI);
+ props.push_back(&*propI);
}
}
for (prop_impl_iterator
I = prop_impl_iterator(D->decls_begin()),
E = prop_impl_iterator(D->decls_end()); I != E; ++I) {
- ObjCPropertyImplDecl *implD = *I;
+ ObjCPropertyImplDecl *implD = &*I;
if (implD->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
continue;
ObjCPropertyDecl *propD = implD->getPropertyDecl();
// this class implementation.
for (ObjCImplDecl::propimpl_iterator
I = IMD->propimpl_begin(), EI = IMD->propimpl_end(); I != EI; ++I) {
- ObjCPropertyImplDecl *PID = *I;
+ ObjCPropertyImplDecl *PID = &*I;
if (PID->getPropertyImplementation() ==
ObjCPropertyImplDecl::Synthesize) {
ObjCPropertyDecl *PD = PID->getPropertyDecl();
for (impl_iterator I = impl_iterator(DC->decls_begin()),
E = impl_iterator(DC->decls_end()); I != E; ++I) {
for (ObjCImplementationDecl::instmeth_iterator
- MI = (*I)->instmeth_begin(),
- ME = (*I)->instmeth_end(); MI != ME; ++MI) {
+ MI = I->instmeth_begin(),
+ ME = I->instmeth_end(); MI != ME; ++MI) {
ObjCMethodDecl *MD = *MI;
if (!MD->hasBody())
continue;
FI != RD->field_end(); ++FI) {
if (!First)
Out << ", ";
- if ((*FI)->isUnnamedBitfield()) continue;
- getStructField((*FI)->getFieldIndex()).
- printPretty(Out, Ctx, (*FI)->getType());
+ if (FI->isUnnamedBitfield()) continue;
+ getStructField(FI->getFieldIndex()).
+ printPretty(Out, Ctx, FI->getType());
First = false;
}
Out << '}';
if (!leafClass) {
for (ObjCInterfaceDecl::ivar_iterator I = OI->ivar_begin(),
E = OI->ivar_end(); I != E; ++I)
- Ivars.push_back(*I);
+ Ivars.push_back(&*I);
} else {
ObjCInterfaceDecl *IDecl = const_cast<ObjCInterfaceDecl *>(OI);
for (const ObjCIvarDecl *Iv = IDecl->all_declared_ivar_begin(); Iv;
for (ObjCCategoryImplDecl::propimpl_iterator
i = CID->propimpl_begin(), e = CID->propimpl_end();
i != e; ++i) {
- ObjCPropertyImplDecl *PID = *i;
+ ObjCPropertyImplDecl *PID = &*i;
if (PID->getPropertyDecl() == PD) {
if (PID->getPropertyImplementation()==ObjCPropertyImplDecl::Dynamic) {
Dynamic = true;
for (ObjCCategoryImplDecl::propimpl_iterator
i = OID->propimpl_begin(), e = OID->propimpl_end();
i != e; ++i) {
- ObjCPropertyImplDecl *PID = *i;
+ ObjCPropertyImplDecl *PID = &*i;
if (PID->getPropertyDecl() == PD) {
if (PID->getPropertyImplementation()==ObjCPropertyImplDecl::Dynamic) {
Dynamic = true;
// Special case bit-fields.
if (Field->isBitField()) {
getObjCEncodingForTypeImpl(Field->getType(), S, false, true,
- (*Field));
+ &*Field);
} else {
QualType qt = Field->getType();
getLegacyIntegralTypeEncoding(qt);
Field != FieldEnd; ++Field, ++i) {
uint64_t offs = layout.getFieldOffset(i);
FieldOrBaseOffsets.insert(FieldOrBaseOffsets.upper_bound(offs),
- std::make_pair(offs, *Field));
+ std::make_pair(offs, &*Field));
}
if (CXXRec && includeVBases) {
return false;
}
- if (!IsStructurallyEquivalent(Context, *Field1, *Field2))
+ if (!IsStructurallyEquivalent(Context, &*Field1, &*Field2))
return false;
}
for (RecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end();
I != E; ++I, ++Index) {
- (*I)->CachedFieldIndex = Index + 1;
+ I->CachedFieldIndex = Index + 1;
if (IsMsStruct) {
// Zero-length bitfields following non-bitfield members are ignored.
- if (getASTContext().ZeroBitfieldFollowsNonBitfield((*I), LastFD)) {
+ if (getASTContext().ZeroBitfieldFollowsNonBitfield(&*I, LastFD)) {
--Index;
continue;
}
- LastFD = (*I);
+ LastFD = &*I;
}
}
CXXConstructorDecl *CXXRecordDecl::getMoveConstructor() const {
for (ctor_iterator I = ctor_begin(), E = ctor_end(); I != E; ++I)
if (I->isMoveConstructor())
- return *I;
+ return &*I;
return 0;
}
CXXMethodDecl *CXXRecordDecl::getMoveAssignmentOperator() const {
for (method_iterator I = method_begin(), E = method_end(); I != E; ++I)
if (I->isMoveAssignmentOperator())
- return *I;
+ return &*I;
return 0;
}
for (LambdaExpr::Capture *C = Lambda.Captures, *CEnd = C + Lambda.NumCaptures;
C != CEnd; ++C, ++Field) {
if (C->capturesThis()) {
- ThisCapture = *Field;
+ ThisCapture = &*Field;
continue;
}
- Captures[C->getCapturedVar()] = *Field;
+ Captures[C->getCapturedVar()] = &*Field;
}
}
ObjCIvarDecl *curIvar = 0;
if (!ivar_empty()) {
ObjCInterfaceDecl::ivar_iterator I = ivar_begin(), E = ivar_end();
- data().IvarList = (*I); ++I;
- for (curIvar = data().IvarList; I != E; curIvar = *I, ++I)
- curIvar->setNextIvar(*I);
+ data().IvarList = &*I; ++I;
+ for (curIvar = data().IvarList; I != E; curIvar = &*I, ++I)
+ curIvar->setNextIvar(&*I);
}
for (const ObjCCategoryDecl *CDecl = getFirstClassExtension(); CDecl;
ObjCCategoryDecl::ivar_iterator I = CDecl->ivar_begin(),
E = CDecl->ivar_end();
if (!data().IvarList) {
- data().IvarList = (*I); ++I;
+ data().IvarList = &*I; ++I;
curIvar = data().IvarList;
}
- for ( ;I != E; curIvar = *I, ++I)
- curIvar->setNextIvar(*I);
+ for ( ;I != E; curIvar = &*I, ++I)
+ curIvar->setNextIvar(&*I);
}
}
ObjCImplementationDecl::ivar_iterator I = ImplDecl->ivar_begin(),
E = ImplDecl->ivar_end();
if (!data().IvarList) {
- data().IvarList = (*I); ++I;
+ data().IvarList = &*I; ++I;
curIvar = data().IvarList;
}
- for ( ;I != E; curIvar = *I, ++I)
- curIvar->setNextIvar(*I);
+ for ( ;I != E; curIvar = &*I, ++I)
+ curIvar->setNextIvar(&*I);
}
}
return data().IvarList;
ObjCPropertyImplDecl *ObjCImplDecl::
FindPropertyImplIvarDecl(IdentifierInfo *ivarId) const {
for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
- ObjCPropertyImplDecl *PID = *i;
+ ObjCPropertyImplDecl *PID = &*i;
if (PID->getPropertyIvarDecl() &&
PID->getPropertyIvarDecl()->getIdentifier() == ivarId)
return PID;
ObjCPropertyImplDecl *ObjCImplDecl::
FindPropertyImplDecl(IdentifierInfo *Id) const {
for (propimpl_iterator i = propimpl_begin(), e = propimpl_end(); i != e; ++i){
- ObjCPropertyImplDecl *PID = *i;
+ ObjCPropertyImplDecl *PID = &*i;
if (PID->getPropertyDecl()->getIdentifier() == Id)
return PID;
}
Indentation += Policy.Indentation;
for (ObjCInterfaceDecl::ivar_iterator I = OID->ivar_begin(),
E = OID->ivar_end(); I != E; ++I) {
- Indent() << (*I)->getType().getAsString(Policy) << ' ' << **I << ";\n";
+ Indent() << I->getType().getAsString(Policy) << ' ' << *I << ";\n";
}
Indentation -= Policy.Indentation;
Out << "}\n";
}
for (RecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end();
I != E; ++I) {
- if (!CheckConstantExpression(Info, DiagLoc, (*I)->getType(),
- Value.getStructField((*I)->getFieldIndex())))
+ if (!CheckConstantExpression(Info, DiagLoc, I->getType(),
+ Value.getStructField(I->getFieldIndex())))
return false;
}
}
for (RecordDecl::field_iterator I = RD->field_begin(), End = RD->field_end();
I != End; ++I) {
// -- if T is a reference type, no initialization is performed.
- if ((*I)->getType()->isReferenceType())
+ if (I->getType()->isReferenceType())
continue;
LValue Subobject = This;
- HandleLValueMember(Info, E, Subobject, *I, &Layout);
+ HandleLValueMember(Info, E, Subobject, &*I, &Layout);
- ImplicitValueInitExpr VIE((*I)->getType());
+ ImplicitValueInitExpr VIE(I->getType());
if (!EvaluateInPlace(
- Result.getStructField((*I)->getFieldIndex()), Info, Subobject, &VIE))
+ Result.getStructField(I->getFieldIndex()), Info, Subobject, &VIE))
return false;
}
}
LValue Subobject = This;
- HandleLValueMember(Info, E, Subobject, *I);
- Result = APValue(*I);
- ImplicitValueInitExpr VIE((*I)->getType());
+ HandleLValueMember(Info, E, Subobject, &*I);
+ Result = APValue(&*I);
+ ImplicitValueInitExpr VIE(I->getType());
return EvaluateInPlace(Result.getUnionValue(), Info, Subobject, &VIE);
}
// FIXME: Diagnostics here should point to the end of the initializer
// list, not the start.
HandleLValueMember(Info, HaveInit ? E->getInit(ElementNo) : E, Subobject,
- *Field, &Layout);
+ &*Field, &Layout);
// Perform an implicit value-initialization for members beyond the end of
// the initializer list.
ImplicitValueInitExpr VIE(HaveInit ? Info.Ctx.IntTy : Field->getType());
if (!EvaluateInPlace(
- Result.getStructField((*Field)->getFieldIndex()),
+ Result.getStructField(Field->getFieldIndex()),
Info, Subobject, HaveInit ? E->getInit(ElementNo++) : &VIE)) {
if (!Info.keepEvaluatingAfterFailure())
return false;
for (RecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end();
I != E; ++I) {
- const FieldDecl *FD = *I;
+ const FieldDecl *FD = &*I;
if (FD->getIdentifier())
return FD;
// Check the fields.
for (CXXRecordDecl::field_iterator I = Class->field_begin(),
E = Class->field_end(); I != E; ++I) {
- const FieldDecl *FD = *I;
+ const FieldDecl &FD = *I;
const RecordType *RT =
- Context.getBaseElementType(FD->getType())->getAs<RecordType>();
+ Context.getBaseElementType(FD.getType())->getAs<RecordType>();
// We only care about record types.
if (!RT)
unsigned FieldNo = 0;
for (CXXRecordDecl::field_iterator I = Info->Class->field_begin(),
E = Info->Class->field_end(); I != E; ++I, ++FieldNo) {
- const FieldDecl *FD = *I;
+ const FieldDecl *FD = &*I;
if (FD->isBitField())
continue;
unsigned FieldNo = 0;
for (CXXRecordDecl::field_iterator I = Info->Class->field_begin(),
E = Info->Class->field_end(); I != E; ++I, ++FieldNo) {
- const FieldDecl *FD = *I;
+ const FieldDecl *FD = &*I;
if (FD->isBitField())
continue;
unsigned FieldNo = 0;
for (CXXRecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end();
I != E; ++I, ++FieldNo) {
- const FieldDecl *FD = *I;
+ const FieldDecl *FD = &*I;
if (FD->isBitField())
continue;
unsigned FieldNo = 0;
for (CXXRecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end();
I != E; ++I, ++FieldNo) {
- const FieldDecl *FD = *I;
+ const FieldDecl *FD = &*I;
if (FD->isBitField())
continue;
for (RecordDecl::field_iterator Field = D->field_begin(),
FieldEnd = D->field_end(); Field != FieldEnd; ++Field) {
if (IsMsStruct) {
- FieldDecl *FD = (*Field);
+ FieldDecl *FD = &*Field;
if (Context.ZeroBitfieldFollowsBitfield(FD, LastFD))
ZeroLengthBitfield = FD;
// Zero-length bitfields following non-bitfield members are
}
else if (!Context.getTargetInfo().useBitFieldTypeAlignment() &&
Context.getTargetInfo().useZeroLengthBitfieldAlignment()) {
- FieldDecl *FD = (*Field);
+ FieldDecl *FD = &*Field;
if (FD->isBitField() && FD->getBitWidthValue(Context) == 0)
ZeroLengthBitfield = FD;
}
- LayoutField(*Field);
+ LayoutField(&*Field);
}
if (IsMsStruct && RemainingInAlignment &&
LastFD && LastFD->isBitField() && LastFD->getBitWidthValue(Context)) {
for (CXXRecordDecl::method_iterator I = RD->method_begin(),
E = RD->method_end(); I != E; ++I) {
- const CXXMethodDecl *MD = *I;
+ const CXXMethodDecl *MD = &*I;
if (!MD->isVirtual())
continue;
uint64_t FieldNo = 0;
for (CXXRecordDecl::field_iterator I = RD->field_begin(),
E = RD->field_end(); I != E; ++I, ++FieldNo) {
- const FieldDecl *Field = *I;
+ const FieldDecl &Field = *I;
CharUnits FieldOffset = Offset +
C.toCharUnitsFromBits(Layout.getFieldOffset(FieldNo));
- if (const RecordType *RT = Field->getType()->getAs<RecordType>()) {
+ if (const RecordType *RT = Field.getType()->getAs<RecordType>()) {
if (const CXXRecordDecl *D = dyn_cast<CXXRecordDecl>(RT->getDecl())) {
DumpCXXRecordLayout(OS, D, C, FieldOffset, IndentLevel,
- Field->getName().data(),
+ Field.getName().data(),
/*IncludeVirtualBases=*/true);
continue;
}
}
PrintOffset(OS, FieldOffset, IndentLevel);
- OS << Field->getType().getAsString() << ' ' << *Field << '\n';
+ OS << Field.getType().getAsString() << ' ' << Field << '\n';
}
if (!IncludeVirtualBases)
// Now dump the overriders for this base subobject.
for (CXXRecordDecl::method_iterator I = RD->method_begin(),
E = RD->method_end(); I != E; ++I) {
- const CXXMethodDecl *MD = *I;
+ const CXXMethodDecl *MD = &*I;
if (!MD->isVirtual())
continue;
// Add the vcall offsets.
for (CXXRecordDecl::method_iterator I = RD->method_begin(),
E = RD->method_end(); I != E; ++I) {
- const CXXMethodDecl *MD = *I;
+ const CXXMethodDecl *MD = &*I;
if (!MD->isVirtual())
continue;
// Now go through all virtual member functions and add them.
for (CXXRecordDecl::method_iterator I = RD->method_begin(),
E = RD->method_end(); I != E; ++I) {
- const CXXMethodDecl *MD = *I;
+ const CXXMethodDecl *MD = &*I;
if (!MD->isVirtual())
continue;
for (CXXRecordDecl::method_iterator i = MostDerivedClass->method_begin(),
e = MostDerivedClass->method_end(); i != e; ++i) {
- const CXXMethodDecl *MD = *i;
+ const CXXMethodDecl *MD = &*i;
// We only want virtual member functions.
if (!MD->isVirtual())
for (CXXRecordDecl::method_iterator i = RD->method_begin(),
e = RD->method_end(); i != e; ++i) {
- const CXXMethodDecl *MD = *i;
+ const CXXMethodDecl *MD = &*i;
// We only want virtual methods.
if (!MD->isVirtual())
if (const CXXRecordDecl *CD = QT->getAsCXXRecordDecl())
if (!CD->hasTrivialDestructor()) {
autoCreateBlock();
- appendMemberDtor(Block, *FI);
+ appendMemberDtor(Block, &*FI);
}
}
}
DeclContext::specific_decl_iterator<VarDecl> I(dc.decls_begin()),
E(dc.decls_end());
for ( ; I != E; ++I) {
- const VarDecl *vd = *I;
+ const VarDecl *vd = &*I;
if (isTrackedVar(vd, &dc))
map[vd] = count++;
}
// 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.
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());
} 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>()) {
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());
} 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?
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());
} 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);
// 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;
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;
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;
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
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);
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();
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;
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");
break;
- LValue LV = CGF.EmitLValueForFieldInitialization(DestLV, *field);
+ LValue LV = CGF.EmitLValueForFieldInitialization(DestLV, &*field);
// We never generate write-barries for initialized fields.
LV.setNonGC(true);
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);
}
}
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;
}
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));
}
}
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;
}
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));
}
}
// 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.)
// 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");
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,
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);
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[] = {
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()),
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();
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));
}
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();
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;
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;
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;
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.
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));
}
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) {
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;
}
// 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.
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;
// 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))
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;
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:
// 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)
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)
if (NumFields >= Known->second.FieldOffsets.size())
continue;
- FieldOffsets[*F] = Known->second.FieldOffsets[NumFields];
+ FieldOffsets[&*F] = Known->second.FieldOffsets[NumFields];
}
// Wrong number of fields.
InsertText(CatDecl->getIvarLBraceLoc(), "// ");
for (ObjCCategoryDecl::ivar_iterator
I = CatDecl->ivar_begin(), E = CatDecl->ivar_end(); I != E; ++I) {
- ObjCIvarDecl *Ivar = (*I);
+ ObjCIvarDecl *Ivar = &*I;
SourceLocation LocStart = Ivar->getLocStart();
ReplaceText(LocStart, 0, "// ");
}
for (ObjCCategoryDecl::prop_iterator I = CatDecl->prop_begin(),
E = CatDecl->prop_end(); I != E; ++I)
- RewriteProperty(*I);
+ RewriteProperty(&*I);
for (ObjCCategoryDecl::instmeth_iterator
I = CatDecl->instmeth_begin(), E = CatDecl->instmeth_end();
for (ObjCInterfaceDecl::prop_iterator I = PDecl->prop_begin(),
E = PDecl->prop_end(); I != E; ++I)
- RewriteProperty(*I);
+ RewriteProperty(&*I);
// Lastly, comment out the @end.
SourceLocation LocEnd = PDecl->getAtEndRange().getBegin();
InsertText(IMD->getIvarLBraceLoc(), "// ");
for (ObjCImplementationDecl::ivar_iterator
I = IMD->ivar_begin(), E = IMD->ivar_end(); I != E; ++I) {
- ObjCIvarDecl *Ivar = (*I);
+ ObjCIvarDecl *Ivar = &*I;
SourceLocation LocStart = Ivar->getLocStart();
ReplaceText(LocStart, 0, "// ");
}
I = IMD ? IMD->propimpl_begin() : CID->propimpl_begin(),
E = IMD ? IMD->propimpl_end() : CID->propimpl_end();
I != E; ++I) {
- RewritePropertyImplDecl(*I, IMD, CID);
+ RewritePropertyImplDecl(&*I, IMD, CID);
}
InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// ");
for (ObjCInterfaceDecl::prop_iterator I = ClassDecl->prop_begin(),
E = ClassDecl->prop_end(); I != E; ++I)
- RewriteProperty(*I);
+ RewriteProperty(&*I);
for (ObjCInterfaceDecl::instmeth_iterator
I = ClassDecl->instmeth_begin(), E = ClassDecl->instmeth_end();
I != E; ++I)
Result += " {\n";
for (RecordDecl::field_iterator i = RD->field_begin(),
e = RD->field_end(); i != e; ++i) {
- FieldDecl *FD = *i;
+ FieldDecl *FD = &*i;
RewriteObjCFieldDecl(FD, Result);
}
Result += "\t} ";
void RewriteModernObjC::RewriteRecordBody(RecordDecl *RD) {
for (RecordDecl::field_iterator i = RD->field_begin(),
e = RD->field_end(); i != e; ++i) {
- FieldDecl *FD = *i;
+ FieldDecl *FD = &*i;
if (isTopLevelBlockPointerType(FD->getType()))
RewriteBlockPointerDecl(FD);
if (FD->getType()->isObjCQualifiedIdType() ||
std::vector<ObjCPropertyDecl *> ProtocolProperties;
for (ObjCContainerDecl::prop_iterator I = PDecl->prop_begin(),
E = PDecl->prop_end(); I != E; ++I)
- ProtocolProperties.push_back(*I);
+ ProtocolProperties.push_back(&*I);
Write_prop_list_t_initializer(*this, Context, Result, ProtocolProperties,
/* Container */0,
for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(),
PropEnd = IDecl->propimpl_end();
Prop != PropEnd; ++Prop) {
- if ((*Prop)->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
+ if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
continue;
- if (!(*Prop)->getPropertyIvarDecl())
+ if (!Prop->getPropertyIvarDecl())
continue;
- ObjCPropertyDecl *PD = (*Prop)->getPropertyDecl();
+ ObjCPropertyDecl *PD = Prop->getPropertyDecl();
if (!PD)
continue;
if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl())
std::vector<ObjCPropertyDecl *> ClassProperties;
for (ObjCContainerDecl::prop_iterator I = CDecl->prop_begin(),
E = CDecl->prop_end(); I != E; ++I)
- ClassProperties.push_back(*I);
+ ClassProperties.push_back(&*I);
Write_prop_list_t_initializer(*this, Context, Result, ClassProperties,
/* Container */IDecl,
for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(),
PropEnd = IDecl->propimpl_end();
Prop != PropEnd; ++Prop) {
- if ((*Prop)->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
+ if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
continue;
- if (!(*Prop)->getPropertyIvarDecl())
+ if (!Prop->getPropertyIvarDecl())
continue;
- ObjCPropertyDecl *PD = (*Prop)->getPropertyDecl();
+ ObjCPropertyDecl *PD = Prop->getPropertyDecl();
if (!PD)
continue;
if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl())
std::vector<ObjCPropertyDecl *> ClassProperties;
for (ObjCContainerDecl::prop_iterator I = CDecl->prop_begin(),
E = CDecl->prop_end(); I != E; ++I)
- ClassProperties.push_back(*I);
+ ClassProperties.push_back(&*I);
Write_prop_list_t_initializer(*this, Context, Result, ClassProperties,
/* Container */0,
for (ObjCCategoryDecl::prop_iterator I = CatDecl->prop_begin(),
E = CatDecl->prop_end(); I != E; ++I)
- RewriteProperty(*I);
+ RewriteProperty(&*I);
for (ObjCCategoryDecl::instmeth_iterator
I = CatDecl->instmeth_begin(), E = CatDecl->instmeth_end();
for (ObjCInterfaceDecl::prop_iterator I = PDecl->prop_begin(),
E = PDecl->prop_end(); I != E; ++I)
- RewriteProperty(*I);
+ RewriteProperty(&*I);
// Lastly, comment out the @end.
SourceLocation LocEnd = PDecl->getAtEndRange().getBegin();
I = IMD ? IMD->propimpl_begin() : CID->propimpl_begin(),
E = IMD ? IMD->propimpl_end() : CID->propimpl_end();
I != E; ++I) {
- RewritePropertyImplDecl(*I, IMD, CID);
+ RewritePropertyImplDecl(&*I, IMD, CID);
}
InsertText(IMD ? IMD->getLocEnd() : CID->getLocEnd(), "// ");
for (ObjCInterfaceDecl::prop_iterator I = ClassDecl->prop_begin(),
E = ClassDecl->prop_end(); I != E; ++I)
- RewriteProperty(*I);
+ RewriteProperty(&*I);
for (ObjCInterfaceDecl::instmeth_iterator
I = ClassDecl->instmeth_begin(), E = ClassDecl->instmeth_end();
I != E; ++I)
void RewriteObjC::RewriteRecordBody(RecordDecl *RD) {
for (RecordDecl::field_iterator i = RD->field_begin(),
e = RD->field_end(); i != e; ++i) {
- FieldDecl *FD = *i;
+ FieldDecl *FD = &*i;
if (isTopLevelBlockPointerType(FD->getType()))
RewriteBlockPointerDecl(FD);
if (FD->getType()->isObjCQualifiedIdType() ||
for (ObjCInterfaceDecl::ivar_iterator
IV = IDecl->ivar_begin(), IVEnd = IDecl->ivar_end();
IV != IVEnd; ++IV)
- IVars.push_back(*IV);
+ IVars.push_back(&*IV);
IVI = IDecl->ivar_begin();
IVE = IDecl->ivar_end();
} else {
IVE = CDecl->ivar_end();
}
Result += "\t,{{\"";
- Result += (*IVI)->getNameAsString();
+ Result += IVI->getNameAsString();
Result += "\", \"";
std::string TmpString, StrEncoding;
- Context->getObjCEncodingForType((*IVI)->getType(), TmpString, *IVI);
+ Context->getObjCEncodingForType(IVI->getType(), TmpString, &*IVI);
QuoteDoublequotes(TmpString, StrEncoding);
Result += StrEncoding;
Result += "\", ";
- RewriteIvarOffsetComputation(*IVI, Result);
+ RewriteIvarOffsetComputation(&*IVI, Result);
Result += "}\n";
for (++IVI; IVI != IVE; ++IVI) {
Result += "\t ,{\"";
- Result += (*IVI)->getNameAsString();
+ Result += IVI->getNameAsString();
Result += "\", \"";
std::string TmpString, StrEncoding;
- Context->getObjCEncodingForType((*IVI)->getType(), TmpString, *IVI);
+ Context->getObjCEncodingForType(IVI->getType(), TmpString, &*IVI);
QuoteDoublequotes(TmpString, StrEncoding);
Result += StrEncoding;
Result += "\", ";
- RewriteIvarOffsetComputation((*IVI), Result);
+ RewriteIvarOffsetComputation(&*IVI, Result);
Result += "}\n";
}
for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(),
PropEnd = IDecl->propimpl_end();
Prop != PropEnd; ++Prop) {
- if ((*Prop)->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
+ if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
continue;
- if (!(*Prop)->getPropertyIvarDecl())
+ if (!Prop->getPropertyIvarDecl())
continue;
- ObjCPropertyDecl *PD = (*Prop)->getPropertyDecl();
+ ObjCPropertyDecl *PD = Prop->getPropertyDecl();
if (!PD)
continue;
if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl())
for (ObjCImplDecl::propimpl_iterator Prop = IDecl->propimpl_begin(),
PropEnd = IDecl->propimpl_end();
Prop != PropEnd; ++Prop) {
- if ((*Prop)->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
+ if (Prop->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic)
continue;
- if (!(*Prop)->getPropertyIvarDecl())
+ if (!Prop->getPropertyIvarDecl())
continue;
- ObjCPropertyDecl *PD = (*Prop)->getPropertyDecl();
+ ObjCPropertyDecl *PD = Prop->getPropertyDecl();
if (!PD)
continue;
if (ObjCMethodDecl *Getter = PD->getGetterMethodDecl())
P != PEnd;
++P) {
if (AddedProperties.insert(P->getIdentifier()))
- Results.MaybeAddResult(Result(*P, 0), CurContext);
+ Results.MaybeAddResult(Result(&*P, 0), CurContext);
}
// Add nullary methods
if (AddedProperties.insert(Name)) {
CodeCompletionBuilder Builder(Results.getAllocator(),
Results.getCodeCompletionTUInfo());
- AddResultTypeChunk(Context, Policy, *M, Builder);
+ AddResultTypeChunk(Context, Policy, &*M, Builder);
Builder.AddTypedTextChunk(
Results.getAllocator().CopyString(Name->getName()));
- Results.MaybeAddResult(Result(Builder.TakeString(), *M,
+ Results.MaybeAddResult(Result(Builder.TakeString(), &*M,
CCP_MemberDeclaration + CCD_MethodAsProperty),
CurContext);
}
for (EnumDecl::enumerator_iterator E = Enum->enumerator_begin(),
EEnd = Enum->enumerator_end();
E != EEnd; ++E) {
- if (EnumeratorsSeen.count(*E))
+ if (EnumeratorsSeen.count(&*E))
continue;
- CodeCompletionResult R(*E, Qualifier);
+ CodeCompletionResult R(&*E, Qualifier);
R.Priority = CCP_EnumInCase;
Results.AddResult(R, CurContext, 0, false);
}
for (DeclContext::specific_decl_iterator<NamespaceDecl>
NS(Ctx->decls_begin()), NSEnd(Ctx->decls_end());
NS != NSEnd; ++NS)
- OrigToLatest[NS->getOriginalNamespace()] = *NS;
+ OrigToLatest[NS->getOriginalNamespace()] = &*NS;
// Add the most recent definition (or extended definition) of each
// namespace to the list of results.
SawLastInitializer
= NumInitializers > 0 &&
Initializers[NumInitializers - 1]->isAnyMemberInitializer() &&
- Initializers[NumInitializers - 1]->getAnyMember() == *Field;
+ Initializers[NumInitializers - 1]->getAnyMember() == &*Field;
continue;
}
: CCP_MemberDeclaration,
CXCursor_MemberRef,
CXAvailability_Available,
- *Field));
+ &*Field));
SawLastInitializer = false;
}
Results.ExitScope();
for (ObjCContainerDecl::method_iterator M = Container->meth_begin(),
MEnd = Container->meth_end();
M != MEnd; ++M) {
- if ((*M)->isInstanceMethod() == WantInstanceMethods) {
+ if (M->isInstanceMethod() == WantInstanceMethods) {
// Check whether the selector identifiers we've been given are a
// subset of the identifiers for this particular method.
- if (!isAcceptableObjCMethod(*M, WantKind, SelIdents, NumSelIdents,
+ if (!isAcceptableObjCMethod(&*M, WantKind, SelIdents, NumSelIdents,
AllowSameLength))
continue;
- if (!Selectors.insert((*M)->getSelector()))
+ if (!Selectors.insert(M->getSelector()))
continue;
- Result R = Result(*M, 0);
+ Result R = Result(&*M, 0);
R.StartParameter = NumSelIdents;
R.AllParametersAreInformative = (WantKind != MK_Any);
if (!InOriginalClass)
for (ObjCContainerDecl::method_iterator M = Container->meth_begin(),
MEnd = Container->meth_end();
M != MEnd; ++M) {
- if ((*M)->isInstanceMethod() == WantInstanceMethods) {
+ if (M->isInstanceMethod() == WantInstanceMethods) {
if (!ReturnType.isNull() &&
- !Context.hasSameUnqualifiedType(ReturnType, (*M)->getResultType()))
+ !Context.hasSameUnqualifiedType(ReturnType, M->getResultType()))
continue;
- KnownMethods[(*M)->getSelector()] = std::make_pair(*M, InOriginalClass);
+ KnownMethods[M->getSelector()] = std::make_pair(&*M, InOriginalClass);
}
}
}
for (ObjCContainerDecl::prop_iterator P = Containers[I]->prop_begin(),
PEnd = Containers[I]->prop_end();
P != PEnd; ++P) {
- AddObjCKeyValueCompletions(*P, IsInstanceMethod, ReturnType, Context,
+ AddObjCKeyValueCompletions(&*P, IsInstanceMethod, ReturnType, Context,
KnownSelectors, Results);
}
}
if (EnumDecl *ED = dyn_cast<EnumDecl>(D)) {
for (EnumDecl::enumerator_iterator EI = ED->enumerator_begin(),
EE = ED->enumerator_end(); EI != EE; ++EI)
- PushOnScopeChains(*EI, FnBodyScope, /*AddToContext=*/false);
+ PushOnScopeChains(&*EI, FnBodyScope, /*AddToContext=*/false);
}
}
}
if (RD->hasUserDeclaredConstructor()) {
typedef CXXRecordDecl::ctor_iterator ctor_iter;
for (ctor_iter CI = RD->ctor_begin(), CE = RD->ctor_end(); CI != CE; ++CI)
- if (DiagnoseNontrivialUserProvidedCtor(*this, QT, *CI, member))
+ if (DiagnoseNontrivialUserProvidedCtor(*this, QT, &*CI, member))
return;
// No user-provided constructors; look for constructor templates.
typedef RecordDecl::field_iterator field_iter;
for (field_iter fi = RD->field_begin(), fe = RD->field_end(); fi != fe;
++fi) {
- QualType EltTy = Context.getBaseElementType((*fi)->getType());
+ QualType EltTy = Context.getBaseElementType(fi->getType());
if (const RecordType *EltRT = EltTy->getAs<RecordType>()) {
CXXRecordDecl* EltRD = cast<CXXRecordDecl>(EltRT->getDecl());
if (!(EltRD->*hasTrivial)()) {
- SourceLocation FLoc = (*fi)->getLocation();
+ SourceLocation FLoc = fi->getLocation();
Diag(FLoc, diag::note_nontrivial_has_nontrivial) << QT << 0 << member;
DiagnoseNontrivial(EltRT, member);
return;
case Qualifiers::OCL_Autoreleasing:
case Qualifiers::OCL_Weak:
case Qualifiers::OCL_Strong:
- Diag((*fi)->getLocation(), diag::note_nontrivial_objc_ownership)
+ Diag(fi->getLocation(), diag::note_nontrivial_objc_ownership)
<< QT << EltTy.getObjCLifetime();
return;
}
return;
}
- FieldDecl *FirstField = *Field;
+ FieldDecl *FirstField = &*Field;
QualType FirstType = FirstField->getType();
if (FirstType->hasFloatingRepresentation() || FirstType->isVectorType()) {
S.Diag(FirstField->getLocation(),
I != E; ++I)
// If an anonymous union contains an anonymous struct of which any member
// is initialized, all members must be initialized.
- if (!RD->isUnion() || Inits.count(*I))
- CheckConstexprCtorInitializer(SemaRef, Dcl, *I, Inits, Diagnosed);
+ if (!RD->isUnion() || Inits.count(&*I))
+ CheckConstexprCtorInitializer(SemaRef, Dcl, &*I, Inits, Diagnosed);
}
}
unsigned Fields = 0;
for (CXXRecordDecl::field_iterator I = RD->field_begin(),
E = RD->field_end(); I != E; ++I, ++Fields) {
- if ((*I)->isAnonymousStructOrUnion()) {
+ if (I->isAnonymousStructOrUnion()) {
AnyAnonStructUnionMembers = true;
break;
}
bool Diagnosed = false;
for (CXXRecordDecl::field_iterator I = RD->field_begin(),
E = RD->field_end(); I != E; ++I)
- CheckConstexprCtorInitializer(*this, Dcl, *I, Inits, Diagnosed);
+ CheckConstexprCtorInitializer(*this, Dcl, &*I, Inits, Diagnosed);
if (Diagnosed)
return false;
}
if (Field->isUnnamedBitfield())
continue;
- IdealInitKeys.push_back(GetKeyForTopLevelField(*Field));
+ IdealInitKeys.push_back(GetKeyForTopLevelField(&*Field));
}
unsigned NumIdealInits = IdealInitKeys.size();
// Non-static data members.
for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(),
E = ClassDecl->field_end(); I != E; ++I) {
- FieldDecl *Field = *I;
+ FieldDecl *Field = &*I;
if (Field->isInvalidDecl())
continue;
for (CXXRecordDecl::method_iterator M = Record->method_begin(),
MEnd = Record->method_end();
M != MEnd; ++M) {
- if (!(*M)->isStatic())
- DiagnoseHiddenVirtualMethods(Record, *M);
+ if (!M->isStatic())
+ DiagnoseHiddenVirtualMethods(Record, &*M);
}
}
case TSK_Undeclared:
case TSK_ExplicitSpecialization:
- RequireLiteralType((*M)->getLocation(), Context.getRecordType(Record),
+ RequireLiteralType(M->getLocation(), Context.getRecordType(Record),
PDiag(diag::err_constexpr_method_non_literal));
break;
}
ME = Record->method_end();
MI != ME; ++MI) {
if (!MI->isInvalidDecl() && MI->isExplicitlyDefaulted()) {
- switch (getSpecialMember(*MI)) {
+ switch (getSpecialMember(&*MI)) {
case CXXDefaultConstructor:
CheckExplicitlyDefaultedDefaultConstructor(
- cast<CXXConstructorDecl>(*MI));
+ cast<CXXConstructorDecl>(&*MI));
break;
case CXXDestructor:
- CheckExplicitlyDefaultedDestructor(cast<CXXDestructorDecl>(*MI));
+ CheckExplicitlyDefaultedDestructor(cast<CXXDestructorDecl>(&*MI));
break;
case CXXCopyConstructor:
- CheckExplicitlyDefaultedCopyConstructor(cast<CXXConstructorDecl>(*MI));
+ CheckExplicitlyDefaultedCopyConstructor(cast<CXXConstructorDecl>(&*MI));
break;
case CXXCopyAssignment:
- CheckExplicitlyDefaultedCopyAssignment(*MI);
+ CheckExplicitlyDefaultedCopyAssignment(&*MI);
break;
case CXXMoveConstructor:
- CheckExplicitlyDefaultedMoveConstructor(cast<CXXConstructorDecl>(*MI));
+ CheckExplicitlyDefaultedMoveConstructor(cast<CXXConstructorDecl>(&*MI));
break;
case CXXMoveAssignment:
- CheckExplicitlyDefaultedMoveAssignment(*MI);
+ CheckExplicitlyDefaultedMoveAssignment(&*MI);
break;
case CXXInvalid:
CXXRecordDecl *UnionFieldRecord = UnionFieldType->getAsCXXRecordDecl();
if (UnionFieldRecord &&
- shouldDeleteForClassSubobject(UnionFieldRecord, *UI))
+ shouldDeleteForClassSubobject(UnionFieldRecord, &*UI))
return true;
}
for (CXXRecordDecl::field_iterator FI = RD->field_begin(),
FE = RD->field_end(); FI != FE; ++FI)
if (!FI->isInvalidDecl() && !FI->isUnnamedBitfield() &&
- SMI.shouldDeleteForField(*FI))
+ SMI.shouldDeleteForField(&*FI))
return true;
if (SMI.shouldDeleteForAllConstMembers())
// results from omitting any ellipsis parameter specification and
// successively omitting parameters with a default argument from the
// end of the parameter-type-list.
- CXXConstructorDecl *BaseCtor = *CtorIt;
+ CXXConstructorDecl *BaseCtor = &*CtorIt;
bool CanBeCopyOrMove = BaseCtor->isCopyOrMoveConstructor();
const FunctionProtoType *BaseCtorType =
BaseCtor->getType()->getAs<FunctionProtoType>();
FieldEnd = ClassDecl->field_end();
HasConstCopyAssignment && Field != FieldEnd;
++Field) {
- QualType FieldType = Context.getBaseElementType((*Field)->getType());
+ QualType FieldType = Context.getBaseElementType(Field->getType());
if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
HasConstCopyAssignment &=
(bool)LookupCopyingAssignment(FieldClassDecl, Qualifiers::Const,
FieldEnd = ClassDecl->field_end();
Field != FieldEnd;
++Field) {
- QualType FieldType = Context.getBaseElementType((*Field)->getType());
+ QualType FieldType = Context.getBaseElementType(Field->getType());
if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
if (CXXMethodDecl *CopyAssign =
LookupCopyingAssignment(FieldClassDecl, ArgQuals, false, 0))
CXXScopeSpec SS; // Intentionally empty
LookupResult MemberLookup(*this, Field->getDeclName(), Loc,
LookupMemberName);
- MemberLookup.addDecl(*Field);
+ MemberLookup.addDecl(&*Field);
MemberLookup.resolveKind();
ExprResult From = BuildMemberReferenceExpr(OtherRef, OtherRefType,
Loc, /*IsArrow=*/false,
FieldEnd = ClassDecl->field_end();
Field != FieldEnd;
++Field) {
- QualType FieldType = Context.getBaseElementType((*Field)->getType());
+ QualType FieldType = Context.getBaseElementType(Field->getType());
if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
if (CXXMethodDecl *MoveAssign = LookupMovingAssignment(FieldClassDecl,
false, 0))
for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(),
FieldEnd = ClassDecl->field_end();
Field != FieldEnd; ++Field) {
- if (!hasMoveOrIsTriviallyCopyable(S, (*Field)->getType(), IsConstructor))
+ if (!hasMoveOrIsTriviallyCopyable(S, Field->getType(), IsConstructor))
return false;
}
CXXScopeSpec SS; // Intentionally empty
LookupResult MemberLookup(*this, Field->getDeclName(), Loc,
LookupMemberName);
- MemberLookup.addDecl(*Field);
+ MemberLookup.addDecl(&*Field);
MemberLookup.resolveKind();
ExprResult From = BuildMemberReferenceExpr(OtherRef, OtherRefType,
Loc, /*IsArrow=*/false,
FieldEnd = ClassDecl->field_end();
HasConstCopyConstructor && Field != FieldEnd;
++Field) {
- QualType FieldType = Context.getBaseElementType((*Field)->getType());
+ QualType FieldType = Context.getBaseElementType(Field->getType());
if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
HasConstCopyConstructor &=
(bool)LookupCopyingConstructor(FieldClassDecl, Qualifiers::Const);
FieldEnd = ClassDecl->field_end();
Field != FieldEnd;
++Field) {
- QualType FieldType = Context.getBaseElementType((*Field)->getType());
+ QualType FieldType = Context.getBaseElementType(Field->getType());
if (CXXRecordDecl *FieldClassDecl = FieldType->getAsCXXRecordDecl()) {
if (CXXConstructorDecl *CopyConstructor =
LookupCopyingConstructor(FieldClassDecl, Quals))
const CXXRecordDecl *RD) {
for (CXXRecordDecl::method_iterator i = RD->method_begin(),
e = RD->method_end(); i != e; ++i) {
- CXXMethodDecl *MD = *i;
+ CXXMethodDecl *MD = &*i;
// C++ [basic.def.odr]p2:
// [...] A virtual member function is used if it is not pure. [...]
llvm::DenseMap<Selector, const ObjCMethodDecl*> MethodMap;
for (ObjCInterfaceDecl::method_iterator i = ID->meth_begin(),
e = ID->meth_end(); i != e; ++i) {
- ObjCMethodDecl *MD = *i;
+ ObjCMethodDecl *MD = &*i;
MethodMap[MD->getSelector()] = MD;
}
return;
for (ObjCCategoryDecl::method_iterator i = CAT->meth_begin(),
e = CAT->meth_end(); i != e; ++i) {
- ObjCMethodDecl *Method = *i;
+ ObjCMethodDecl *Method = &*i;
const ObjCMethodDecl *&PrevMethod = MethodMap[Method->getSelector()];
if (PrevMethod && !MatchTwoMethodDeclarations(Method, PrevMethod)) {
Diag(Method->getLocation(), diag::err_duplicate_method_decl)
IVI = IDecl->ivar_begin(), IVE = IDecl->ivar_end();
for (; numIvars > 0 && IVI != IVE; ++IVI) {
ObjCIvarDecl* ImplIvar = ivars[j++];
- ObjCIvarDecl* ClsIvar = *IVI;
+ ObjCIvarDecl* ClsIvar = &*IVI;
assert (ImplIvar && "missing implementation ivar");
assert (ClsIvar && "missing class ivar");
if (numIvars > 0)
Diag(ivars[j]->getLocation(), diag::err_inconsistant_ivar_count);
else if (IVI != IVE)
- Diag((*IVI)->getLocation(), diag::err_inconsistant_ivar_count);
+ Diag(IVI->getLocation(), diag::err_inconsistant_ivar_count);
}
void Sema::WarnUndefinedMethod(SourceLocation ImpLoc, ObjCMethodDecl *method,
ObjCInterfaceDecl *SID) {
for (ObjCInterfaceDecl::ivar_iterator IVI = ID->ivar_begin(),
IVE = ID->ivar_end(); IVI != IVE; ++IVI) {
- ObjCIvarDecl* Ivar = (*IVI);
+ ObjCIvarDecl* Ivar = &*IVI;
if (Ivar->isInvalidDecl())
continue;
if (IdentifierInfo *II = Ivar->getIdentifier()) {
for (ObjCContainerDecl::prop_iterator I = CDecl->prop_begin(),
E = CDecl->prop_end();
I != E; ++I)
- ProcessPropertyDecl(*I, CDecl);
+ ProcessPropertyDecl(&*I, CDecl);
CDecl->setAtEndRange(AtEnd);
}
if (ObjCImplementationDecl *IC=dyn_cast<ObjCImplementationDecl>(ClassDecl)) {
ClsExtDecl; ClsExtDecl = ClsExtDecl->getNextClassExtension()) {
for (ObjCContainerDecl::prop_iterator I = ClsExtDecl->prop_begin(),
E = ClsExtDecl->prop_end(); I != E; ++I) {
- ObjCPropertyDecl *Property = (*I);
+ ObjCPropertyDecl *Property = &*I;
// Skip over properties declared @dynamic
if (const ObjCPropertyImplDecl *PIDecl
= IC->FindPropertyImplDecl(Property->getIdentifier()))
if (RHSType->isPointerType())
if (RHSType->castAs<PointerType>()->getPointeeType()->isVoidType()) {
RHS = ImpCastExprToType(RHS.take(), it->getType(), CK_BitCast);
- InitField = *it;
+ InitField = &*it;
break;
}
Expr::NPC_ValueDependentIsNull)) {
RHS = ImpCastExprToType(RHS.take(), it->getType(),
CK_NullToPointer);
- InitField = *it;
+ InitField = &*it;
break;
}
}
if (CheckAssignmentConstraints(it->getType(), RHS, Kind)
== Compatible) {
RHS = ImpCastExprToType(RHS.take(), it->getType(), Kind);
- InitField = *it;
+ InitField = &*it;
break;
}
}
if (hadError)
return;
- FillInValueInitForField(Init, *Field, Entity, ILE, RequiresSecondPass);
+ FillInValueInitForField(Init, &*Field, Entity, ILE, RequiresSecondPass);
if (hadError)
return;
if (Field->getDeclName()) {
if (VerifyOnly)
CheckValueInitializable(
- InitializedEntity::InitializeMember(*Field, &Entity));
+ InitializedEntity::InitializeMember(&*Field, &Entity));
else
- StructuredList->setInitializedFieldInUnion(*Field);
+ StructuredList->setInitializedFieldInUnion(&*Field);
break;
}
}
// Make sure we can use this declaration.
bool InvalidUse;
if (VerifyOnly)
- InvalidUse = !SemaRef.CanUseDecl(*Field);
+ InvalidUse = !SemaRef.CanUseDecl(&*Field);
else
- InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field,
+ InvalidUse = SemaRef.DiagnoseUseOfDecl(&*Field,
IList->getInit(Index)->getLocStart());
if (InvalidUse) {
++Index;
}
InitializedEntity MemberEntity =
- InitializedEntity::InitializeMember(*Field, &Entity);
+ InitializedEntity::InitializeMember(&*Field, &Entity);
CheckSubElementType(MemberEntity, IList, Field->getType(), Index,
StructuredList, StructuredIndex);
InitializedSomething = true;
if (DeclType->isUnionType() && !VerifyOnly) {
// Initialize the first field within the union.
- StructuredList->setInitializedFieldInUnion(*Field);
+ StructuredList->setInitializedFieldInUnion(&*Field);
}
++Field;
for (; Field != FieldEnd && !hadError; ++Field) {
if (!Field->isUnnamedBitfield())
CheckValueInitializable(
- InitializedEntity::InitializeMember(*Field, &Entity));
+ InitializedEntity::InitializeMember(&*Field, &Entity));
}
}
Index >= IList->getNumInits())
return;
- if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field,
+ if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), &*Field,
TopLevelObject)) {
hadError = true;
++Index;
}
InitializedEntity MemberEntity =
- InitializedEntity::InitializeMember(*Field, &Entity);
+ InitializedEntity::InitializeMember(&*Field, &Entity);
if (isa<InitListExpr>(IList->getInit(Index)))
CheckSubElementType(MemberEntity, IList, Field->getType(), Index,
// IndirectFieldDecl that follow for the designated initializer.
if (!KnownField && Field->isAnonymousStructOrUnion()) {
if (IndirectFieldDecl *IF =
- FindIndirectFieldDesignator(*Field, FieldName)) {
+ FindIndirectFieldDesignator(&*Field, FieldName)) {
// In verify mode, don't modify the original.
if (VerifyOnly)
DIE = CloneDesignatedInitExpr(SemaRef, DIE);
break;
}
}
- if (KnownField && KnownField == *Field)
+ if (KnownField && KnownField == &*Field)
break;
if (FieldName && FieldName == Field->getIdentifier())
break;
if (Field->isUnnamedBitfield())
continue;
- if (ReplacementField == *Field ||
+ if (ReplacementField == &*Field ||
Field->getIdentifier() == ReplacementField->getIdentifier())
break;
if (RT->getDecl()->isUnion()) {
FieldIndex = 0;
if (!VerifyOnly)
- StructuredList->setInitializedFieldInUnion(*Field);
+ StructuredList->setInitializedFieldInUnion(&*Field);
}
// Make sure we can use this declaration.
bool InvalidUse;
if (VerifyOnly)
- InvalidUse = !SemaRef.CanUseDecl(*Field);
+ InvalidUse = !SemaRef.CanUseDecl(&*Field);
else
- InvalidUse = SemaRef.DiagnoseUseOfDecl(*Field, D->getFieldLoc());
+ InvalidUse = SemaRef.DiagnoseUseOfDecl(&*Field, D->getFieldLoc());
if (InvalidUse) {
++Index;
return true;
if (!VerifyOnly) {
// Update the designator with the field declaration.
- D->setField(*Field);
+ D->setField(&*Field);
// Make sure that our non-designated initializer list has space
// for a subobject corresponding to this field.
<< SourceRange(NextD->getStartLocation(),
DIE->getSourceRange().getEnd());
SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
- << *Field;
+ << &*Field;
}
Invalid = true;
}
diag::err_flexible_array_init_needs_braces)
<< DIE->getInit()->getSourceRange();
SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member)
- << *Field;
+ << &*Field;
}
Invalid = true;
}
// Check GNU flexible array initializer.
- if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), *Field,
+ if (!Invalid && CheckFlexibleArrayInit(Entity, DIE->getInit(), &*Field,
TopLevelObject))
Invalid = true;
IList->setInit(Index, DIE->getInit());
InitializedEntity MemberEntity =
- InitializedEntity::InitializeMember(*Field, &Entity);
+ InitializedEntity::InitializeMember(&*Field, &Entity);
CheckSubElementType(MemberEntity, IList, Field->getType(), Index,
StructuredList, newStructuredIndex);
}
} else {
// Recurse to check later designated subobjects.
- QualType FieldType = (*Field)->getType();
+ QualType FieldType = Field->getType();
unsigned newStructuredIndex = FieldIndex;
InitializedEntity MemberEntity =
- InitializedEntity::InitializeMember(*Field, &Entity);
+ InitializedEntity::InitializeMember(&*Field, &Entity);
if (CheckDesignatedInitializer(MemberEntity, IList, DIE, DesigIdx + 1,
FieldType, 0, 0, Index,
StructuredList, newStructuredIndex,
LambdaScopeInfo *LSI = getCurLambda();
CXXRecordDecl *Class = LSI->Lambda;
Class->setInvalidDecl();
- SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end());
+ SmallVector<Decl*, 4> Fields;
+ for (RecordDecl::field_iterator i = Class->field_begin(),
+ e = Class->field_end(); i != e; ++i)
+ Fields.push_back(&*i);
ActOnFields(0, Class->getLocation(), Class, Fields,
SourceLocation(), SourceLocation(), 0);
CheckCompletedCXXClass(Class);
addBlockPointerConversion(*this, IntroducerRange, Class, CallOperator);
// Finalize the lambda class.
- SmallVector<Decl*, 4> Fields(Class->field_begin(), Class->field_end());
+ SmallVector<Decl*, 4> Fields;
+ for (RecordDecl::field_iterator i = Class->field_begin(),
+ e = Class->field_end(); i != e; ++i)
+ Fields.push_back(&*i);
ActOnFields(0, Class->getLocation(), Class, Fields,
SourceLocation(), SourceLocation(), 0);
CheckCompletedCXXClass(Class);
// FIXME: O(N^2)
for (ObjCInterfaceDecl::prop_iterator S = SDecl->prop_begin(),
E = SDecl->prop_end(); S != E; ++S) {
- ObjCPropertyDecl *SuperPDecl = (*S);
+ ObjCPropertyDecl *SuperPDecl = &*S;
// Does property in super class has declaration in current class?
for (ObjCInterfaceDecl::prop_iterator I = IDecl->prop_begin(),
E = IDecl->prop_end(); I != E; ++I) {
- ObjCPropertyDecl *PDecl = (*I);
+ ObjCPropertyDecl *PDecl = &*I;
if (SuperPDecl->getIdentifier() == PDecl->getIdentifier())
DiagnosePropertyMismatch(PDecl, SuperPDecl,
SDecl->getIdentifier());
if (!CatDecl->IsClassExtension())
for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
E = PDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Pr = (*P);
+ ObjCPropertyDecl *Pr = &*P;
ObjCCategoryDecl::prop_iterator CP, CE;
// Is this property already in category's list of properties?
for (CP = CatDecl->prop_begin(), CE = CatDecl->prop_end(); CP!=CE; ++CP)
- if ((*CP)->getIdentifier() == Pr->getIdentifier())
+ if (CP->getIdentifier() == Pr->getIdentifier())
break;
if (CP != CE)
// Property protocol already exist in class. Diagnose any mismatch.
- DiagnosePropertyMismatch((*CP), Pr, PDecl->getIdentifier());
+ DiagnosePropertyMismatch(&*CP, Pr, PDecl->getIdentifier());
}
return;
}
for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
E = PDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Pr = (*P);
+ ObjCPropertyDecl *Pr = &*P;
ObjCInterfaceDecl::prop_iterator CP, CE;
// Is this property already in class's list of properties?
for (CP = IDecl->prop_begin(), CE = IDecl->prop_end(); CP != CE; ++CP)
- if ((*CP)->getIdentifier() == Pr->getIdentifier())
+ if (CP->getIdentifier() == Pr->getIdentifier())
break;
if (CP != CE)
// Property protocol already exist in class. Diagnose any mismatch.
- DiagnosePropertyMismatch((*CP), Pr, PDecl->getIdentifier());
+ DiagnosePropertyMismatch(&*CP, Pr, PDecl->getIdentifier());
}
}
if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl)) {
for (ObjCContainerDecl::prop_iterator P = IDecl->prop_begin(),
E = IDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
PropMap[Prop->getIdentifier()] = Prop;
}
// scan through class's protocols.
if (!CATDecl->IsClassExtension())
for (ObjCContainerDecl::prop_iterator P = CATDecl->prop_begin(),
E = CATDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
PropMap[Prop->getIdentifier()] = Prop;
}
// scan through class's protocols.
else if (ObjCProtocolDecl *PDecl = dyn_cast<ObjCProtocolDecl>(CDecl)) {
for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
E = PDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
ObjCPropertyDecl *PropertyFromSuper = SuperPropMap[Prop->getIdentifier()];
// Exclude property for protocols which conform to class's super-class,
// as super-class has to implement the property.
if (ObjCInterfaceDecl *IDecl = dyn_cast<ObjCInterfaceDecl>(CDecl)) {
for (ObjCContainerDecl::prop_iterator P = IDecl->prop_begin(),
E = IDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
PropMap[Prop->getIdentifier()] = Prop;
}
for (ObjCInterfaceDecl::all_protocol_iterator
else if (ObjCProtocolDecl *PDecl = dyn_cast<ObjCProtocolDecl>(CDecl)) {
for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
E = PDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
if (!PropMap.count(Prop->getIdentifier()))
PropMap[Prop->getIdentifier()] = Prop;
}
dyn_cast<ObjCInterfaceDecl>(CDecl)) {
for (ObjCContainerDecl::prop_iterator P = IDecl->prop_begin(),
E = IDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
if (Prop->getIdentifier() == II)
return Prop;
}
dyn_cast<ObjCProtocolDecl>(CDecl)) {
for (ObjCProtocolDecl::prop_iterator P = PDecl->prop_begin(),
E = PDecl->prop_end(); P != E; ++P) {
- ObjCPropertyDecl *Prop = (*P);
+ ObjCPropertyDecl *Prop = &*P;
if (Prop->getIdentifier() == II)
return Prop;
}
for (ObjCImplDecl::propimpl_iterator
I = IMPDecl->propimpl_begin(),
EI = IMPDecl->propimpl_end(); I != EI; ++I)
- PropImplMap.insert((*I)->getPropertyDecl());
+ PropImplMap.insert(I->getPropertyDecl());
for (llvm::DenseMap<IdentifierInfo *, ObjCPropertyDecl*>::iterator
P = PropMap.begin(), E = PropMap.end(); P != E; ++P) {
for (ObjCContainerDecl::prop_iterator I = IDecl->prop_begin(),
E = IDecl->prop_end();
I != E; ++I) {
- ObjCPropertyDecl *Property = (*I);
+ ObjCPropertyDecl *Property = &*I;
ObjCMethodDecl *GetterMethod = 0;
ObjCMethodDecl *SetterMethod = 0;
bool LookedUpGetterSetter = false;
for (ObjCImplementationDecl::propimpl_iterator
i = D->propimpl_begin(), e = D->propimpl_end(); i != e; ++i) {
- ObjCPropertyImplDecl *PID = *i;
+ ObjCPropertyImplDecl *PID = &*i;
if (PID->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
continue;
EDI != ED->enumerator_end(); ++EDI) {
llvm::APSInt Val = EDI->getInitVal();
AdjustAPSInt(Val, CondWidth, CondIsSigned);
- EnumVals.push_back(std::make_pair(Val, *EDI));
+ EnumVals.push_back(std::make_pair(Val, &*EDI));
}
std::stable_sort(EnumVals.begin(), EnumVals.end(), CmpEnumVals);
EnumValsTy::iterator EIend =
}
if (EnumConst) {
- SemaRef.InstantiateAttrs(TemplateArgs, *EC, EnumConst);
+ SemaRef.InstantiateAttrs(TemplateArgs, &*EC, EnumConst);
EnumConst->setAccess(Enum->getAccess());
Enum->addDecl(EnumConst);
!Enum->isScoped()) {
// If the enumeration is within a function or method, record the enum
// constant as a local.
- SemaRef.CurrentInstantiationScope->InstantiatedLocal(*EC, EnumConst);
+ SemaRef.CurrentInstantiationScope->InstantiatedLocal(&*EC, EnumConst);
}
}
}
}
for (CXXRecordDecl::field_iterator I = RD->field_begin(),
E = RD->field_end(); I != E; ++I) {
- if (!(*I)->getType()->isLiteralType() ||
- (*I)->getType().isVolatileQualified()) {
- Diag((*I)->getLocation(), diag::note_non_literal_field)
- << RD << (*I) << (*I)->getType()
- << (*I)->getType().isVolatileQualified();
+ if (!I->getType()->isLiteralType() ||
+ I->getType().isVolatileQualified()) {
+ Diag(I->getLocation(), diag::note_non_literal_field)
+ << RD << &*I << I->getType()
+ << I->getType().isVolatileQualified();
return true;
}
}
for (ObjCImplDecl::method_iterator
I = ImplD->meth_begin(), E = ImplD->meth_end(); I != E; ++I)
- Consumer->HandleInterestingDecl(DeclGroupRef(*I));
+ Consumer->HandleInterestingDecl(DeclGroupRef(&*I));
Consumer->HandleInterestingDecl(DeclGroupRef(ImplD));
}
assert(RD && "Referred record has no definition");
for (RecordDecl::field_iterator I =
RD->field_begin(), E = RD->field_end(); I!=E; ++I) {
- const FieldRegion *FR = MrMgr.getFieldRegion(*I, R);
- FieldChain.push_back(*I);
- T = (*I)->getType();
+ const FieldRegion *FR = MrMgr.getFieldRegion(&*I, R);
+ FieldChain.push_back(&*I);
+ T = I->getType();
if (T->getAsStructureType()) {
if (Find(FR))
return true;
for (ObjCInterfaceDecl::ivar_iterator I=ID->ivar_begin(), E=ID->ivar_end();
I!=E; ++I) {
- ObjCIvarDecl *ID = *I;
+ ObjCIvarDecl *ID = &*I;
QualType T = ID->getType();
if (!T->isObjCObjectPointerType() ||
E = D->propimpl_end(); I!=E; ++I) {
// We can only check the synthesized properties
- if ((*I)->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
+ if (I->getPropertyImplementation() != ObjCPropertyImplDecl::Synthesize)
continue;
- ObjCIvarDecl *ID = (*I)->getPropertyIvarDecl();
+ ObjCIvarDecl *ID = I->getPropertyIvarDecl();
if (!ID)
continue;
if (!T->isObjCObjectPointerType()) // Skip non-pointer ivars
continue;
- const ObjCPropertyDecl *PD = (*I)->getPropertyDecl();
+ const ObjCPropertyDecl *PD = I->getPropertyDecl();
if (!PD)
continue;
}
PathDiagnosticLocation SDLoc =
- PathDiagnosticLocation::createBegin((*I), BR.getSourceManager());
+ PathDiagnosticLocation::createBegin(&*I, BR.getSourceManager());
BR.EmitBasicReport(MD, name, categories::CoreFoundationObjectiveC,
os.str(), SDLoc);
for (RecordDecl::field_iterator I = R->field_begin(), E = R->field_end();
I != E; ++I) {
ASTFieldVisitor walker(R, BR);
- walker.Visit(*I);
+ walker.Visit(&*I);
}
}
const RecordDecl *RD = RT->getDecl()->getDefinition();
for (RecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end();
I != E; ++I)
- Visit(*I);
+ Visit(&*I);
}
FieldChain.pop_back();
// to an ivar.
for (ObjCImplementationDecl::propimpl_iterator I = ID->propimpl_begin(),
E = ID->propimpl_end(); I!=E; ++I)
- Scan(M, *I);
+ Scan(M, &*I);
// Scan the associated categories as well.
for (const ObjCCategoryDecl *CD =
for (ObjCInterfaceDecl::ivar_iterator I=ID->ivar_begin(),
E=ID->ivar_end(); I!=E; ++I) {
- const ObjCIvarDecl *ID = *I;
+ const ObjCIvarDecl *ID = &*I;
// Ignore ivars that...
// (a) aren't private
unsigned idx = 0;
for (RecordDecl::field_iterator FI = RD->field_begin(),
FE = RD->field_end(); FI != FE; ++FI, ++idx)
- if (FR->getDecl() == *FI)
+ if (FR->getDecl() == &*FI)
break;
const ASTRecordLayout &Layout = getContext().getASTRecordLayout(RD);
break;
// Skip any unnamed bitfields to stay in sync with the initializers.
- if ((*FI)->isUnnamedBitfield())
+ if (FI->isUnnamedBitfield())
continue;
- QualType FTy = (*FI)->getType();
- const FieldRegion* FR = MRMgr.getFieldRegion(*FI, R);
+ QualType FTy = FI->getType();
+ const FieldRegion* FR = MRMgr.getFieldRegion(&*FI, R);
if (FTy->isArrayType())
newStore = BindArray(newStore.getStore(), FR, *VI);
bool leftFirst = (op == BO_LT || op == BO_LE);
for (RecordDecl::field_iterator I = RD->field_begin(),
E = RD->field_end(); I!=E; ++I) {
- if (*I == LeftFD)
+ if (&*I == LeftFD)
return makeTruthVal(leftFirst, resultTy);
- if (*I == RightFD)
+ if (&*I == RightFD)
return makeTruthVal(!leftFirst, resultTy);
}