Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from llvm:master #48

Merged
merged 5 commits into from
Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions clang/docs/ReleaseNotes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ Deprecated Compiler Flags
The following options are deprecated and ignored. They will be removed in
future versions of Clang.

- -mmpx used to enable the __MPX__ preprocessor define for the Intel MPX
instructions. There were no MPX intrinsics.
- -mno-mpx used to disable -mmpx and is the default behavior.

- ...

Modified Compiler Flags
Expand Down
6 changes: 4 additions & 2 deletions clang/include/clang/Driver/Options.td
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ def clang_ignored_legacy_options_Group : OptionGroup<"<clang legacy flags>">,
def : Flag<["-"], "fslp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;
def : Flag<["-"], "fno-slp-vectorize-aggressive">, Group<clang_ignored_legacy_options_Group>;

// Retired with clang-10.0. Previously controlled X86 MPX ISA.
def mmpx : Flag<["-"], "mmpx">, Group<clang_ignored_legacy_options_Group>;
def mno_mpx : Flag<["-"], "mno-mpx">, Group<clang_ignored_legacy_options_Group>;

// Group that ignores all gcc optimizations that won't be implemented
def clang_ignored_gcc_optimization_f_Group : OptionGroup<
"<clang_ignored_gcc_optimization_f_Group>">, Group<f_Group>, Flags<[Ignored]>;
Expand Down Expand Up @@ -3000,8 +3004,6 @@ def mmovdiri : Flag<["-"], "mmovdiri">, Group<m_x86_Features_Group>;
def mno_movdiri : Flag<["-"], "mno-movdiri">, Group<m_x86_Features_Group>;
def mmovdir64b : Flag<["-"], "mmovdir64b">, Group<m_x86_Features_Group>;
def mno_movdir64b : Flag<["-"], "mno-movdir64b">, Group<m_x86_Features_Group>;
def mmpx : Flag<["-"], "mmpx">, Group<m_x86_Features_Group>;
def mno_mpx : Flag<["-"], "mno-mpx">, Group<m_x86_Features_Group>;
def mmwaitx : Flag<["-"], "mmwaitx">, Group<m_x86_Features_Group>;
def mno_mwaitx : Flag<["-"], "mno-mwaitx">, Group<m_x86_Features_Group>;
def mpku : Flag<["-"], "mpku">, Group<m_x86_Features_Group>;
Expand Down
8 changes: 0 additions & 8 deletions clang/lib/Basic/Targets/X86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ bool X86TargetInfo::initFeatureMap(
SkylakeCommon:
setFeatureEnabledImpl(Features, "xsavec", true);
setFeatureEnabledImpl(Features, "xsaves", true);
setFeatureEnabledImpl(Features, "mpx", true);
setFeatureEnabledImpl(Features, "clflushopt", true);
setFeatureEnabledImpl(Features, "aes", true);
LLVM_FALLTHROUGH;
Expand Down Expand Up @@ -277,7 +276,6 @@ bool X86TargetInfo::initFeatureMap(
setFeatureEnabledImpl(Features, "xsavec", true);
setFeatureEnabledImpl(Features, "xsaves", true);
setFeatureEnabledImpl(Features, "clflushopt", true);
setFeatureEnabledImpl(Features, "mpx", true);
setFeatureEnabledImpl(Features, "fsgsbase", true);
setFeatureEnabledImpl(Features, "aes", true);
LLVM_FALLTHROUGH;
Expand Down Expand Up @@ -798,8 +796,6 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
HasAVX512VP2INTERSECT = true;
} else if (Feature == "+sha") {
HasSHA = true;
} else if (Feature == "+mpx") {
HasMPX = true;
} else if (Feature == "+shstk") {
HasSHSTK = true;
} else if (Feature == "+movbe") {
Expand Down Expand Up @@ -1220,8 +1216,6 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
Builder.defineMacro("__CLWB__");
if (HasWBNOINVD)
Builder.defineMacro("__WBNOINVD__");
if (HasMPX)
Builder.defineMacro("__MPX__");
if (HasSHSTK)
Builder.defineMacro("__SHSTK__");
if (HasSGX)
Expand Down Expand Up @@ -1378,7 +1372,6 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const {
.Case("movbe", true)
.Case("movdiri", true)
.Case("movdir64b", true)
.Case("mpx", true)
.Case("mwaitx", true)
.Case("pclmul", true)
.Case("pconfig", true)
Expand Down Expand Up @@ -1462,7 +1455,6 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const {
.Case("movbe", HasMOVBE)
.Case("movdiri", HasMOVDIRI)
.Case("movdir64b", HasMOVDIR64B)
.Case("mpx", HasMPX)
.Case("mwaitx", HasMWAITX)
.Case("pclmul", HasPCLMUL)
.Case("pconfig", HasPCONFIG)
Expand Down
1 change: 0 additions & 1 deletion clang/lib/Basic/Targets/X86.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
bool HasAVX512IFMA = false;
bool HasAVX512VP2INTERSECT = false;
bool HasSHA = false;
bool HasMPX = false;
bool HasSHSTK = false;
bool HasSGX = false;
bool HasCX8 = false;
Expand Down
4 changes: 2 additions & 2 deletions clang/test/Driver/x86-target-features.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@

// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mmpx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=MPX %s
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-mpx %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-MPX %s
// MPX: "-target-feature" "+mpx"
// NO-MPX: "-target-feature" "-mpx"
// MPX: the flag '-mmpx' has been deprecated and will be ignored
// NO-MPX: the flag '-mno-mpx' has been deprecated and will be ignored

// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mshstk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=CETSS %s
// RUN: %clang -target i386-unknown-linux-gnu -march=i386 -mno-shstk %s -### -o %t.o 2>&1 | FileCheck -check-prefix=NO-CETSS %s
Expand Down
22 changes: 0 additions & 22 deletions clang/test/Preprocessor/predefined-arch-macros.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,6 @@
// CHECK_SKL_M32: #define __LZCNT__ 1
// CHECK_SKL_M32: #define __MMX__ 1
// CHECK_SKL_M32: #define __MOVBE__ 1
// CHECK_SKL_M32: #define __MPX__ 1
// CHECK_SKL_M32: #define __PCLMUL__ 1
// CHECK_SKL_M32: #define __POPCNT__ 1
// CHECK_SKL_M32: #define __PRFCHW__ 1
Expand Down Expand Up @@ -717,7 +716,6 @@
// CHECK_SKL_M64: #define __LZCNT__ 1
// CHECK_SKL_M64: #define __MMX__ 1
// CHECK_SKL_M64: #define __MOVBE__ 1
// CHECK_SKL_M64: #define __MPX__ 1
// CHECK_SKL_M64: #define __PCLMUL__ 1
// CHECK_SKL_M64: #define __POPCNT__ 1
// CHECK_SKL_M64: #define __PRFCHW__ 1
Expand Down Expand Up @@ -912,7 +910,6 @@
// CHECK_SKX_M32: #define __LZCNT__ 1
// CHECK_SKX_M32: #define __MMX__ 1
// CHECK_SKX_M32: #define __MOVBE__ 1
// CHECK_SKX_M32: #define __MPX__ 1
// CHECK_SKX_M32: #define __PCLMUL__ 1
// CHECK_SKX_M32: #define __PKU__ 1
// CHECK_SKX_M32: #define __POPCNT__ 1
Expand Down Expand Up @@ -958,7 +955,6 @@
// CHECK_SKX_M64: #define __LZCNT__ 1
// CHECK_SKX_M64: #define __MMX__ 1
// CHECK_SKX_M64: #define __MOVBE__ 1
// CHECK_SKX_M64: #define __MPX__ 1
// CHECK_SKX_M64: #define __PCLMUL__ 1
// CHECK_SKX_M64: #define __PKU__ 1
// CHECK_SKX_M64: #define __POPCNT__ 1
Expand Down Expand Up @@ -1008,7 +1004,6 @@
// CHECK_CLX_M32: #define __LZCNT__ 1
// CHECK_CLX_M32: #define __MMX__ 1
// CHECK_CLX_M32: #define __MOVBE__ 1
// CHECK_CLX_M32: #define __MPX__ 1
// CHECK_CLX_M32: #define __PCLMUL__ 1
// CHECK_CLX_M32: #define __PKU__ 1
// CHECK_CLX_M32: #define __POPCNT__ 1
Expand Down Expand Up @@ -1055,7 +1050,6 @@
// CHECK_CLX_M64: #define __LZCNT__ 1
// CHECK_CLX_M64: #define __MMX__ 1
// CHECK_CLX_M64: #define __MOVBE__ 1
// CHECK_CLX_M64: #define __MPX__ 1
// CHECK_CLX_M64: #define __PCLMUL__ 1
// CHECK_CLX_M64: #define __PKU__ 1
// CHECK_CLX_M64: #define __POPCNT__ 1
Expand Down Expand Up @@ -1106,7 +1100,6 @@
// CHECK_CPX_M32: #define __LZCNT__ 1
// CHECK_CPX_M32: #define __MMX__ 1
// CHECK_CPX_M32: #define __MOVBE__ 1
// CHECK_CPX_M32: #define __MPX__ 1
// CHECK_CPX_M32: #define __PCLMUL__ 1
// CHECK_CPX_M32: #define __PKU__ 1
// CHECK_CPX_M32: #define __POPCNT__ 1
Expand Down Expand Up @@ -1154,7 +1147,6 @@
// CHECK_CPX_M64: #define __LZCNT__ 1
// CHECK_CPX_M64: #define __MMX__ 1
// CHECK_CPX_M64: #define __MOVBE__ 1
// CHECK_CPX_M64: #define __MPX__ 1
// CHECK_CPX_M64: #define __PCLMUL__ 1
// CHECK_CPX_M64: #define __PKU__ 1
// CHECK_CPX_M64: #define __POPCNT__ 1
Expand Down Expand Up @@ -1205,7 +1197,6 @@
// CHECK_CNL_M32: #define __LZCNT__ 1
// CHECK_CNL_M32: #define __MMX__ 1
// CHECK_CNL_M32: #define __MOVBE__ 1
// CHECK_CNL_M32: #define __MPX__ 1
// CHECK_CNL_M32: #define __PCLMUL__ 1
// CHECK_CNL_M32: #define __PKU__ 1
// CHECK_CNL_M32: #define __POPCNT__ 1
Expand Down Expand Up @@ -1254,7 +1245,6 @@
// CHECK_CNL_M64: #define __LZCNT__ 1
// CHECK_CNL_M64: #define __MMX__ 1
// CHECK_CNL_M64: #define __MOVBE__ 1
// CHECK_CNL_M64: #define __MPX__ 1
// CHECK_CNL_M64: #define __PCLMUL__ 1
// CHECK_CNL_M64: #define __PKU__ 1
// CHECK_CNL_M64: #define __POPCNT__ 1
Expand Down Expand Up @@ -1309,7 +1299,6 @@
// CHECK_ICL_M32: #define __LZCNT__ 1
// CHECK_ICL_M32: #define __MMX__ 1
// CHECK_ICL_M32: #define __MOVBE__ 1
// CHECK_ICL_M32: #define __MPX__ 1
// CHECK_ICL_M32: #define __PCLMUL__ 1
// CHECK_ICL_M32: #define __PKU__ 1
// CHECK_ICL_M32: #define __POPCNT__ 1
Expand Down Expand Up @@ -1367,7 +1356,6 @@
// CHECK_ICL_M64: #define __LZCNT__ 1
// CHECK_ICL_M64: #define __MMX__ 1
// CHECK_ICL_M64: #define __MOVBE__ 1
// CHECK_ICL_M64: #define __MPX__ 1
// CHECK_ICL_M64: #define __PCLMUL__ 1
// CHECK_ICL_M64: #define __PKU__ 1
// CHECK_ICL_M64: #define __POPCNT__ 1
Expand Down Expand Up @@ -1426,7 +1414,6 @@
// CHECK_ICX_M32: #define __LZCNT__ 1
// CHECK_ICX_M32: #define __MMX__ 1
// CHECK_ICX_M32: #define __MOVBE__ 1
// CHECK_ICX_M32: #define __MPX__ 1
// CHECK_ICX_M32: #define __PCLMUL__ 1
// CHECK_ICX_M32: #define __PCONFIG__ 1
// CHECK_ICX_M32: #define __PKU__ 1
Expand Down Expand Up @@ -1485,7 +1472,6 @@
// CHECK_ICX_M64: #define __LZCNT__ 1
// CHECK_ICX_M64: #define __MMX__ 1
// CHECK_ICX_M64: #define __MOVBE__ 1
// CHECK_ICX_M64: #define __MPX__ 1
// CHECK_ICX_M64: #define __PCLMUL__ 1
// CHECK_ICX_M64: #define __PCONFIG__ 1
// CHECK_ICX_M64: #define __PKU__ 1
Expand Down Expand Up @@ -1548,7 +1534,6 @@
// CHECK_TGL_M32: #define __MOVBE__ 1
// CHECK_TGL_M32: #define __MOVDIR64B__ 1
// CHECK_TGL_M32: #define __MOVDIRI__ 1
// CHECK_TGL_M32: #define __MPX__ 1
// CHECK_TGL_M32: #define __PCLMUL__ 1
// CHECK_TGL_M32-NOT: #define __PCONFIG__ 1
// CHECK_TGL_M32: #define __PKU__ 1
Expand Down Expand Up @@ -1611,7 +1596,6 @@
// CHECK_TGL_M64: #define __MOVBE__ 1
// CHECK_TGL_M64: #define __MOVDIR64B__ 1
// CHECK_TGL_M64: #define __MOVDIRI__ 1
// CHECK_TGL_M64: #define __MPX__ 1
// CHECK_TGL_M64: #define __PCLMUL__ 1
// CHECK_TGL_M64-NOT: #define __PCONFIG__ 1
// CHECK_TGL_M64: #define __PKU__ 1
Expand Down Expand Up @@ -1688,7 +1672,6 @@
// CHECK_GLM_M32: #define __FXSR__ 1
// CHECK_GLM_M32: #define __MMX__ 1
// CHECK_GLM_M32: #define __MOVBE__ 1
// CHECK_GLM_M32: #define __MPX__ 1
// CHECK_GLM_M32: #define __PCLMUL__ 1
// CHECK_GLM_M32: #define __POPCNT__ 1
// CHECK_GLM_M32: #define __PRFCHW__ 1
Expand Down Expand Up @@ -1722,7 +1705,6 @@
// CHECK_GLM_M64: #define __FXSR__ 1
// CHECK_GLM_M64: #define __MMX__ 1
// CHECK_GLM_M64: #define __MOVBE__ 1
// CHECK_GLM_M64: #define __MPX__ 1
// CHECK_GLM_M64: #define __PCLMUL__ 1
// CHECK_GLM_M64: #define __POPCNT__ 1
// CHECK_GLM_M64: #define __PRFCHW__ 1
Expand Down Expand Up @@ -1754,7 +1736,6 @@
// CHECK_GLMP_M32: #define __FXSR__ 1
// CHECK_GLMP_M32: #define __MMX__ 1
// CHECK_GLMP_M32: #define __MOVBE__ 1
// CHECK_GLMP_M32: #define __MPX__ 1
// CHECK_GLMP_M32: #define __PCLMUL__ 1
// CHECK_GLMP_M32: #define __POPCNT__ 1
// CHECK_GLMP_M32: #define __PRFCHW__ 1
Expand Down Expand Up @@ -1791,7 +1772,6 @@
// CHECK_GLMP_M64: #define __FXSR__ 1
// CHECK_GLMP_M64: #define __MMX__ 1
// CHECK_GLMP_M64: #define __MOVBE__ 1
// CHECK_GLMP_M64: #define __MPX__ 1
// CHECK_GLMP_M64: #define __PCLMUL__ 1
// CHECK_GLMP_M64: #define __POPCNT__ 1
// CHECK_GLMP_M64: #define __PRFCHW__ 1
Expand Down Expand Up @@ -1830,7 +1810,6 @@
// CHECK_TRM_M32: #define __MOVBE__ 1
// CHECK_TRM_M32: #define __MOVDIR64B__ 1
// CHECK_TRM_M32: #define __MOVDIRI__ 1
// CHECK_TRM_M32: #define __MPX__ 1
// CHECK_TRM_M32: #define __PCLMUL__ 1
// CHECK_TRM_M32: #define __POPCNT__ 1
// CHECK_TRM_M32: #define __PRFCHW__ 1
Expand Down Expand Up @@ -1872,7 +1851,6 @@
// CHECK_TRM_M64: #define __MOVBE__ 1
// CHECK_TRM_M64: #define __MOVDIR64B__ 1
// CHECK_TRM_M64: #define __MOVDIRI__ 1
// CHECK_TRM_M64: #define __MPX__ 1
// CHECK_TRM_M64: #define __PCLMUL__ 1
// CHECK_TRM_M64: #define __POPCNT__ 1
// CHECK_TRM_M64: #define __PRFCHW__ 1
Expand Down
2 changes: 2 additions & 0 deletions compiler-rt/cmake/config-ix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ endif()

if(OS_NAME MATCHES "Linux")
set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM64})
elseif (OS_NAME MATCHES "Windows")
set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64})
elseif(OS_NAME MATCHES "Android")
set(ALL_FUZZER_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64})
else()
Expand Down
1 change: 1 addition & 0 deletions lldb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ add_subdirectory(docs)

option(LLDB_INCLUDE_TESTS "Generate build targets for the LLDB unit tests." ${LLVM_INCLUDE_TESTS})
if(LLDB_INCLUDE_TESTS)
set(LLDB_TEST_BUILD_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/lldb-test-build.noindex" CACHE PATH "The build root for building tests.")

# Set the path to the default lldb test executable.
set(LLDB_DEFAULT_TEST_EXECUTABLE "${LLVM_RUNTIME_OUTPUT_INTDIR}/lldb${CMAKE_EXECUTABLE_SUFFIX}")
Expand Down
3 changes: 3 additions & 0 deletions lldb/lit/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ endif()
get_property(LLDB_DOTEST_ARGS GLOBAL PROPERTY LLDB_DOTEST_ARGS_PROPERTY)
set(dotest_args_replacement ${LLVM_BUILD_MODE})

set(LLDB_TEST_MODULE_CACHE_LLDB "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-lldb" CACHE PATH "The Clang module cache used by the Clang embedded in LLDB while running tests.")
set(LLDB_TEST_MODULE_CACHE_CLANG "${LLDB_TEST_BUILD_DIRECTORY}/module-cache-clang" CACHE PATH "The Clang module cache used by the Clang while building tests.")

if(LLDB_BUILT_STANDALONE)
# In paths to our build-tree, replace CMAKE_CFG_INTDIR with our configuration name placeholder.
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} config_runtime_output_dir ${LLVM_RUNTIME_OUTPUT_INTDIR})
Expand Down
4 changes: 4 additions & 0 deletions lldb/lit/Settings/TestModuleCacheSanity.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# This is a sanity check that verifies that the module cache path is set
# correctly and points inside the default test build directory.
RUN: %lldb -o 'settings show symbols.clang-modules-cache-path' | FileCheck %s
CHECK: lldb-test-build.noindex{{.*}}module-cache-lldb
6 changes: 6 additions & 0 deletions lldb/lit/Suite/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ if config.dotest_lit_args_str:
if config.llvm_libs_dir:
dotest_cmd += ['--env', 'LLVM_LIBS_DIR=' + config.llvm_libs_dir]

