aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2025-06-27 17:40:43 +0900
committerGitHub <noreply@github.com>2025-06-27 17:40:43 +0900
commitb88e1f6a79cbe2672dd6dbb926ae7ca02ce537a5 (patch)
tree2ad285bc4d306b8c77f8c04dab0fedc9ad967c0a /llvm/lib/LTO/LTO.cpp
parent3fdf46ad60f1747e8ea1cced2e67dd36f29fc43b (diff)
downloadllvm-b88e1f6a79cbe2672dd6dbb926ae7ca02ce537a5.zip
llvm-b88e1f6a79cbe2672dd6dbb926ae7ca02ce537a5.tar.gz
llvm-b88e1f6a79cbe2672dd6dbb926ae7ca02ce537a5.tar.bz2
TableGen: Generate enum for runtime libcall implementations (#144973)
Work towards separating the ABI existence of libcalls vs. the lowering selection. Set libcall selection through enums, rather than through raw string names.
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index adf995c..779c98e 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1389,8 +1389,14 @@ Error LTO::runRegularLTO(AddStreamFn AddStream) {
SmallVector<const char *> LTO::getRuntimeLibcallSymbols(const Triple &TT) {
RTLIB::RuntimeLibcallsInfo Libcalls(TT);
SmallVector<const char *> LibcallSymbols;
- copy_if(Libcalls.getLibcallNames(), std::back_inserter(LibcallSymbols),
- [](const char *Name) { return Name; });
+ ArrayRef<RTLIB::LibcallImpl> LibcallImpls = Libcalls.getLibcallImpls();
+ LibcallSymbols.reserve(LibcallImpls.size());
+
+ for (RTLIB::LibcallImpl Impl : LibcallImpls) {
+ if (Impl != RTLIB::Unsupported)
+ LibcallSymbols.push_back(Libcalls.getLibcallImplName(Impl));
+ }
+
return LibcallSymbols;
}