diff options
Diffstat (limited to 'lib/Sema')
-rw-r--r-- | lib/Sema/IdentifierResolver.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaCodeComplete.cpp | 24 | ||||
-rw-r--r-- | lib/Sema/SemaDecl.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 26 | ||||
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 12 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 6 | ||||
-rw-r--r-- | lib/Sema/SemaInit.cpp | 44 | ||||
-rw-r--r-- | lib/Sema/SemaLambda.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaLookup.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaObjCProperty.cpp | 30 | ||||
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 2 | ||||
-rw-r--r-- | lib/Sema/SemaTemplateInstantiateDecl.cpp | 4 | ||||
-rw-r--r-- | lib/Sema/SemaType.cpp | 2 |
14 files changed, 82 insertions, 82 deletions
diff --git a/lib/Sema/IdentifierResolver.cpp b/lib/Sema/IdentifierResolver.cpp index 4c6898cb7a..4d62cab167 100644 --- a/lib/Sema/IdentifierResolver.cpp +++ b/lib/Sema/IdentifierResolver.cpp @@ -304,7 +304,7 @@ static DeclMatchKind compareDeclarations(NamedDecl *Existing, NamedDecl *New) { for (Decl::redecl_iterator RD = New->redecls_begin(), RDEnd = New->redecls_end(); RD != RDEnd; ++RD) { - if (RD == Existing) + if (*RD == Existing) return DMK_Replace; if (RD->isCanonicalDecl()) diff --git a/lib/Sema/SemaCodeComplete.cpp b/lib/Sema/SemaCodeComplete.cpp index 24f536fa06..50d3f30549 100644 --- a/lib/Sema/SemaCodeComplete.cpp +++ b/lib/Sema/SemaCodeComplete.cpp @@ -3348,7 +3348,7 @@ static void AddObjCProperties(ObjCContainerDecl *Container, P != PEnd; ++P) { if (AddedProperties.insert(P->getIdentifier())) - Results.MaybeAddResult(Result(&*P, 0), CurContext); + Results.MaybeAddResult(Result(*P, 0), CurContext); } // Add nullary methods @@ -3363,11 +3363,11 @@ static void AddObjCProperties(ObjCContainerDecl *Container, 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); } @@ -3672,10 +3672,10 @@ void Sema::CodeCompleteCase(Scope *S) { 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); } @@ -4037,7 +4037,7 @@ void Sema::CodeCompleteNamespaceDecl(Scope *S) { 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. @@ -4193,7 +4193,7 @@ void Sema::CodeCompleteConstructorInitializer(Decl *ConstructorD, SawLastInitializer = NumInitializers > 0 && Initializers[NumInitializers - 1]->isAnyMemberInitializer() && - Initializers[NumInitializers - 1]->getAnyMember() == &*Field; + Initializers[NumInitializers - 1]->getAnyMember() == *Field; continue; } @@ -4210,7 +4210,7 @@ void Sema::CodeCompleteConstructorInitializer(Decl *ConstructorD, : CCP_MemberDeclaration, CXCursor_MemberRef, CXAvailability_Available, - &*Field)); + *Field)); SawLastInitializer = false; } Results.ExitScope(); @@ -4701,14 +4701,14 @@ static void AddObjCMethods(ObjCContainerDecl *Container, 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())) continue; - Result R = Result(&*M, 0); + Result R = Result(*M, 0); R.StartParameter = NumSelIdents; R.AllParametersAreInformative = (WantKind != MK_Any); if (!InOriginalClass) @@ -6026,7 +6026,7 @@ static void FindImplementableMethods(ASTContext &Context, !Context.hasSameUnqualifiedType(ReturnType, M->getResultType())) continue; - KnownMethods[M->getSelector()] = std::make_pair(&*M, InOriginalClass); + KnownMethods[M->getSelector()] = std::make_pair(*M, InOriginalClass); } } } @@ -6842,7 +6842,7 @@ void Sema::CodeCompleteObjCMethodDecl(Scope *S, 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); } } diff --git a/lib/Sema/SemaDecl.cpp b/lib/Sema/SemaDecl.cpp index ec1f460f53..8d4ce2873b 100644 --- a/lib/Sema/SemaDecl.cpp +++ b/lib/Sema/SemaDecl.cpp @@ -7443,7 +7443,7 @@ Decl *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Decl *D) { 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); } } } @@ -9271,7 +9271,7 @@ void Sema::DiagnoseNontrivial(const RecordType* T, CXXSpecialMember member) { 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. diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index 0f95747a71..19ac6160c5 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -2835,7 +2835,7 @@ static void handleTransparentUnionAttr(Sema &S, Decl *D, return; } - FieldDecl *FirstField = &*Field; + FieldDecl *FirstField = *Field; QualType FirstType = FirstField->getType(); if (FirstType->hasFloatingRepresentation() || FirstType->isVectorType()) { S.Diag(FirstField->getLocation(), diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index e7a22165da..2b7d1bfcd8 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -833,8 +833,8 @@ static void CheckConstexprCtorInitializer(Sema &SemaRef, 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); } } @@ -943,7 +943,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { 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; } @@ -3150,7 +3150,7 @@ DiagnoseBaseOrMemInitializerOrder(Sema &SemaRef, if (Field->isUnnamedBitfield()) continue; - IdealInitKeys.push_back(GetKeyForTopLevelField(&*Field)); + IdealInitKeys.push_back(GetKeyForTopLevelField(*Field)); } unsigned NumIdealInits = IdealInitKeys.size(); @@ -3350,7 +3350,7 @@ Sema::MarkBaseAndMemberDestructorsReferenced(SourceLocation Location, // 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; @@ -3807,7 +3807,7 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) { MEnd = Record->method_end(); M != MEnd; ++M) { if (!M->isStatic()) - DiagnoseHiddenVirtualMethods(Record, &*M); + DiagnoseHiddenVirtualMethods(Record, *M); } } @@ -3865,7 +3865,7 @@ void Sema::CheckExplicitlyDefaultedMethods(CXXRecordDecl *Record) { ME = Record->method_end(); MI != ME; ++MI) if (!MI->isInvalidDecl() && MI->isExplicitlyDefaulted()) - CheckExplicitlyDefaultedSpecialMember(&*MI); + CheckExplicitlyDefaultedSpecialMember(*MI); } void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { @@ -4327,7 +4327,7 @@ bool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) { CXXRecordDecl *UnionFieldRecord = UnionFieldType->getAsCXXRecordDecl(); if (UnionFieldRecord && - shouldDeleteForClassSubobject(UnionFieldRecord, &*UI)) + shouldDeleteForClassSubobject(UnionFieldRecord, *UI)) return true; } @@ -4464,7 +4464,7 @@ bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, 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()) @@ -6816,7 +6816,7 @@ void Sema::DeclareInheritedConstructors(CXXRecordDecl *ClassDecl) { // 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>(); @@ -7647,7 +7647,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, 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, @@ -8182,7 +8182,7 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation, 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, @@ -10667,7 +10667,7 @@ void Sema::MarkVirtualMembersReferenced(SourceLocation Loc, 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. [...] diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 3bcc8ce650..33047b2e5e 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -695,7 +695,7 @@ void Sema::DiagnoseClassExtensionDupMethods(ObjCCategoryDecl *CAT, 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; } @@ -703,7 +703,7 @@ void Sema::DiagnoseClassExtensionDupMethods(ObjCCategoryDecl *CAT, 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) @@ -1065,7 +1065,7 @@ void Sema::CheckImplementationIvars(ObjCImplementationDecl *ImpDecl, 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"); @@ -2154,7 +2154,7 @@ void Sema::DiagnoseDuplicateIvars(ObjCInterfaceDecl *ID, 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()) { @@ -2292,7 +2292,7 @@ Decl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, 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)) { @@ -2308,7 +2308,7 @@ Decl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, 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())) diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index 17ea7705af..9f0378ac0e 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -5706,7 +5706,7 @@ Sema::CheckTransparentUnionArgumentConstraints(QualType ArgType, if (RHSType->isPointerType()) if (RHSType->castAs<PointerType>()->getPointeeType()->isVoidType()) { RHS = ImpCastExprToType(RHS.take(), it->getType(), CK_BitCast); - InitField = &*it; + InitField = *it; break; } @@ -5714,7 +5714,7 @@ Sema::CheckTransparentUnionArgumentConstraints(QualType ArgType, Expr::NPC_ValueDependentIsNull)) { RHS = ImpCastExprToType(RHS.take(), it->getType(), CK_NullToPointer); - InitField = &*it; + InitField = *it; break; } } @@ -5723,7 +5723,7 @@ Sema::CheckTransparentUnionArgumentConstraints(QualType ArgType, if (CheckAssignmentConstraints(it->getType(), RHS, Kind) == Compatible) { RHS = ImpCastExprToType(RHS.take(), it->getType(), Kind); - InitField = &*it; + InitField = *it; break; } } diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp index 66a64a9e5c..ae75b268fe 100644 --- a/lib/Sema/SemaInit.cpp +++ b/lib/Sema/SemaInit.cpp @@ -375,7 +375,7 @@ InitListChecker::FillInValueInitializations(const InitializedEntity &Entity, if (hadError) return; - FillInValueInitForField(Init, &*Field, Entity, ILE, RequiresSecondPass); + FillInValueInitForField(Init, *Field, Entity, ILE, RequiresSecondPass); if (hadError) return; @@ -1336,9 +1336,9 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, if (Field->getDeclName()) { if (VerifyOnly) CheckValueInitializable( - InitializedEntity::InitializeMember(&*Field, &Entity)); + InitializedEntity::InitializeMember(*Field, &Entity)); else - StructuredList->setInitializedFieldInUnion(&*Field); + StructuredList->setInitializedFieldInUnion(*Field); break; } } @@ -1401,9 +1401,9 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, // 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; @@ -1413,14 +1413,14 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, } 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; @@ -1449,7 +1449,7 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, for (; Field != FieldEnd && !hadError; ++Field) { if (!Field->isUnnamedBitfield()) CheckValueInitializable( - InitializedEntity::InitializeMember(&*Field, &Entity)); + InitializedEntity::InitializeMember(*Field, &Entity)); } } @@ -1457,7 +1457,7 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, Index >= IList->getNumInits()) return; - if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), &*Field, + if (CheckFlexibleArrayInit(Entity, IList->getInit(Index), *Field, TopLevelObject)) { hadError = true; ++Index; @@ -1465,7 +1465,7 @@ void InitListChecker::CheckStructUnionTypes(const InitializedEntity &Entity, } InitializedEntity MemberEntity = - InitializedEntity::InitializeMember(&*Field, &Entity); + InitializedEntity::InitializeMember(*Field, &Entity); if (isa<InitListExpr>(IList->getInit(Index))) CheckSubElementType(MemberEntity, IList, Field->getType(), Index, @@ -1679,7 +1679,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, // 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); @@ -1688,7 +1688,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, break; } } - if (KnownField && KnownField == &*Field) + if (KnownField && KnownField == *Field) break; if (FieldName && FieldName == Field->getIdentifier()) break; @@ -1757,7 +1757,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, if (Field->isUnnamedBitfield()) continue; - if (ReplacementField == &*Field || + if (ReplacementField == *Field || Field->getIdentifier() == ReplacementField->getIdentifier()) break; @@ -1771,15 +1771,15 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, 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; @@ -1787,7 +1787,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, 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. @@ -1809,7 +1809,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, << SourceRange(NextD->getStartLocation(), DIE->getSourceRange().getEnd()); SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) - << &*Field; + << *Field; } Invalid = true; } @@ -1822,13 +1822,13 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, 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; @@ -1844,7 +1844,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, IList->setInit(Index, DIE->getInit()); InitializedEntity MemberEntity = - InitializedEntity::InitializeMember(&*Field, &Entity); + InitializedEntity::InitializeMember(*Field, &Entity); CheckSubElementType(MemberEntity, IList, Field->getType(), Index, StructuredList, newStructuredIndex); @@ -1863,7 +1863,7 @@ InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, 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, diff --git a/lib/Sema/SemaLambda.cpp b/lib/Sema/SemaLambda.cpp index 51a44a9542..f64be51744 100644 --- a/lib/Sema/SemaLambda.cpp +++ b/lib/Sema/SemaLambda.cpp @@ -444,7 +444,7 @@ void Sema::ActOnLambdaError(SourceLocation StartLoc, Scope *CurScope, SmallVector<Decl*, 4> Fields; for (RecordDecl::field_iterator i = Class->field_begin(), e = Class->field_end(); i != e; ++i) - Fields.push_back(&*i); + Fields.push_back(*i); ActOnFields(0, Class->getLocation(), Class, Fields, SourceLocation(), SourceLocation(), 0); CheckCompletedCXXClass(Class); @@ -690,7 +690,7 @@ ExprResult Sema::ActOnLambdaExpr(SourceLocation StartLoc, Stmt *Body, SmallVector<Decl*, 4> Fields; for (RecordDecl::field_iterator i = Class->field_begin(), e = Class->field_end(); i != e; ++i) - Fields.push_back(&*i); + Fields.push_back(*i); ActOnFields(0, Class->getLocation(), Class, Fields, SourceLocation(), SourceLocation(), 0); CheckCompletedCXXClass(Class); diff --git a/lib/Sema/SemaLookup.cpp b/lib/Sema/SemaLookup.cpp index 563b97f148..1ee594c2a3 100644 --- a/lib/Sema/SemaLookup.cpp +++ b/lib/Sema/SemaLookup.cpp @@ -1069,7 +1069,7 @@ static NamedDecl *getVisibleDecl(NamedDecl *D) { for (Decl::redecl_iterator RD = D->redecls_begin(), RDEnd = D->redecls_end(); RD != RDEnd; ++RD) { - if (NamedDecl *ND = dyn_cast<NamedDecl>(RD)) { + if (NamedDecl *ND = dyn_cast<NamedDecl>(*RD)) { if (LookupResult::isVisible(ND)) return ND; } diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index fb49e9f50c..52859d4f6d 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1154,11 +1154,11 @@ void Sema::ComparePropertiesInBaseAndSuper(ObjCInterfaceDecl *IDecl) { // 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()); @@ -1180,7 +1180,7 @@ Sema::MatchOneProtocolPropertiesInClass(Decl *CDecl, 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) @@ -1188,13 +1188,13 @@ Sema::MatchOneProtocolPropertiesInClass(Decl *CDecl, 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) @@ -1202,7 +1202,7 @@ Sema::MatchOneProtocolPropertiesInClass(Decl *CDecl, break; if (CP != CE) // Property protocol already exist in class. Diagnose any mismatch. - DiagnosePropertyMismatch(&*CP, Pr, PDecl->getIdentifier()); + DiagnosePropertyMismatch(*CP, Pr, PDecl->getIdentifier()); } } @@ -1318,7 +1318,7 @@ void Sema::CollectImmediateProperties(ObjCContainerDecl *CDecl, 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. @@ -1331,7 +1331,7 @@ void Sema::CollectImmediateProperties(ObjCContainerDecl *CDecl, 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. @@ -1342,7 +1342,7 @@ void Sema::CollectImmediateProperties(ObjCContainerDecl *CDecl, 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. @@ -1368,7 +1368,7 @@ static void CollectClassPropertyImplementations(ObjCContainerDecl *CDecl, 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 @@ -1379,7 +1379,7 @@ static void CollectClassPropertyImplementations(ObjCContainerDecl *CDecl, 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; } @@ -1411,7 +1411,7 @@ ObjCPropertyDecl *Sema::LookupPropertyDecl(const ObjCContainerDecl *CDecl, 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; } @@ -1428,7 +1428,7 @@ ObjCPropertyDecl *Sema::LookupPropertyDecl(const ObjCContainerDecl *CDecl, 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; } @@ -1587,7 +1587,7 @@ Sema::AtomicPropertySetterGetterRules (ObjCImplDecl* IMPDecl, 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; @@ -1674,7 +1674,7 @@ void Sema::DiagnoseOwningPropertyGetterSynthesis(const ObjCImplementationDecl *D 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; diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 028636b90b..20b0d2f166 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -947,7 +947,7 @@ Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, 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 = diff --git a/lib/Sema/SemaTemplateInstantiateDecl.cpp b/lib/Sema/SemaTemplateInstantiateDecl.cpp index e79c8916b4..9ff6a490d6 100644 --- a/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -672,7 +672,7 @@ void TemplateDeclInstantiator::InstantiateEnumDefinition( } if (EnumConst) { - SemaRef.InstantiateAttrs(TemplateArgs, &*EC, EnumConst); + SemaRef.InstantiateAttrs(TemplateArgs, *EC, EnumConst); EnumConst->setAccess(Enum->getAccess()); Enum->addDecl(EnumConst); @@ -683,7 +683,7 @@ void TemplateDeclInstantiator::InstantiateEnumDefinition( !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); } } } diff --git a/lib/Sema/SemaType.cpp b/lib/Sema/SemaType.cpp index 20526bac39..209c020fff 100644 --- a/lib/Sema/SemaType.cpp +++ b/lib/Sema/SemaType.cpp @@ -4362,7 +4362,7 @@ bool Sema::RequireLiteralType(SourceLocation Loc, QualType T, if (!I->getType()->isLiteralType() || I->getType().isVolatileQualified()) { |