diff options
| author | serge-sans-paille <sguelton@redhat.com> | 2020-04-20 12:39:32 +0200 |
|---|---|---|
| committer | Tom Stellard <tstellar@redhat.com> | 2020-06-17 16:57:30 -0700 |
| commit | 5f510e51dd4e6de5987a162f232c514a4dc8b0e3 (patch) | |
| tree | f038eb3fcfc75e0c00b01ecfe021307d601b7e6f /llvm/tools | |
| parent | 0c05269e0232d5eebfd835aa1401913b181031a3 (diff) | |
| download | bcm5719-llvm-5f510e51dd4e6de5987a162f232c514a4dc8b0e3.tar.gz bcm5719-llvm-5f510e51dd4e6de5987a162f232c514a4dc8b0e3.zip | |
Update compiler extension integration into the build system
The approach here is to create a new (empty) component, `Extensions', where all
statically compiled extensions dynamically register their dependencies. That way
we're more natively compatible with LLVMBuild and llvm-config.
Fixes: https://bugs.llvm.org/show_bug.cgi?id=44870
Differential Revision: https://reviews.llvm.org/D78192
(cherry picked from commit 8f766e382b77eef3102798b49e087d1e4804b984)
Diffstat (limited to 'llvm/tools')
| -rw-r--r-- | llvm/tools/bugpoint/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | llvm/tools/llvm-config/llvm-config.cpp | 23 | ||||
| -rw-r--r-- | llvm/tools/opt/CMakeLists.txt | 3 |
3 files changed, 25 insertions, 4 deletions
diff --git a/llvm/tools/bugpoint/CMakeLists.txt b/llvm/tools/bugpoint/CMakeLists.txt index 0b5998e181e..b71ac919d91 100644 --- a/llvm/tools/bugpoint/CMakeLists.txt +++ b/llvm/tools/bugpoint/CMakeLists.txt @@ -6,6 +6,7 @@ set(LLVM_LINK_COMPONENTS Analysis BitWriter CodeGen + Extensions Core IPO IRReader @@ -32,8 +33,6 @@ add_llvm_tool(bugpoint ToolRunner.cpp bugpoint.cpp - ENABLE_PLUGINS - DEPENDS intrinsics_gen SUPPORT_PLUGINS diff --git a/llvm/tools/llvm-config/llvm-config.cpp b/llvm/tools/llvm-config/llvm-config.cpp index 6c31df3e173..fb12e29a36a 100644 --- a/llvm/tools/llvm-config/llvm-config.cpp +++ b/llvm/tools/llvm-config/llvm-config.cpp @@ -46,6 +46,10 @@ using namespace llvm; // create entries for pseudo groups like x86 or all-targets. #include "LibraryDependencies.inc" +// Built-in extensions also register their dependencies, but in a separate file, +// later in the process. +#include "ExtensionDependencies.inc" + // LinkMode determines what libraries and flags are returned by llvm-config. enum LinkMode { // LinkModeAuto will link with the default link mode for the installation, @@ -110,6 +114,25 @@ static void VisitComponent(const std::string &Name, GetComponentLibraryPath, Missing, DirSep); } + // Special handling for the special 'extensions' component. Its content is + // not populated by llvm-build, but later in the process and loaded from + // ExtensionDependencies.inc. + if (Name == "extensions") { + for (auto const &AvailableExtension : AvailableExtensions) { + for (const char *const *Iter = &AvailableExtension.RequiredLibraries[0]; + *Iter; ++Iter) { + AvailableComponent *AC = ComponentMap.lookup(*Iter); + if (!AC) { + RequiredLibs.push_back(*Iter); + } else { + VisitComponent(*Iter, ComponentMap, VisitedComponents, RequiredLibs, + IncludeNonInstalled, GetComponentNames, + GetComponentLibraryPath, Missing, DirSep); + } + } + } + } + if (GetComponentNames) { RequiredLibs.push_back(Name); return; diff --git a/llvm/tools/opt/CMakeLists.txt b/llvm/tools/opt/CMakeLists.txt index 79613c836c5..d0abdf11130 100644 --- a/llvm/tools/opt/CMakeLists.txt +++ b/llvm/tools/opt/CMakeLists.txt @@ -9,6 +9,7 @@ set(LLVM_LINK_COMPONENTS CodeGen Core Coroutines + Extensions IPO IRReader InstCombine @@ -33,8 +34,6 @@ add_llvm_tool(opt PrintSCC.cpp opt.cpp - ENABLE_PLUGINS - DEPENDS intrinsics_gen SUPPORT_PLUGINS |

