From a7b1d455cc14be765b511bd5070a453b8d15858c Mon Sep 17 00:00:00 2001 From: Quentin Colombet Date: Tue, 8 Mar 2016 00:02:50 +0000 Subject: [PATCH] [llvm-config] Teach llvm-config about global-isel. llvm-config can know tell whether or not a build has been configured to support global-isel. Use '--has-global-isel' for that. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@262877 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-config/BuildVariables.inc.in | 1 + tools/llvm-config/CMakeLists.txt | 1 + tools/llvm-config/llvm-config.cpp | 3 +++ 3 files changed, 5 insertions(+) diff --git a/tools/llvm-config/BuildVariables.inc.in b/tools/llvm-config/BuildVariables.inc.in index 952c2a8a127..709ea35044c 100644 --- a/tools/llvm-config/BuildVariables.inc.in +++ b/tools/llvm-config/BuildVariables.inc.in @@ -33,3 +33,4 @@ #define LLVM_ENABLE_SHARED "@LLVM_ENABLE_SHARED@" #define LLVM_DYLIB_COMPONENTS "@LLVM_DYLIB_COMPONENTS@" #define LLVM_DYLIB_VERSION "@LLVM_DYLIB_VERSION@" +#define LLVM_HAS_GLOBAL_ISEL "@LLVM_HAS_GLOBAL_ISEL@" diff --git a/tools/llvm-config/CMakeLists.txt b/tools/llvm-config/CMakeLists.txt index d149b7e65fd..32d0f4c6bd6 100644 --- a/tools/llvm-config/CMakeLists.txt +++ b/tools/llvm-config/CMakeLists.txt @@ -31,6 +31,7 @@ set(LLVM_CXXFLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_ set(LLVM_BUILD_SYSTEM cmake) set(LLVM_HAS_RTTI ${LLVM_CONFIG_HAS_RTTI}) set(LLVM_DYLIB_VERSION "${LLVM_VERSION_MAJOR}.${LLVM_VERSION_MINOR}${LLVM_VERSION_SUFFIX}") +set(LLVM_HAS_GLOBAL_ISEL "${LLVM_BUILD_GLOBAL_ISEL}") # Use the C++ link flags, since they should be a superset of C link flags. set(LLVM_LDFLAGS "${CMAKE_CXX_LINK_FLAGS}") diff --git a/tools/llvm-config/llvm-config.cpp b/tools/llvm-config/llvm-config.cpp index e5b121006f5..76a40da4960 100644 --- a/tools/llvm-config/llvm-config.cpp +++ b/tools/llvm-config/llvm-config.cpp @@ -211,6 +211,7 @@ Options:\n\ --assertion-mode Print assertion mode of LLVM tree (ON or OFF).\n\ --build-system Print the build system used to build LLVM (autoconf or cmake).\n\ --has-rtti Print whether or not LLVM was built with rtti (YES or NO).\n\ + --has-global-isel Print whether or not LLVM was built with global-isel support (YES or NO).\n\ --shared-mode Print how the provided components can be collectively linked (`shared` or `static`).\n\ --link-shared Link the components as shared libraries.\n\ --link-static Link the component libraries statically.\n\ @@ -559,6 +560,8 @@ int main(int argc, char **argv) { OS << LLVM_BUILD_SYSTEM << '\n'; } else if (Arg == "--has-rtti") { OS << LLVM_HAS_RTTI << '\n'; + } else if (Arg == "--has-global-isel") { + OS << LLVM_HAS_GLOBAL_ISEL << '\n'; } else if (Arg == "--shared-mode") { PrintSharedMode = true; } else if (Arg == "--obj-root") {