aboutsummaryrefslogtreecommitdiff
path: root/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
commitd15d8c6395bbdc9b344ba6c6edf152502c2abfde (patch)
tree379d174d8f7899ebcb43cb552addd5900e517590 /lib/CodeGen/CGExprConstant.cpp
parent2cf738f1944d1cc724ea7561b84440a3a1059e45 (diff)
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80131 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprConstant.cpp')
-rw-r--r--lib/CodeGen/CGExprConstant.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprConstant.cpp b/lib/CodeGen/CGExprConstant.cpp
index 2be22f98ab..593406f5d0 100644
--- a/lib/CodeGen/CGExprConstant.cpp
+++ b/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: