summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaDecl.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/Sema/SemaDecl.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/Sema/SemaDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp
index 22bdc7999bb..4149fa4c9a3 100644
--- a/clang/lib/Sema/SemaDecl.cpp
+++ b/clang/lib/Sema/SemaDecl.cpp
@@ -2581,7 +2581,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
// };
// Attach the initializer
- VDecl->setInit(Init);
+ VDecl->setInit(Context, Init);
// C++ [class.mem]p4:
// A member-declarator can contain a constant-initializer only
@@ -2644,7 +2644,7 @@ void Sema::AddInitializerToDecl(DeclPtrTy dcl, ExprArg init, bool DirectInit) {
}
// Attach the initializer to the decl.
- VDecl->setInit(Init);
+ VDecl->setInit(Context, Init);
// If the previous declaration of VDecl was a tentative definition,
// remove it from the set of tentative definitions.
OpenPOWER on IntegriCloud