diff options
author | John McCall <rjmccall@apple.com> | 2010-08-02 21:13:48 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2010-08-02 21:13:48 +0000 |
commit | 4204f07fc8bffe6d320b2de95fea274ccf37a17b (patch) | |
tree | 90f5c06c89e2673b40fd7352a497c661c4901d5c /lib/CodeGen/CGDecl.cpp | |
parent | 73dfa3d30ab19d358b782c201201fa2a2dcf51a6 (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.cpp | 4 |
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())) { |