From d15d8c6395bbdc9b344ba6c6edf152502c2abfde Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Wed, 26 Aug 2009 20:01:39 +0000 Subject: 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 --- lib/CodeGen/CGExprConstant.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/CodeGen/CGExprConstant.cpp') 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: -- cgit v1.2.3