aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaTemplateInstantiateExpr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-27 17:54:46 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-27 17:54:46 +0000
commited961e7fffc268eeace169869f5a059bcbd5fcbd (patch)
tree0b9d4239b1a100964d24d58e148dd514495ee279 /lib/Sema/SemaTemplateInstantiateExpr.cpp
parentd0c873799614d32c9c11280878ac1a856f92f707 (diff)
Simplify, and improve the performance of, template instantiation for
declaration references. The key realization is that dependent Decls, which actually require instantiation, can only refer to the current instantiation or members thereof. And, since the current context during instantiation contains all of those members of the current instantiation, we can simply find the real instantiate that matches up with the "current instantiation" template. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72486 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaTemplateInstantiateExpr.cpp')
-rw-r--r--lib/Sema/SemaTemplateInstantiateExpr.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/Sema/SemaTemplateInstantiateExpr.cpp b/lib/Sema/SemaTemplateInstantiateExpr.cpp
index 726ac2b425..31bb91def2 100644
--- a/lib/Sema/SemaTemplateInstantiateExpr.cpp
+++ b/lib/Sema/SemaTemplateInstantiateExpr.cpp
@@ -108,7 +108,6 @@ TemplateExprInstantiator::VisitUnresolvedFunctionNameExpr(
Sema::OwningExprResult
TemplateExprInstantiator::VisitDeclRefExpr(DeclRefExpr *E) {
- // FIXME: Recast this in terms of Sema::InstantiateDeclRef.
NamedDecl *D = E->getDecl();
if (NonTypeTemplateParmDecl *NTTP = dyn_cast<NonTypeTemplateParmDecl>(D)) {
assert(NTTP->getDepth() == 0 && "No nested templates yet");
@@ -141,7 +140,7 @@ TemplateExprInstantiator::VisitDeclRefExpr(DeclRefExpr *E) {
}
ValueDecl *NewD
- = dyn_cast_or_null<ValueDecl>(SemaRef.InstantiateDeclRef(D, TemplateArgs));
+ = dyn_cast_or_null<ValueDecl>(SemaRef.InstantiateCurrentDeclRef(D));
if (!NewD)
return SemaRef.ExprError();