aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGDecl.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2010-08-02 21:13:48 +0000
committerJohn McCall <rjmccall@apple.com>2010-08-02 21:13:48 +0000
commit4204f07fc8bffe6d320b2de95fea274ccf37a17b (patch)
tree90f5c06c89e2673b40fd7352a497c661c4901d5c /lib/CodeGen/CGDecl.cpp
parent73dfa3d30ab19d358b782c201201fa2a2dcf51a6 (diff)
Further adjustments to -Wglobal-constructors; works for references and direct
initializations now. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110063 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGDecl.cpp')
-rw-r--r--lib/CodeGen/CGDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index c4ce008748..0f5a4bdcfc 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -512,10 +512,10 @@ void CodeGenFunction::EmitLocalBlockVarDecl(const VarDecl &D,
// If this value is an array or struct, is POD, and if the initializer is
// a staticly determinable constant, try to optimize it (unless the NRVO
// is already optimizing this).
- if (D.getInit() && !isByRef &&
+ if (!NRVO && D.getInit() && !isByRef &&
(Ty->isArrayType() || Ty->isRecordType()) &&
Ty->isPODType() &&
- D.getInit()->isConstantInitializer(getContext()) && !NRVO) {
+ D.getInit()->isConstantInitializer(getContext(), false)) {
// If this variable is marked 'const', emit the value as a global.
if (CGM.getCodeGenOpts().MergeAllConstants &&
Ty.isConstant(getContext())) {