summaryrefslogtreecommitdiffstats
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2012-03-09 01:51:51 +0000
committerDaniel Dunbar <daniel@zuster.org>2012-03-09 01:51:51 +0000
commit3d13c5a1e72ed8f8be9c083791d30643d1b1ec43 (patch)
tree6c29efdfbe48d1b6141cb7ae80761e075dc5af2c /lib/AST/ExprConstant.cpp
parent76aadc346c3a4c363238a1e1232f324c3355d9e0 (diff)
[AST] Reduce Decl::getASTContext() calls.
- This function is not at all free; pass it around along some hot paths instead of recomputing it deep inside various VarDecl methods. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152363 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 947f661c2c..5f9b0501b2 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -1733,7 +1733,7 @@ static bool HandleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv,
// parameters are constant expressions even if they're non-const.
// In C, such things can also be folded, although they are not ICEs.
const VarDecl *VD = dyn_cast<VarDecl>(D);
- if (const VarDecl *VDef = VD->getDefinition())
+ if (const VarDecl *VDef = VD->getDefinition(Info.Ctx))
VD = VDef;
if (!VD || VD->isInvalidDecl()) {
Info.Diag(Loc);