aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/ModuleUtils.cpp
diff options
context:
space:
mode:
authorReshabh Sharma <Reshabhkumar.Sharma@amd.com>2021-04-29 11:04:23 +0530
committerReshabh Sharma <Reshabhkumar.Sharma@amd.com>2021-04-29 11:06:00 +0530
commit60c60dd1387742730b5cc756f8d92bac2e23c2b0 (patch)
tree5570f94b43b8b1ceb997142e3e3a35f8a854c2f4 /llvm/lib/Transforms/Utils/ModuleUtils.cpp
parentaff73487c986b519aac1e0b7fee6d7bef72e4002 (diff)
downloadllvm-60c60dd1387742730b5cc756f8d92bac2e23c2b0.zip
llvm-60c60dd1387742730b5cc756f8d92bac2e23c2b0.tar.gz
llvm-60c60dd1387742730b5cc756f8d92bac2e23c2b0.tar.bz2
[ASAN] NFC: Use addrspace cast for pointers in non-zero addrspace
Pointers in non-zero address spaces need to be address space casted before appending to the used list. Reviewed by: vitalybuka Differential Revision: https://reviews.llvm.org/D101363
Diffstat (limited to 'llvm/lib/Transforms/Utils/ModuleUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/ModuleUtils.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Utils/ModuleUtils.cpp b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
index 4ad9837..8c6435b 100644
--- a/llvm/lib/Transforms/Utils/ModuleUtils.cpp
+++ b/llvm/lib/Transforms/Utils/ModuleUtils.cpp
@@ -89,7 +89,7 @@ static void appendToUsedList(Module &M, StringRef Name, ArrayRef<GlobalValue *>
Type *Int8PtrTy = llvm::Type::getInt8PtrTy(M.getContext());
for (auto *V : Values) {
- Constant *C = ConstantExpr::getBitCast(V, Int8PtrTy);
+ Constant *C = ConstantExpr::getPointerBitCastOrAddrSpaceCast(V, Int8PtrTy);
if (InitAsSet.insert(C).second)
Init.push_back(C);
}