forked from OSchip/llvm-project
Makefile.rules: Use a shared clang module cache directory.
Just to be safe, up until now each test used its own Clang module cache directory. Since the compiler within one testsuite doesn't change it is just as safe to share a clang module directory inside the LLDB test build directory. This saves us from compiling tens of gigabytes of redundant Darwin and Foundation .pcm files and also speeds up running the test suite quite significantly. rdar://problem/36002081 Differential Revision: https://reviews.llvm.org/D54601 llvm-svn: 347056
This commit is contained in:
parent
5ebd2a785e
commit
d1b33162b5
|
@ -4,9 +4,9 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import re
|
import re
|
||||||
import platform
|
import platform
|
||||||
|
import shutil
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
|
||||||
import lit.util
|
import lit.util
|
||||||
import lit.formats
|
import lit.formats
|
||||||
from lit.llvm import llvm_config
|
from lit.llvm import llvm_config
|
||||||
|
@ -124,3 +124,12 @@ llvm_config.feature_config(
|
||||||
('--build-mode', {'DEBUG': 'debug'}),
|
('--build-mode', {'DEBUG': 'debug'}),
|
||||||
('--targets-built', calculate_arch_features)
|
('--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']:
|
||||||
|
cachedir = os.path.join(config.llvm_obj_root, 'lldb-test-build.noindex', i)
|
||||||
|
if os.path.isdir(cachedir):
|
||||||
|
print("Deleting module cache at %s."%cachedir)
|
||||||
|
shutil.rmtree(cachedir)
|
||||||
|
|
|
@ -33,7 +33,6 @@ BUILDDIR := $(shell pwd)
|
||||||
THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/
|
THIS_FILE_DIR := $(shell dirname $(lastword $(MAKEFILE_LIST)))/
|
||||||
LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
|
LLDB_BASE_DIR := $(THIS_FILE_DIR)../../../../../
|
||||||
|
|
||||||
|
|
||||||
#----------------------------------------------------------------------
|
#----------------------------------------------------------------------
|
||||||
# If OS is not defined, use 'uname -s' to determine the OS name.
|
# If OS is not defined, use 'uname -s' to determine the OS name.
|
||||||
#
|
#
|
||||||
|
@ -253,7 +252,16 @@ ifeq "$(MAKE_DWO)" "YES"
|
||||||
CFLAGS += -gsplit-dwarf
|
CFLAGS += -gsplit-dwarf
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
# Use a shared module cache when building in the default test build directory.
|
||||||
|
ifeq "$(findstring lldb-test-build.noindex, $(BUILDDIR))" ""
|
||||||
CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
|
CLANG_MODULE_CACHE_DIR := $(BUILDDIR)/module-cache
|
||||||
|
else
|
||||||
|
CLANG_MODULE_CACHE_DIR := $(shell echo "$(BUILDDIR)" | sed 's/lldb-test-build.noindex.*/lldb-test-build.noindex\/module-cache-clang/')
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq "$(CLANG_MODULE_CACHE_DIR)" ""
|
||||||
|
$(error failed to set the shared clang module cache dir)
|
||||||
|
endif
|
||||||
|
|
||||||
MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules -fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)
|
MANDATORY_MODULE_BUILD_CFLAGS := -fmodules -gmodules -fmodules-cache-path=$(CLANG_MODULE_CACHE_DIR)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue