summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2015-02-04 20:44:15 +0000
committerHans Wennborg <hans@hanshq.net>2015-02-04 20:44:15 +0000
commit0e6167a208a5e521b32932a269ecd4274313106a (patch)
tree23da8db8ef72a3bfb1fe4ca3ad9bbd9733e39fa6 /lib
parent6400caeb1d00357fc5f980fb5f775540c78aa80a (diff)
Merging r227861:
------------------------------------------------------------------------ r227861 | jholewinski | 2015-02-02 13:05:49 -0800 (Mon, 02 Feb 2015) | 15 lines When generating llvm.used, we may need an addrspacecast instead of a bitcast. Summary: This is especially important for targets that use multiple address spaces, and commonly place global variables in address spaces other than zero. Fixes PR22383 Test Plan: New test case added: llvm-used.cu Reviewers: jingyue Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D7345 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/cfe/branches/release_36@228185 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/CodeGen/CodeGenModule.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/CodeGen/CodeGenModule.cpp b/lib/CodeGen/CodeGenModule.cpp
index 1b07160908..9f4567dbbb 100644
--- a/lib/CodeGen/CodeGenModule.cpp
+++ b/lib/CodeGen/CodeGenModule.cpp
@@ -935,8 +935,8 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
UsedArray.resize(List.size());
for (unsigned i = 0, e = List.size(); i != e; ++i) {
UsedArray[i] =
- llvm::ConstantExpr::getBitCast(cast<llvm::Constant>(&*List[i]),
- CGM.Int8PtrTy);
+ llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast(
+ cast<llvm::Constant>(&*List[i]), CGM.Int8PtrTy);
}
if (UsedArray.empty())