summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorBruno Ricci <riccibrun@gmail.com>2018-12-21 14:10:18 +0000
committerBruno Ricci <riccibrun@gmail.com>2018-12-21 14:10:18 +0000
commit5fc4db75798c8829d1df1235272321e286e3c0e4 (patch)
tree6c3348909dd6cc70ed8878aee7031c2b33ff590d /clang/lib/Sema/Sema.cpp
parent2c8ead823b5e21fc5476cf11f351c894b01dc4ce (diff)
downloadbcm5719-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/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index a8e3b85fe06..9fa39968625 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -1415,7 +1415,8 @@ static void checkEscapingByref(VarDecl *VD, Sema &S) {
EnterExpressionEvaluationContext scope(
S, Sema::ExpressionEvaluationContext::PotentiallyEvaluated);
SourceLocation Loc = VD->getLocation();
- Expr *VarRef = new (S.Context) DeclRefExpr(VD, false, T, VK_LValue, Loc);
+ Expr *VarRef =
+ new (S.Context) DeclRefExpr(S.Context, VD, false, T, VK_LValue, Loc);
ExprResult Result = S.PerformMoveOrCopyInitialization(
InitializedEntity::InitializeBlock(Loc, T, false), VD, VD->getType(),
VarRef, /*AllowNRVO=*/true);
OpenPOWER on IntegriCloud