summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGExprConstant.cpp
diff options
context:
space:
mode:
authorEli Friedman <eli.friedman@gmail.com>2009-08-26 20:01:39 +0000
committerEli Friedman <eli.friedman@gmail.com>2009-08-26 20:01:39 +0000
commit95f896380f6dc46c89eadec017476fc75b93e43b (patch)
treec4afdbffd2baa223849075aab77112d98f9fb6ea /clang/lib/CodeGen/CGExprConstant.cpp
parentc24fc2949ebee5ada78f031780fab66fbf3eb4a2 (diff)
downloadbcm5719-llvm-95f896380f6dc46c89eadec017476fc75b93e43b.tar.gz
bcm5719-llvm-95f896380f6dc46c89eadec017476fc75b93e43b.zip
Make address-space qualification work correctly for compound literals.
Issue reported on cfe-dev. Also fixed the code to use isConstant to determine whether to generate a constant global, to be consistent with CodeGenModule. This probably needs to be refactored to deal with C++, though. llvm-svn: 80131
Diffstat (limited to 'clang/lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--clang/lib/CodeGen/CGExprConstant.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprConstant.cpp b/clang/lib/CodeGen/CGExprConstant.cpp
index 2be22f98ab2..593406f5d0d 100644
--- a/clang/lib/CodeGen/CGExprConstant.cpp
+++ b/clang/lib/CodeGen/CGExprConstant.cpp
@@ -591,9 +591,10 @@ public:
// FIXME: "Leaked" on failure.
if (C)
C = new llvm::GlobalVariable(CGM.getModule(), C->getType(),
- E->getType().isConstQualified(),
+ E->getType().isConstant(CGM.getContext()),
llvm::GlobalValue::InternalLinkage,
- C, ".compoundliteral");
+ C, ".compoundliteral", 0, false,
+ E->getType().getAddressSpace());
return C;
}
case Expr::DeclRefExprClass:
OpenPOWER on IntegriCloud