if config.lldb_build_directory:
dotest_cmd += ['--build-dir', config.lldb_build_directory]

if config.lldb_module_cache:
dotest_cmd += ['--module-cache-dir', config.lldb_module_cache]

# Load LLDB test format.
sys.path.append(os.path.join(config.lldb_src_root, "lit", "Suite"))
import lldbtest
Expand Down
3 changes: 3 additions & 0 deletions lldb/lit/Suite/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ config.host_os = "@HOST_OS@"
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.llvm_use_sanitizer = "@LLVM_USE_SANITIZER@"
config.target_triple = "@TARGET_TRIPLE@"
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@"
config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@"
config.python_executable = "@PYTHON_EXECUTABLE@"
config.dotest_path = "@LLDB_SOURCE_DIR@/test/dotest.py"
config.dotest_args_str = "@LLDB_DOTEST_ARGS@"
Expand Down
3 changes: 3 additions & 0 deletions lldb/lit/helper/toolchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def use_support_substitutions(config):
flags += ['-L' + config.llvm_libs_dir,
'-Wl,-rpath,' + config.llvm_libs_dir]

# The clang module cache is used for building inferiors.
flags += ['-fmodules-cache-path={}'.format(config.clang_module_cache)]

additional_tool_dirs=[]
if config.lldb_lit_tools_dir:
additional_tool_dirs.append(config.lldb_lit_tools_dir)
Expand Down
1 change: 1 addition & 0 deletions lldb/lit/lit-lldb-init.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
settings set symbols.enable-external-lookup false
settings set plugin.process.gdb-remote.packet-timeout 60
settings set interpreter.echo-comment-commands false
settings set symbols.clang-modules-cache-path "@LLDB_TEST_MODULE_CACHE_LLDB@"
11 changes: 4 additions & 7 deletions lldb/lit/lit.cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,10 @@ def calculate_arch_features(arch_string):
('--targets-built', calculate_arch_features)
])

