aboutsummaryrefslogtreecommitdiff
path: root/clang/utils
diff options
context:
space:
mode:
authorSam McCall <sam.mccall@gmail.com>2022-03-16 03:13:44 +0100
committerSam McCall <sam.mccall@gmail.com>2022-03-25 20:22:01 +0100
commit57ee624d7946b4d42890709287eb71d4eb1fa2fa (patch)
treeb9642eac323ab87bbfdfac7aabdb9770abe279a8 /clang/utils
parentdda003afa643011cc3d9c987fd4356410912c5a2 (diff)
downloadllvm-57ee624d7946b4d42890709287eb71d4eb1fa2fa.zip
llvm-57ee624d7946b4d42890709287eb71d4eb1fa2fa.tar.gz
llvm-57ee624d7946b4d42890709287eb71d4eb1fa2fa.tar.bz2
[cmake] Provide CURRENT_TOOLS_DIR centrally, replacing CLANG_TOOLS_DIR
CLANG_TOOLS_DIR holds the the current bin/ directory, maybe with a %(build_mode) placeholder. It is used to add the just-built binaries to $PATH for lit tests. In most cases it equals LLVM_TOOLS_DIR, which is used for the same purpose. But for a standalone build of clang, CLANG_TOOLS_DIR points at the build tree and LLVM_TOOLS_DIR points at the provided LLVM binaries. Currently CLANG_TOOLS_DIR is set in clang/test/, clang-tools-extra/test/, and other things always built with clang. This is a few cryptic lines of CMake in each place. Meanwhile LLVM_TOOLS_DIR is provided by configure_site_lit_cfg(). This patch moves CLANG_TOOLS_DIR to configure_site_lit_cfg() and renames it: - there's nothing clang-specific about the value - it will also replace LLD_TOOLS_DIR, LLDB_TOOLS_DIR etc (not in this patch) It also defines CURRENT_LIBS_DIR. While I removed the last usage of CLANG_LIBS_DIR in e4cab4e24d1, there are LLD_LIBS_DIR usages etc that may be live, and I'd like to mechanically update them in a followup patch. Differential Revision: https://reviews.llvm.org/D121763
Diffstat (limited to 'clang/utils')
-rw-r--r--clang/utils/perf-training/CMakeLists.txt8
-rw-r--r--clang/utils/perf-training/lit.site.cfg.in2
-rw-r--r--clang/utils/perf-training/order-files.lit.site.cfg.in2
3 files changed, 2 insertions, 10 deletions
diff --git a/clang/utils/perf-training/CMakeLists.txt b/clang/utils/perf-training/CMakeLists.txt
index 172076f..57c97407 100644
--- a/clang/utils/perf-training/CMakeLists.txt
+++ b/clang/utils/perf-training/CMakeLists.txt
@@ -1,11 +1,3 @@
-if (CMAKE_CFG_INTDIR STREQUAL ".")
- set(LLVM_BUILD_MODE ".")
-else ()
- set(LLVM_BUILD_MODE "%(build_mode)s")
-endif ()
-
-string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
-
set(CLANG_PGO_TRAINING_DATA "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH
"The path to a lit testsuite containing samples for PGO and order file generation"
)
diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in
index c9624aa..fae9306 100644
--- a/clang/utils/perf-training/lit.site.cfg.in
+++ b/clang/utils/perf-training/lit.site.cfg.in
@@ -2,7 +2,7 @@
import sys
-config.clang_tools_dir = lit_config.substitute("@CLANG_TOOLS_DIR@")
+config.clang_tools_dir = lit_config.substitute("@CURRENT_TOOLS_DIR@")
config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
diff --git a/clang/utils/perf-training/order-files.lit.site.cfg.in b/clang/utils/perf-training/order-files.lit.site.cfg.in
index 5923eae..fb72b8c 100644
--- a/clang/utils/perf-training/order-files.lit.site.cfg.in
+++ b/clang/utils/perf-training/order-files.lit.site.cfg.in
@@ -2,7 +2,7 @@
import sys
-config.clang_tools_dir = lit_config.substitute("@CLANG_TOOLS_DIR@")
+config.clang_tools_dir = lit_config.substitute("@CURRENT_TOOLS_DIR@")
config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"