aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/StmtIterator.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-26 18:54:04 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-26 18:54:04 +0000
commit78d1583d0b36b7d6d8d10234cdc19ab94adf765a (patch)
tree6fd6d0fc80be75ca12fcc0ddc17cb6de5c7e1668 /lib/AST/StmtIterator.cpp
parent0311d47665bcdd186af6fc1bcfa40cf186ae7b9a (diff)
When evaluating a VarDecl as a constant or determining whether it is
an integral constant expression, maintain a cache of the value and the is-an-ICE flag within the VarDecl itself. This eliminates exponential-time behavior of the Fibonacci template metaprogram. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72428 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/StmtIterator.cpp')
-rw-r--r--lib/AST/StmtIterator.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/AST/StmtIterator.cpp b/lib/AST/StmtIterator.cpp
index 20024f513f..5c22e28894 100644
--- a/lib/AST/StmtIterator.cpp
+++ b/lib/AST/StmtIterator.cpp
@@ -140,14 +140,14 @@ Stmt*& StmtIteratorBase::GetDeclExpr() const {
if (inDeclGroup()) {
VarDecl* VD = cast<VarDecl>(*DGI);
- return VD->Init;
+ return *VD->getInitAddress();
}
assert (inDecl());
if (VarDecl* VD = dyn_cast<VarDecl>(decl)) {
assert (VD->Init);
- return VD->Init;
+ return *VD->getInitAddress();
}
EnumConstantDecl* ECD = cast<EnumConstantDecl>(decl);