[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
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 947f661..5f9b050 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -1733,7 +1733,7 @@
// 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);