summaryrefslogtreecommitdiffstats
path: root/clang/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
commit8b0f4ff317be790b964821fd1ab854e3398dcc0c (patch)
tree1b430a0051eab4b1ab6608913cf030c0ded59856 /clang/lib/CodeGen/CGDecl.cpp
parentb1cf1ca19a648989099c2f013b1a7bb4c41117d2 (diff)
downloadbcm5719-llvm-8b0f4ff317be790b964821fd1ab854e3398dcc0c.tar.gz
bcm5719-llvm-8b0f4ff317be790b964821fd1ab854e3398dcc0c.zip
Further adjustments to -Wglobal-constructors; works for references and direct
initializations now. llvm-svn: 110063
Diffstat (limited to 'clang/lib/CodeGen/CGDecl.cpp')
-rw-r--r--clang/lib/CodeGen/CGDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGDecl.cpp b/clang/lib/CodeGen/CGDecl.cpp
index c4ce008748a..0f5a4bdcfc9 100644
--- a/clang/lib/CodeGen/CGDecl.cpp
+++ b/clang/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())) {
OpenPOWER on IntegriCloud