File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change 27
27
#include " llvm/ADT/Optional.h"
28
28
#include " llvm/ADT/StringSwitch.h"
29
29
#include " llvm/BinaryFormat/Magic.h"
30
+ #include " llvm/LTO/LTO.h"
30
31
#include " llvm/Object/ArchiveWriter.h"
31
32
#include " llvm/Object/COFFImportFile.h"
32
33
#include " llvm/Object/COFFModuleDefinition.h"
@@ -1070,12 +1071,6 @@ void LinkerDriver::maybeExportMinGWSymbols(const opt::InputArgList &args) {
1070
1071
});
1071
1072
}
1072
1073
1073
- static const char *libcallRoutineNames[] = {
1074
- #define HANDLE_LIBCALL (code, name ) name,
1075
- #include " llvm/IR/RuntimeLibcalls.def"
1076
- #undef HANDLE_LIBCALL
1077
- };
1078
-
1079
1074
void LinkerDriver::link (ArrayRef<const char *> argsArr) {
1080
1075
// Needed for LTO.
1081
1076
InitializeAllTargetInfos ();
@@ -1804,7 +1799,7 @@ void LinkerDriver::link(ArrayRef<const char *> argsArr) {
1804
1799
// bitcode file in an archive member, we need to arrange to use LTO to
1805
1800
// compile those archive members by adding them to the link beforehand.
1806
1801
if (!BitcodeFile::instances.empty ())
1807
- for (const char *s : libcallRoutineNames )
1802
+ for (auto *s : lto::LTO::getRuntimeLibcallSymbols () )
1808
1803
symtab->addLibcall (s);
1809
1804
1810
1805
// Windows specific -- if __load_config_used can be resolved, resolve it.
Original file line number Diff line number Diff line change 48
48
#include " llvm/ADT/SetVector.h"
49
49
#include " llvm/ADT/StringExtras.h"
50
50
#include " llvm/ADT/StringSwitch.h"
51
+ #include " llvm/LTO/LTO.h"
51
52
#include " llvm/Support/CommandLine.h"
52
53
#include " llvm/Support/Compression.h"
53
54
#include " llvm/Support/GlobPattern.h"
@@ -1672,12 +1673,6 @@ template <class ELFT> static uint32_t getAndFeatures() {
1672
1673
return ret;
1673
1674
}
1674
1675
1675
- static const char *libcallRoutineNames[] = {
1676
- #define HANDLE_LIBCALL (code, name ) name,
1677
- #include " llvm/IR/RuntimeLibcalls.def"
1678
- #undef HANDLE_LIBCALL
1679
- };
1680
-
1681
1676
// Do actual linking. Note that when this function is called,
1682
1677
// all linker scripts have already been parsed.
1683
1678
template <class ELFT > void LinkerDriver::link (opt::InputArgList &args) {
@@ -1768,7 +1763,7 @@ template <class ELFT> void LinkerDriver::link(opt::InputArgList &args) {
1768
1763
// libcall symbols will be added to the link after LTO when we add the LTO
1769
1764
// object file to the link.
1770
1765
if (!bitcodeFiles.empty ())
1771
- for (const char *s : libcallRoutineNames )
1766
+ for (auto *s : lto::LTO::getRuntimeLibcallSymbols () )
1772
1767
handleLibcall (s);
1773
1768
1774
1769
// Return if there were name resolution errors.
You can’t perform that action at this time.
0 commit comments