# Clean the module caches in the test build directory. This is
# necessary in an incremental build whenever clang changes underneath,
# so doing it once per lit.py invocation is close enough.

for i in ['module-cache-clang', 'module-cache-lldb']:
cachedir = os.path.join(config.lldb_libs_dir, '..',
'lldb-test-build.noindex', i)
# Clean the module caches in the test build directory. This is necessary in an
# incremental build whenever clang changes underneath, so doing it once per
# lit.py invocation is close enough.
for cachedir in [config.clang_module_cache, config.lldb_module_cache]:
if os.path.isdir(cachedir):
print("Deleting module cache at %s."%cachedir)
shutil.rmtree(cachedir)
Expand Down
3 changes: 3 additions & 0 deletions lldb/lit/lit.site.cfg.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ config.have_zlib = @LLVM_ENABLE_ZLIB@
config.host_triple = "@LLVM_HOST_TRIPLE@"
config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
config.lldb_module_cache = "@LLDB_TEST_MODULE_CACHE_LLDB@"
config.clang_module_cache = "@LLDB_TEST_MODULE_CACHE_CLANG@"

# Support substitution of the tools and libs dirs with user parameters. This is
# used when we can't determine the tool dir at configuration time.
Expand Down
3 changes: 3 additions & 0 deletions lldb/packages/Python/lldbsuite/test/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@
# The base directory in which the tests are being built.
test_build_dir = None

# The clang module cache directory used by lldb.
module_cache_dir = None

# The only directory to scan for tests. If multiple test directories are
# specified, and an exclusive test subdirectory is specified, the latter option
# takes precedence.
Expand Down
Loading