aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/LTO/LTO.cpp
diff options
context:
space:
mode:
authorSteven Wu <stevenwu@apple.com>2019-09-16 18:49:54 +0000
committerSteven Wu <stevenwu@apple.com>2019-09-16 18:49:54 +0000
commit34d80461ff77269d6342768a5801ec655da7cea7 (patch)
treea838a723dc1d2a7b1a6840253ef87974483f223f /llvm/lib/LTO/LTO.cpp
parent32837a0c93ecdb33faaba253c5c7e868db9c529f (diff)
downloadllvm-34d80461ff77269d6342768a5801ec655da7cea7.zip
llvm-34d80461ff77269d6342768a5801ec655da7cea7.tar.gz
llvm-34d80461ff77269d6342768a5801ec655da7cea7.tar.bz2
[LTO][Legacy] Add new C inferface to query libcall functions
Summary: This is needed to implemented the same approach as lld (implemented in r338434) for how to handling symbols that can be generated by LTO code generator but not present in the symbol table for linker that uses legacy C APIs. libLTO is in charge of providing the list of symbols. Linker is in charge of implementing the eager loading from static libraries using the list of symbols. rdar://problem/52853974 Reviewers: tejohnson, bd1976llvm, deadalnix, espindola Reviewed By: tejohnson Subscribers: emaste, arichardson, hiraditya, MaskRay, dang, kledzik, mehdi_amini, inglorion, jkorous, dexonsmith, ributzka, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67568 llvm-svn: 372021
Diffstat (limited to 'llvm/lib/LTO/LTO.cpp')
-rw-r--r--llvm/lib/LTO/LTO.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/LTO/LTO.cpp b/llvm/lib/LTO/LTO.cpp
index 4696265..9e16cba4 100644
--- a/llvm/lib/LTO/LTO.cpp
+++ b/llvm/lib/LTO/LTO.cpp
@@ -1011,6 +1011,16 @@ Error LTO::runRegularLTO(AddStreamFn AddStream) {
std::move(RegularLTO.CombinedModule), ThinLTO.CombinedIndex);
}
+static const char *libcallRoutineNames[] = {
+#define HANDLE_LIBCALL(code, name) name,
+#include "llvm/IR/RuntimeLibcalls.def"
+#undef HANDLE_LIBCALL
+};
+
+ArrayRef<const char*> LTO::getRuntimeLibcallSymbols() {
+ return makeArrayRef(libcallRoutineNames);
+}
+
/// This class defines the interface to the ThinLTO backend.
class lto::ThinBackendProc {
protected: