diff options
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 19 | ||||
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 11 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExpr.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 2 | ||||
-rw-r--r-- | clang/lib/Sema/SemaTemplate.cpp | 3 | ||||
-rw-r--r-- | clang/lib/Sema/SemaTemplateInstantiateDecl.cpp | 10 |
6 files changed, 21 insertions, 26 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 82fd4379f66..d7ca5ab6ccd 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -698,7 +698,7 @@ NamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned bid, Params.push_back(ParmVarDecl::Create(Context, New, SourceLocation(), 0, FT->getArgType(i), /*TInfo=*/0, VarDecl::None, 0)); - New->setParams(Context, Params.data(), Params.size()); + New->setParams(Params.data(), Params.size()); } AddKnownFunctionAttributes(New); @@ -1107,7 +1107,7 @@ bool Sema::MergeFunctionDecl(FunctionDecl *New, Decl *OldD) { Params.push_back(Param); } - New->setParams(Context, Params.data(), Params.size()); + New->setParams(Params.data(), Params.size()); } return MergeCompatibleFunctionDecls(New, Old); @@ -2970,7 +2970,7 @@ Sema::ActOnFunctionDeclarator(Scope* S, Declarator& D, DeclContext* DC, "Should not need args for typedef of non-prototype fn"); } // Finally, we know we have the right number of parameters, install them. - NewFD->setParams(Context, Params.data(), Params.size()); + NewFD->setParams(Params.data(), Params.size()); // If the declarator is a template-id, translate the parser's template // argument list into our AST format. @@ -3561,7 +3561,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) { // }; // Attach the initializer - VDecl->setInit(Context, Init); + VDecl->setInit(Init); // C++ [class.mem]p4: // A member-declarator can contain a constant-initializer only @@ -3633,7 +3633,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) { Init = MaybeCreateCXXExprWithTemporaries(Init); // Attach the initializer to the decl. - VDecl->setInit(Context, Init); + VDecl->setInit(Init); if (getLangOptions().CPlusPlus) { // Make sure we mark the destructor as used if necessary. @@ -3785,8 +3785,7 @@ void Sema::ActOnUninitializedDecl(DeclPtrTy dcl, Var->setInvalidDecl(); else { if (Init.get()) - Var->setInit(Context, - MaybeCreateCXXExprWithTemporaries(Init.takeAs<Expr>())); + Var->setInit(MaybeCreateCXXExprWithTemporaries(Init.takeAs<Expr>())); if (getLangOptions().CPlusPlus) if (const RecordType *Record @@ -5611,7 +5610,7 @@ void Sema::ActOnFields(Scope* S, // Okay, we successfully defined 'Record'. if (Record) { - Record->completeDefinition(Context); + Record->completeDefinition(); } else { ObjCIvarDecl **ClsFields = reinterpret_cast<ObjCIvarDecl**>(RecFields.data()); @@ -5897,7 +5896,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc, ECD->setType(EnumType); } - Enum->completeDefinition(Context, Context.DependentTy, Context.DependentTy); + Enum->completeDefinition(Context.DependentTy, Context.DependentTy); return; } @@ -6077,7 +6076,7 @@ void Sema::ActOnEnumBody(SourceLocation EnumLoc, SourceLocation LBraceLoc, ECD->setType(NewTy); } - Enum->completeDefinition(Context, BestType, BestPromotionType); + Enum->completeDefinition(BestType, BestPromotionType); } Sema::DeclPtrTy Sema::ActOnFileScopeAsmDecl(SourceLocation Loc, diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 2653633a952..0c0846071a8 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -2263,7 +2263,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { /*IdentifierInfo=*/0, ArgType, /*TInfo=*/0, VarDecl::None, 0); - CopyConstructor->setParams(Context, &FromParam, 1); + CopyConstructor->setParams(&FromParam, 1); ClassDecl->addDecl(CopyConstructor); } @@ -2347,7 +2347,7 @@ void Sema::AddImplicitlyDeclaredMembersToClass(CXXRecordDecl *ClassDecl) { /*IdentifierInfo=*/0, ArgType, /*TInfo=*/0, VarDecl::None, 0); - CopyAssignment->setParams(Context, &FromParam, 1); + CopyAssignment->setParams(&FromParam, 1); // Don't call addedAssignmentOperator. There is no way to distinguish an // implicit from an explicit assignment operator. @@ -3991,7 +3991,7 @@ bool Sema::InitializeVarWithConstructor(VarDecl *VD, Expr *Temp = TempResult.takeAs<Expr>(); MarkDeclarationReferenced(VD->getLocation(), Constructor); Temp = MaybeCreateCXXExprWithTemporaries(Temp); - VD->setInit(Context, Temp); + VD->setInit(Temp); return false; } @@ -4048,8 +4048,7 @@ void Sema::AddCXXDirectInitializerToDecl(DeclPtrTy Dcl, // Store the initialization expressions as a ParenListExpr. unsigned NumExprs = Exprs.size(); - VDecl->setInit(Context, - new (Context) ParenListExpr(Context, LParenLoc, + VDecl->setInit(new (Context) ParenListExpr(Context, LParenLoc, (Expr **)Exprs.release(), NumExprs, RParenLoc)); return; @@ -4103,7 +4102,7 @@ void Sema::AddCXXDirectInitializerToDecl(DeclPtrTy Dcl, } Result = MaybeCreateCXXExprWithTemporaries(move(Result)); - VDecl->setInit(Context, Result.takeAs<Expr>()); + VDecl->setInit(Result.takeAs<Expr>()); VDecl->setCXXDirectInitializer(true); if (const RecordType *Record = VDecl->getType()->getAs<RecordType>()) diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp index 6f5269a2517..22856433f30 100644 --- a/clang/lib/Sema/SemaExpr.cpp +++ b/clang/lib/Sema/SemaExpr.cpp @@ -6835,7 +6835,7 @@ void Sema::ActOnBlockArguments(Declarator &ParamInfo, Scope *CurScope) { CurBlock->Params.push_back(FTI.ArgInfo[i].Param.getAs<ParmVarDecl>()); CurBlock->isVariadic = FTI.isVariadic; } - CurBlock->TheDecl->setParams(Context, CurBlock->Params.data(), + CurBlock->TheDecl->setParams(CurBlock->Params.data(), CurBlock->Params.size()); CurBlock->TheDecl->setIsVariadic(CurBlock->isVariadic); ProcessDeclAttributes(CurScope, CurBlock->TheDecl, ParamInfo); diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index e27308a2b43..877ac2a5495 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -811,7 +811,7 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, ParmVarDecl *Param = ParmVarDecl::Create(Context, Alloc, SourceLocation(), 0, Argument, /*TInfo=*/0, VarDecl::None, 0); - Alloc->setParams(Context, &Param, 1); + Alloc->setParams(&Param, 1); // FIXME: Also add this declaration to the IdentifierResolver, but // make sure it is at the end of the chain to coincide with the diff --git a/clang/lib/Sema/SemaTemplate.cpp b/clang/lib/Sema/SemaTemplate.cpp index 83bc6f39b85..63cf4aef375 100644 --- a/clang/lib/Sema/SemaTemplate.cpp +++ b/clang/lib/Sema/SemaTemplate.cpp @@ -3941,8 +3941,7 @@ Sema::CheckFunctionTemplateSpecialization(FunctionDecl *FD, // Turn the given function declaration into a function template // specialization, with the template arguments from the previous // specialization. - FD->setFunctionTemplateSpecialization(Context, - Specialization->getPrimaryTemplate(), + FD->setFunctionTemplateSpecialization(Specialization->getPrimaryTemplate(), new (Context) TemplateArgumentList( *Specialization->getTemplateSpecializationArgs()), /*InsertPos=*/0, diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp index 08cb6819600..caeea584706 100644 --- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp +++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp @@ -768,7 +768,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, // Attach the parameters for (unsigned P = 0; P < Params.size(); ++P) Params[P]->setOwningFunction(Function); - Function->setParams(SemaRef.Context, Params.data(), Params.size()); + Function->setParams(Params.data(), Params.size()); if (TemplateParams) { // Our resulting instantiation is actually a function template, since we @@ -793,8 +793,7 @@ Decl *TemplateDeclInstantiator::VisitFunctionDecl(FunctionDecl *D, FunctionTemplate->setLexicalDeclContext(D->getLexicalDeclContext()); } else if (FunctionTemplate) { // Record this function template specialization. - Function->setFunctionTemplateSpecialization(SemaRef.Context, - FunctionTemplate, + Function->setFunctionTemplateSpecialization(FunctionTemplate, &TemplateArgs.getInnermost(), InsertPos); } @@ -947,8 +946,7 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, Method->setDescribedFunctionTemplate(FunctionTemplate); } else if (FunctionTemplate) { // Record this function template specialization. - Method->setFunctionTemplateSpecialization(SemaRef.Context, - FunctionTemplate, + Method->setFunctionTemplateSpecialization(FunctionTemplate, &TemplateArgs.getInnermost(), InsertPos); } else { @@ -965,7 +963,7 @@ TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D, // Attach the parameters for (unsigned P = 0; P < Params.size(); ++P) Params[P]->setOwningFunction(Method); - Method->setParams(SemaRef.Context, Params.data(), Params.size()); + Method->setParams(Params.data(), Params.size()); if (InitMethodInstantiation(Method, D)) Method->setInvalidDecl(); |