Skip to content

Commit d01c8c2

Browse files
authored
Merge pull request #6068 from akyrtzi/pr/stable/include-tree-default
[stable/20220421][clang-cache] Make the include-tree the default and use `CLANG_CACHE_USE_CASFS_DEPSCAN` for switching to casfs depscanning
2 parents 4a53b0a + 7e5f176 commit d01c8c2

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

clang/test/CAS/driver-cache-launcher.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@
2222
// CLANGPP: "-greproducible"
2323
// CLANGPP: "-x" "c++"
2424

25-
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_ENABLE_INCLUDE_TREE=1 %clang-cache %clang -c %s -o %t.o -### 2>&1 | FileCheck %s -check-prefix=INCLUDE-TREE -DPREFIX=%t
25+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache %clang -c %s -o %t.o -### 2>&1 | FileCheck %s -check-prefix=INCLUDE-TREE -DPREFIX=%t
2626
// INCLUDE-TREE: "-cc1depscan" "-fdepscan=auto"
2727
// INCLUDE-TREE: "-fdepscan-include-tree"
2828

29+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_USE_CASFS_DEPSCAN=1 %clang-cache %clang -c %s -o %t.o -### 2>&1 | FileCheck %s -check-prefix=CASFS-SCAN -DPREFIX=%t
30+
// CASFS-SCAN-NOT: "-fdepscan-include-tree"
31+
2932
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas cache-build-session %clang-cache %clang -c %s -o %t.o -### 2>&1 | FileCheck %s -check-prefix=SESSION -DPREFIX=%t
3033
// SESSION: "-cc1depscan" "-fdepscan=daemon" "-fdepscan-share-identifier"
3134
// SESSION: "-fcas-path" "[[PREFIX]]/cas/cas" "-faction-cache-path" "[[PREFIX]]/cas/actioncache"

clang/test/CAS/fcache-compile-job-serialized-diagnostics.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,20 +38,20 @@
3838
// Using normal compilation as baseline.
3939
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -arch=nonexistent --serialize-diagnostics %t/t1.diag \
4040
// RUN: 2>&1 | FileCheck %s -check-prefix=WARN
41-
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
41+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_USE_CASFS_DEPSCAN=1 %clang-cache \
4242
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -arch=nonexistent --serialize-diagnostics %t/t2.diag \
4343
// RUN: 2>&1 | FileCheck %s -check-prefix=WARN
44-
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_ENABLE_INCLUDE_TREE=1 %clang-cache \
44+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
4545
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -arch=nonexistent --serialize-diagnostics %t/t2.inc.diag \
4646
// RUN: 2>&1 | FileCheck %s -check-prefix=WARN
4747
// RUN: diff %t/t1.diag %t/t2.diag
4848
// RUN: diff %t/t1.diag %t/t2.inc.diag
4949

5050
// Try again with cache hit.
5151
// RUN: rm %t/t2.diag
52-
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
52+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_USE_CASFS_DEPSCAN=1 %clang-cache \
5353
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -arch=nonexistent --serialize-diagnostics %t/t2.diag
54-
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_ENABLE_INCLUDE_TREE=1 %clang-cache \
54+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
5555
// RUN: %clang -target x86_64-apple-macos11 -c %s -o %t/t.o -arch=nonexistent --serialize-diagnostics %t/t2.inc.diag \
5656
// RUN: 2>&1 | FileCheck %s -check-prefix=WARN
5757
// RUN: diff %t/t1.diag %t/t2.diag

clang/test/CAS/include-tree-with-sanitizer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// RUN: touch %t/asan_ignorelist.txt
33
// RUN: touch %t/sys_asan_ignorelist.txt
44

5-
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas CLANG_CACHE_ENABLE_INCLUDE_TREE=1 %clang-cache \
5+
// RUN: env LLVM_CACHE_CAS_PATH=%t/cas %clang-cache \
66
// RUN: %clang -fsanitize=address -Xclang -fsanitize-ignorelist=%t/asan_ignorelist.txt -Xclang -fsanitize-system-ignorelist=%t/sys_asan_ignorelist.txt \
77
// RUN: -target x86_64-apple-macos11 -c %s -o %t/output.o -Rcompile-job-cache 2> %t/output-tree.txt
88

clang/test/CAS/path-independent-cas-outputs.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,12 @@
5858
// RUN: diff %t/a/t1.d %t/b/t2.d
5959
// RUN: diff %t/t.d %t/a/t1.d
6060

61-
// Baseline to check we got expected output.
62-
// RUN: %clang -target x86_64-apple-macos11 -x c-header %s -o %t/t.pch -Xclang -fno-pch-timestamp
6361
// RUN: env LLVM_CACHE_CAS_PATH=%t/a/cas %clang-cache \
6462
// RUN: %clang -target x86_64-apple-macos11 -x c-header %s -o %t/a/t1.pch
6563
// RUN: env LLVM_CACHE_CAS_PATH=%t/b/cas %clang-cache \
6664
// RUN: %clang -target x86_64-apple-macos11 -x c-header %s -o %t/b/t2.pch
6765

6866
// RUN: diff %t/a/t1.pch %t/b/t2.pch
69-
// RUN: diff %t/t.pch %t/a/t1.pch
7067

7168
// Check that caching is independent of whether '--serialize-diagnostics' exists or not.
7269

clang/tools/driver/CacheLauncherMode.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,19 +86,19 @@ static int executeAsProcess(ArrayRef<const char *> Args,
8686
/// functionalities.
8787
static void addCommonArgs(bool ForDriver, SmallVectorImpl<const char *> &Args,
8888
llvm::StringSaver &Saver) {
89-
if (::getenv("CLANG_CACHE_ENABLE_INCLUDE_TREE")) {
89+
if (!llvm::sys::Process::GetEnv("CLANG_CACHE_USE_CASFS_DEPSCAN")) {
9090
Args.push_back("-fdepscan-include-tree");
9191
}
92-
if (const char *CASPath = ::getenv("LLVM_CACHE_CAS_PATH")) {
93-
llvm::SmallString<256> CASArg(CASPath);
92+
if (auto CASPath = llvm::sys::Process::GetEnv("LLVM_CACHE_CAS_PATH")) {
93+
llvm::SmallString<256> CASArg(*CASPath);
9494
llvm::sys::path::append(CASArg, "cas");
9595
if (ForDriver) {
9696
Args.append({"-Xclang", "-fcas-path", "-Xclang",
9797
Saver.save(CASArg.str()).data()});
9898
} else {
9999
Args.append({"-fcas-path", Saver.save(CASArg.str()).data()});
100100
}
101-
llvm::SmallString<256> CacheArg(CASPath);
101+
llvm::SmallString<256> CacheArg(*CASPath);
102102
llvm::sys::path::append(CacheArg, "actioncache");
103103
if (ForDriver) {
104104
Args.append({"-Xclang", "-faction-cache-path", "-Xclang",

0 commit comments

Comments
 (0)