From 7d10f0803fe5d45a0dc9230049d5f3be46fbdf14 Mon Sep 17 00:00:00 2001 From: Bruno Ricci Date: Fri, 21 Dec 2018 14:10:18 +0000 Subject: [AST][NFC] Pass the AST context to one of the ctor of DeclRefExpr. All of the other constructors already take a reference to the AST context. This avoids calling Decl::getASTContext in most cases. Additionally move the definition of the constructor from Expr.h to Expr.cpp since it is calling DeclRefExpr::computeDependence. NFC. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@349901 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Sema/SemaObjCProperty.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/Sema/SemaObjCProperty.cpp') diff --git a/lib/Sema/SemaObjCProperty.cpp b/lib/Sema/SemaObjCProperty.cpp index d000027972..9412d01600 100644 --- a/lib/Sema/SemaObjCProperty.cpp +++ b/lib/Sema/SemaObjCProperty.cpp @@ -1412,9 +1412,9 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, // FIXME. Eventually we want to do this for Objective-C as well. SynthesizedFunctionScope Scope(*this, getterMethod); ImplicitParamDecl *SelfDecl = getterMethod->getSelfDecl(); - DeclRefExpr *SelfExpr = - new (Context) DeclRefExpr(SelfDecl, false, SelfDecl->getType(), - VK_LValue, PropertyDiagLoc); + DeclRefExpr *SelfExpr = new (Context) + DeclRefExpr(Context, SelfDecl, false, SelfDecl->getType(), VK_LValue, + PropertyDiagLoc); MarkDeclRefReferenced(SelfExpr); Expr *LoadSelfExpr = ImplicitCastExpr::Create(Context, SelfDecl->getType(), @@ -1464,9 +1464,9 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, // FIXME. Eventually we want to do this for Objective-C as well. SynthesizedFunctionScope Scope(*this, setterMethod); ImplicitParamDecl *SelfDecl = setterMethod->getSelfDecl(); - DeclRefExpr *SelfExpr = - new (Context) DeclRefExpr(SelfDecl, false, SelfDecl->getType(), - VK_LValue, PropertyDiagLoc); + DeclRefExpr *SelfExpr = new (Context) + DeclRefExpr(Context, SelfDecl, false, SelfDecl->getType(), VK_LValue, + PropertyDiagLoc); MarkDeclRefReferenced(SelfExpr); Expr *LoadSelfExpr = ImplicitCastExpr::Create(Context, SelfDecl->getType(), @@ -1481,8 +1481,8 @@ Decl *Sema::ActOnPropertyImplDecl(Scope *S, ObjCMethodDecl::param_iterator P = setterMethod->param_begin(); ParmVarDecl *Param = (*P); QualType T = Param->getType().getNonReferenceType(); - DeclRefExpr *rhs = new (Context) DeclRefExpr(Param, false, T, - VK_LValue, PropertyDiagLoc); + DeclRefExpr *rhs = new (Context) + DeclRefExpr(Context, Param, false, T, VK_LValue, PropertyDiagLoc); MarkDeclRefReferenced(rhs); ExprResult Res = BuildBinOp(S, PropertyDiagLoc, BO_Assign, lhs, rhs); -- cgit v1.2.1