diff options
author | Eli Friedman <eli.friedman@gmail.com> | 2009-08-26 20:01:39 +0000 |
---|---|---|
committer | Eli Friedman <eli.friedman@gmail.com> | 2009-08-26 20:01:39 +0000 |
commit | 95f896380f6dc46c89eadec017476fc75b93e43b (patch) | |
tree | c4afdbffd2baa223849075aab77112d98f9fb6ea /clang/lib/CodeGen/CGExprConstant.cpp | |
parent | c24fc2949ebee5ada78f031780fab66fbf3eb4a2 (diff) | |
download | bcm5719-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.cpp | 5 |
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: |