aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGCXXABI.h
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-02-13 22:16:19 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-02-13 22:16:19 +0000
commit7ca4850a3e3530fa6c93b64b740446e32c97f992 (patch)
tree4bdd8740e76bd15404199f6d10d6930bbab91cf3 /lib/CodeGen/CGCXXABI.h
parent5ad3af90dd09b482c61dca565be4b50efcd8021d (diff)
Deal with a horrible C++11 special case. If a non-literal type has a constexpr
constructor, and that constructor is used to initialize an object of static storage duration such that all members and bases are initialized by constant expressions, constant initialization is performed. In this case, the object can still have a non-trivial destructor, and if it does, we must emit a dynamic initializer which performs no initialization and instead simply registers that destructor. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150419 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGCXXABI.h')
-rw-r--r--lib/CodeGen/CGCXXABI.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/CGCXXABI.h b/lib/CodeGen/CGCXXABI.h
index 5e21bb0c9f..4bacd01403 100644
--- a/lib/CodeGen/CGCXXABI.h
+++ b/lib/CodeGen/CGCXXABI.h
@@ -226,12 +226,14 @@ public:
/// Emits the guarded initializer and destructor setup for the given
/// variable, given that it couldn't be emitted as a constant.
+ /// If \p PerformInit is false, the initialization has been folded to a
+ /// constant and should not be performed.
///
/// The variable may be:
/// - a static local variable
/// - a static data member of a class template instantiation
virtual void EmitGuardedInit(CodeGenFunction &CGF, const VarDecl &D,
- llvm::GlobalVariable *DeclPtr);
+ llvm::GlobalVariable *DeclPtr, bool PerformInit);
};