Skip to content

Commit c9288fc

Browse files
committed
Drop vestigial target hook.
1 parent 1c3e67c commit c9288fc

File tree

2 files changed

+2
-13
lines changed

2 files changed

+2
-13
lines changed

clang/include/clang/Basic/TargetInfo.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1780,14 +1780,6 @@ class TargetInfo : public TransferrableTargetInfo,
17801780
return 0;
17811781
}
17821782

1783-
/// \returns Target specific address space for indirect (e.g. sret) arguments.
1784-
/// If such an address space exists, it must be convertible to and from the
1785-
/// alloca address space. If it does not, std::nullopt is returned and the
1786-
/// alloca address space will be used.
1787-
virtual std::optional<unsigned> getIndirectArgAddressSpace() const {
1788-
return std::nullopt;
1789-
}
1790-
17911783
/// \returns If a target requires an address within a target specific address
17921784
/// space \p AddressSpace to be converted in order to be used, then return the
17931785
/// corresponding target specific DWARF address space.

clang/lib/CodeGen/CGCall.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,11 +1672,8 @@ CodeGenTypes::GetFunctionType(const CGFunctionInfo &FI) {
16721672

16731673
// Add type for sret argument.
16741674
if (IRFunctionArgs.hasSRetArg()) {
1675-
auto AddressSpace = CGM.getTarget().getIndirectArgAddressSpace();
1676-
if (!AddressSpace)
1677-
AddressSpace = getDataLayout().getAllocaAddrSpace();
1678-
ArgTypes[IRFunctionArgs.getSRetArgNo()] =
1679-
llvm::PointerType::get(getLLVMContext(), *AddressSpace);
1675+
ArgTypes[IRFunctionArgs.getSRetArgNo()] = llvm::PointerType::get(
1676+
getLLVMContext(), FI.getReturnInfo().getIndirectAddrSpace());
16801677
}
16811678

16821679
// Add type for inalloca argument.

0 commit comments

Comments
 (0)