From 31cf12c0a628ce452e325eec45eaed307059df27 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Tue, 26 May 2009 18:54:04 +0000 Subject: 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 --- clang/lib/Frontend/PCHReaderDecl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp') 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(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) { -- cgit v1.2.3