summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReaderDecl.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
commit31cf12c0a628ce452e325eec45eaed307059df27 (patch)
tree7470279d12c5dc2a47215ff25b518964544f08cf /clang/lib/Frontend/PCHReaderDecl.cpp
parent7d287cb7ed0188f85fa4730f3e3c079aff5457d9 (diff)
downloadbcm5719-llvm-31cf12c0a628ce452e325eec45eaed307059df27.tar.gz
bcm5719-llvm-31cf12c0a628ce452e325eec45eaed307059df27.zip
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. llvm-svn: 72428
Diffstat (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r--clang/lib/Frontend/PCHReaderDecl.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp
index 7d4c6341932..adf0d1155e2 100644
--- a/clang/lib/Frontend/PCHReaderDecl.cpp
+++ b/clang/lib/Frontend/PCHReaderDecl.cpp
@@ -342,7 +342,7 @@ void PCHDeclReader::VisitVarDecl(VarDecl *VD) {
cast_or_null<VarDecl>(Reader.GetDecl(Record[Idx++])));
VD->setTypeSpecStartLoc(SourceLocation::getFromRawEncoding(Record[Idx++]));
if (Record[Idx++])
- VD->setInit(Reader.ReadDeclExpr());
+ VD->setInit(*Reader.getContext(), Reader.ReadDeclExpr());
}
void PCHDeclReader::VisitImplicitParamDecl(ImplicitParamDecl *PD) {
OpenPOWER on IntegriCloud