aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-05-09 14:24:54 +0200
committerGitHub <noreply@github.com>2025-05-09 14:24:54 +0200
commit5ae2aed218470783e6c7a2d255c7946f4549cb46 (patch)
treed3b2eaa76f766e1712cf3d26bc419907f7d047a9 /clang/lib/CodeGen/CodeGenModule.cpp
parentc64c64db7b4b30dc5c5fad3b854f567254d1a615 (diff)
downloadllvm-5ae2aed218470783e6c7a2d255c7946f4549cb46.zip
llvm-5ae2aed218470783e6c7a2d255c7946f4549cb46.tar.gz
llvm-5ae2aed218470783e6c7a2d255c7946f4549cb46.tar.bz2
clang: Remove dest LangAS argument from performAddrSpaceCast (#138866)
It isn't used and is redundant with the result pointer type argument. A more reasonable API would only have LangAS parameters, or IR parameters, not both. Not all values have a meaningful value for this. I'm also not sure why we have this at all, it's not overridden by any targets and further simplification is possible.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index c278176..85f8148 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -5251,7 +5251,7 @@ CodeGenModule::GetOrCreateLLVMGlobal(StringRef MangledName, llvm::Type *Ty,
assert(getContext().getTargetAddressSpace(ExpectedAS) == TargetAS);
if (DAddrSpace != ExpectedAS) {
return getTargetCodeGenInfo().performAddrSpaceCast(
- *this, GV, DAddrSpace, ExpectedAS,
+ *this, GV, DAddrSpace,
llvm::PointerType::get(getLLVMContext(), TargetAS));
}
@@ -5486,7 +5486,7 @@ castStringLiteralToDefaultAddressSpace(CodeGenModule &CGM,
auto AS = CGM.GetGlobalConstantAddressSpace();
if (AS != LangAS::Default)
Cast = CGM.getTargetCodeGenInfo().performAddrSpaceCast(
- CGM, GV, AS, LangAS::Default,
+ CGM, GV, AS,
llvm::PointerType::get(
CGM.getLLVMContext(),
CGM.getContext().getTargetAddressSpace(LangAS::Default)));
@@ -6886,7 +6886,7 @@ ConstantAddress CodeGenModule::GetAddrOfGlobalTemporary(
llvm::Constant *CV = GV;
if (AddrSpace != LangAS::Default)
CV = getTargetCodeGenInfo().performAddrSpaceCast(
- *this, GV, AddrSpace, LangAS::Default,
+ *this, GV, AddrSpace,
llvm::PointerType::get(
getLLVMContext(),
getContext().getTargetAddressSpace(LangAS::Default)));