diff options
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 59 |
1 files changed, 29 insertions, 30 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 1172d3e01b5..f7c0ada6df2 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -680,7 +680,7 @@ Sema::ActOnMemInitializer(DeclPtrTy ConstructorD, // Look for a member, first. FieldDecl *Member = 0; DeclContext::lookup_result Result - = ClassDecl->lookup(Context, MemberOrBase); + = ClassDecl->lookup(MemberOrBase); if (Result.first != Result.second) Member = dyn_cast<FieldDecl>(*Result.first); @@ -847,8 +847,7 @@ namespace { MethodSetTy OverriddenMethods; size_t MethodsSize = Methods.size(); - for (RecordDecl::decl_iterator i = RD->decls_begin(Context), - e = RD->decls_end(Context); + for (RecordDecl::decl_iterator i = RD->decls_begin(), e = RD->decls_end(); i != e; ++i) { // Traverse the record, looking for methods. if (CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(*i)) { @@ -945,8 +944,8 @@ namespace { bool VisitDeclContext(const DeclContext *DC) { bool Invalid = false; - for (CXXRecordDecl::decl_iterator I = DC->decls_begin(SemaRef.Context), - E = DC->decls_end(SemaRef.Context); I != E; ++I) + for (CXXRecordDecl::decl_iterator I = DC->decls_begin(), + E = DC->decls_end(); I != E; ++I) Invalid |= Visit(*I); return Invalid; @@ -1022,8 +1021,8 @@ void Sema::ActOnFinishCXXMemberSpecification(Scope* S, SourceLocation RLoc, AbstractClassUsageDiagnoser(*this, RD); if (RD->hasTrivialConstructor() || RD->hasTrivialDestructor()) { - for (RecordDecl::field_iterator i = RD->field_begin(Context), - e = RD->field_end(Context); i != e; ++i) { + for (RecordDecl::field_iterator i = RD->field_begin(), e = RD->field_end(); + i != e; ++i) { // All the nonstatic data members must have trivial constructors. QualType FTy = i->getType(); while (const ArrayType *AT = Context.getAsArrayType(FTy)) @@ -1080,7 +1079,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { /*isImplicitlyDeclared=*/true); DefaultCon->setAccess(AS_public); DefaultCon->setImplicit(); - ClassDecl->addDecl(Context, DefaultCon); + ClassDecl->addDecl(DefaultCon); } if (!ClassDecl->hasUserDeclaredCopyConstructor()) { @@ -1112,8 +1111,8 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { // class type M (or array thereof), each such class type // has a copy constructor whose first parameter is of type // const M& or const volatile M&. - for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context); - HasConstCopyConstructor && Field != ClassDecl->field_end(Context); + for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(); + HasConstCopyConstructor && Field != ClassDecl->field_end(); ++Field) { QualType FieldType = (*Field)->getType(); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) @@ -1157,7 +1156,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { /*IdentifierInfo=*/0, ArgType, VarDecl::None, 0); CopyConstructor->setParams(Context, &FromParam, 1); - ClassDecl->addDecl(Context, CopyConstructor); + ClassDecl->addDecl(CopyConstructor); } if (!ClassDecl->hasUserDeclaredCopyAssignment()) { @@ -1191,8 +1190,8 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { // type M (or array thereof), each such class type has a copy // assignment operator whose parameter is of type const M&, // const volatile M& or M. - for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context); - HasConstCopyAssignment && Field != ClassDecl->field_end(Context); + for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(); + HasConstCopyAssignment && Field != ClassDecl->field_end(); ++Field) { QualType FieldType = (*Field)->getType(); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) @@ -1236,7 +1235,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { // Don't call addedAssignmentOperator. There is no way to distinguish an // implicit from an explicit assignment operator. - ClassDecl->addDecl(Context, CopyAssignment); + ClassDecl->addDecl(CopyAssignment); } if (!ClassDecl->hasUserDeclaredDestructor()) { @@ -1255,7 +1254,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { /*isImplicitlyDeclared=*/true); Destructor->setAccess(AS_public); Destructor->setImplicit(); - ClassDecl->addDecl(Context, Destructor); + ClassDecl->addDecl(Destructor); } } @@ -1798,7 +1797,7 @@ void Sema::PushUsingDirective(Scope *S, UsingDirectiveDecl *UDir) { // or translation unit scope. We add UsingDirectiveDecls, into // it's lookup structure. if (DeclContext *Ctx = static_cast<DeclContext*>(S->getEntity())) - Ctx->addDecl(Context, UDir); + Ctx->addDecl(UDir); else // Otherwise it is block-sope. using-directives will affect lookup // only to the end of scope. @@ -1899,7 +1898,7 @@ Sema::DeclPtrTy Sema::ActOnNamespaceAliasDef(Scope *S, (NestedNameSpecifier *)SS.getScopeRep(), IdentLoc, R); - CurContext->addDecl(Context, AliasDecl); + CurContext->addDecl(AliasDecl); return DeclPtrTy::make(AliasDecl); } @@ -1935,8 +1934,8 @@ void Sema::DefineImplicitDefaultConstructor(SourceLocation CurrentLocation, } } } - for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context); - Field != ClassDecl->field_end(Context); + for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(); + Field != ClassDecl->field_end(); ++Field) { QualType FieldType = Context.getCanonicalType((*Field)->getType()); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) @@ -2004,8 +2003,8 @@ void Sema::DefineImplicitDestructor(SourceLocation CurrentLocation, } } - for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context); - Field != ClassDecl->field_end(Context); + for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(); + Field != ClassDecl->field_end(); ++Field) { QualType FieldType = Context.getCanonicalType((*Field)->getType()); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) @@ -2052,8 +2051,8 @@ void Sema::DefineImplicitOverloadedAssign(SourceLocation CurrentLocation, getAssignOperatorMethod(MethodDecl->getParamDecl(0), BaseClassDecl)) MarkDeclarationReferenced(CurrentLocation, BaseAssignOpMethod); } - for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context); - Field != ClassDecl->field_end(Context); + for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(); + Field != ClassDecl->field_end(); ++Field) { QualType FieldType = Context.getCanonicalType((*Field)->getType()); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) @@ -2139,9 +2138,9 @@ void Sema::DefineImplicitCopyConstructor(SourceLocation CurrentLocation, BaseClassDecl->getCopyConstructor(Context, TypeQuals)) MarkDeclarationReferenced(CurrentLocation, BaseCopyCtor); } - for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(Context); - Field != ClassDecl->field_end(Context); - ++Field) { + for (CXXRecordDecl::field_iterator Field = ClassDecl->field_begin(), + FieldEnd = ClassDecl->field_end(); + Field != FieldEnd; ++Field) { QualType FieldType = Context.getCanonicalType((*Field)->getType()); if (const ArrayType *Array = Context.getAsArrayType(FieldType)) FieldType = Array->getElementType(); @@ -2308,7 +2307,7 @@ Sema::PerformInitializationByConstructor(QualType ClassType, = Context.DeclarationNames.getCXXConstructorName( Context.getCanonicalType(ClassType.getUnqualifiedType())); DeclContext::lookup_const_iterator Con, ConEnd; - for (llvm::tie(Con, ConEnd) = ClassDecl->lookup(Context, ConstructorName); + for (llvm::tie(Con, ConEnd) = ClassDecl->lookup(ConstructorName); Con != ConEnd; ++Con) { CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con); if ((Kind == IK_Direct) || @@ -2918,7 +2917,7 @@ Sema::DeclPtrTy Sema::ActOnStartLinkageSpecification(Scope *S, LinkageSpecDecl *D = LinkageSpecDecl::Create(Context, CurContext, LangLoc, Language, LBraceLoc.isValid()); - CurContext->addDecl(Context, D); + CurContext->addDecl(D); PushDeclContext(S, D); return DeclPtrTy::make(D); } @@ -3032,7 +3031,7 @@ Sema::DeclPtrTy Sema::ActOnExceptionDeclarator(Scope *S, Declarator &D) { if (II) PushOnScopeChains(ExDecl, S); else - CurContext->addDecl(Context, ExDecl); + CurContext->addDecl(ExDecl); ProcessDeclAttributes(S, ExDecl, D); return DeclPtrTy::make(ExDecl); @@ -3066,7 +3065,7 @@ Sema::DeclPtrTy Sema::ActOnStaticAssertDeclaration(SourceLocation AssertLoc, Decl *Decl = StaticAssertDecl::Create(Context, CurContext, AssertLoc, AssertExpr, AssertMessage); - CurContext->addDecl(Context, Decl); + CurContext->addDecl(Decl); return DeclPtrTy::make(Decl); } |