diff options
author | Bruno Ricci <riccibrun@gmail.com> | 2018-12-21 14:10:18 +0000 |
---|---|---|
committer | Bruno Ricci <riccibrun@gmail.com> | 2018-12-21 14:10:18 +0000 |
commit | 5fc4db75798c8829d1df1235272321e286e3c0e4 (patch) | |
tree | 6c3348909dd6cc70ed8878aee7031c2b33ff590d /clang/lib/Sema/SemaObjCProperty.cpp | |
parent | 2c8ead823b5e21fc5476cf11f351c894b01dc4ce (diff) | |
download | bcm5719-llvm-5fc4db75798c8829d1df1235272321e286e3c0e4.tar.gz bcm5719-llvm-5fc4db75798c8829d1df1235272321e286e3c0e4.zip |
[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.
llvm-svn: 349901
Diffstat (limited to 'clang/lib/Sema/SemaObjCProperty.cpp')
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index d0000279722..9412d016004 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/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); |