[llvm-branch-commits] [clang] 5f53d28 - Revert "[clang-scan-deps] Support clang-cl"
Sylvain Audi via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Mon Dec 14 10:38:13 PST 2020
Author: Sylvain Audi
Date: 2020-12-14T13:32:38-05:00
New Revision: 5f53d28fa68142bbd9dfb2b33f955352b180d776
URL: https://github.com/llvm/llvm-project/commit/5f53d28fa68142bbd9dfb2b33f955352b180d776
DIFF: https://github.com/llvm/llvm-project/commit/5f53d28fa68142bbd9dfb2b33f955352b180d776.diff
LOG: Revert "[clang-scan-deps] Support clang-cl"
Reverting, as it breaks build on mac.
This reverts commit 640ad769110f76d3391667249478ece88c835529.
Added:
Modified:
clang/test/ClangScanDeps/Inputs/has_include_if_elif.json
clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json
clang/test/ClangScanDeps/Inputs/headerwithdirname.json
clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json
clang/test/ClangScanDeps/Inputs/no-werror.json
clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json
clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json
clang/test/ClangScanDeps/Inputs/target-filename-cdb.json
clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json
clang/test/ClangScanDeps/error.cpp
clang/test/ClangScanDeps/has_include_if_elif.cpp
clang/test/ClangScanDeps/header_stat_before_open.m
clang/test/ClangScanDeps/headerwithdirname.cpp
clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp
clang/test/ClangScanDeps/modules-full.cpp
clang/test/ClangScanDeps/modules.cpp
clang/test/ClangScanDeps/no-werror.cpp
clang/test/ClangScanDeps/regular_cdb.cpp
clang/test/ClangScanDeps/static-analyzer.c
clang/test/ClangScanDeps/strip_diag_serialize.cpp
clang/test/ClangScanDeps/target-filename.cpp
clang/test/ClangScanDeps/vfsoverlay.cpp
clang/tools/clang-scan-deps/ClangScanDeps.cpp
Removed:
clang/test/ClangScanDeps/Inputs/modules_cdb_clangcl.json
clang/test/ClangScanDeps/Inputs/regular_cdb_clangcl.json
################################################################################
diff --git a/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json b/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json
index 6959ce8986c9..36ca006b0329 100644
--- a/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json
+++ b/clang/test/ClangScanDeps/Inputs/has_include_if_elif.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -E DIR/has_include_if_elif2.cpp -IInputs",
"file": "DIR/has_include_if_elif2.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/has_include_if_elif2_clangcl.cpp /IInputs",
- "file": "DIR/has_include_if_elif2_clangcl.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json b/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json
index 797966c5684a..c5f027e9fd28 100644
--- a/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json
+++ b/clang/test/ClangScanDeps/Inputs/header_stat_before_open_cdb.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -E DIR/header_stat_before_open_input.m -iframework Inputs/frameworks",
"file": "DIR/header_stat_before_open_input.m"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/header_stat_before_open_input_clangcl.m -Xclang -iframework -Xclang Inputs/frameworks",
- "file": "DIR/header_stat_before_open_input_clangcl.m"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/headerwithdirname.json b/clang/test/ClangScanDeps/Inputs/headerwithdirname.json
index 980fb3d34426..2ae561935bec 100644
--- a/clang/test/ClangScanDeps/Inputs/headerwithdirname.json
+++ b/clang/test/ClangScanDeps/Inputs/headerwithdirname.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -c -IDIR -IDIR/foodir -IInputs DIR/headerwithdirname_input.cpp",
"file": "DIR/headerwithdirname_input.cpp"
- },
- {
- "directory": "DIR",
- "command": "clang-cl /c /IDIR /IDIR/foodir -IInputs DIR/headerwithdirname_input_clangcl.cpp",
- "file": "DIR/headerwithdirname_input_clangcl.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json b/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json
index a69637358a13..de7759d0b110 100644
--- a/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json
+++ b/clang/test/ClangScanDeps/Inputs/headerwithdirnamefollowedbyinclude.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -c -IDIR -IInputs DIR/headerwithdirname_input.cpp",
"file": "DIR/headerwithdirname_input.cpp"
- },
- {
- "directory": "DIR",
- "command": "clang-cl /c /IDIR /IInputs DIR/headerwithdirname_input_clangcl.cpp",
- "file": "DIR/headerwithdirname_input_clangcl.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/modules_cdb_clangcl.json b/clang/test/ClangScanDeps/Inputs/modules_cdb_clangcl.json
deleted file mode 100644
index 1d46af13c384..000000000000
--- a/clang/test/ClangScanDeps/Inputs/modules_cdb_clangcl.json
+++ /dev/null
@@ -1,22 +0,0 @@
-[
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/modules_cdb_input2.cpp /IInputs /D INCLUDE_HEADER2 /clang:-MD /clang:-MF /clang:DIR/modules_cdb2_clangcl.d /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps",
- "file": "DIR/modules_cdb_input2.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/modules_cdb_input.cpp /IInputs /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps",
- "file": "DIR/modules_cdb_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/modules_cdb_input.cpp /IInputs /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps -o a.o",
- "file": "DIR/modules_cdb_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/modules_cdb_input.cpp /IInputs /clang:-fmodules /clang:-fcxx-modules /clang:-fmodules-cache-path=DIR/module-cache_clangcl /clang:-fimplicit-modules /clang:-fimplicit-module-maps -o b.o",
- "file": "DIR/modules_cdb_input.cpp"
-}
-]
diff --git a/clang/test/ClangScanDeps/Inputs/no-werror.json b/clang/test/ClangScanDeps/Inputs/no-werror.json
index 1e1f68892e08..2d1f46cf3af2 100644
--- a/clang/test/ClangScanDeps/Inputs/no-werror.json
+++ b/clang/test/ClangScanDeps/Inputs/no-werror.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -E DIR/no-werror_input.cpp -IInputs -std=c++17 -Weverything -Werror",
"file": "DIR/no-werror.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/no-werror_input_clangcl.cpp /IInputs /std:c++17 -Weverything -Werror",
- "file": "DIR/no-werror_clangcl.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/regular_cdb_clangcl.json b/clang/test/ClangScanDeps/Inputs/regular_cdb_clangcl.json
deleted file mode 100644
index 93ce93d3be6f..000000000000
--- a/clang/test/ClangScanDeps/Inputs/regular_cdb_clangcl.json
+++ /dev/null
@@ -1,17 +0,0 @@
-[
-{
- "directory": "DIR",
- "command": "clang --driver-mode=cl /E DIR/regular_cdb_input2.cpp /IInputs /D INCLUDE_HEADER2 /clang:-MD /clang:-MF /clang:DIR/regular_cdb2_clangcl.d",
- "file": "DIR/regular_cdb_input2.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/regular_cdb_input.cpp /IInputs",
- "file": "DIR/regular_cdb_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/regular_cdb_input.cpp /IInputs /Foadena.o",
- "file": "DIR/regular_cdb_input.cpp"
-}
-]
diff --git a/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json b/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json
index 6f1e882993b5..a466d87afaa4 100644
--- a/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json
+++ b/clang/test/ClangScanDeps/Inputs/static-analyzer-cdb.json
@@ -1,12 +1,7 @@
[
{
"directory": "DIR",
- "command": "clang --analyze DIR/static-analyzer_clang.c",
- "file": "DIR/static-analyzer_clang.c"
-},
-{
- "directory": "DIR",
- "command": "clang-cl --analyze DIR/static-analyzer_clangcl.c",
- "file": "DIR/static-analyzer_clangcl.c"
+ "command": "clang --analyze DIR/static-analyzer.c",
+ "file": "DIR/static-analyzer.c"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json b/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json
index 1e40403502eb..a774d95a3b02 100644
--- a/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json
+++ b/clang/test/ClangScanDeps/Inputs/strip_diag_serialize.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -E -fsyntax-only DIR/strip_diag_serialize_input.cpp --serialize-diagnostics /does/not/exist",
"file": "DIR/strip_diag_serialize_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/strip_diag_serialize_input_clangcl.cpp --serialize-diagnostics A:/does/not/exist",
- "file": "DIR/strip_diag_serialize_input_clangcl.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/target-filename-cdb.json b/clang/test/ClangScanDeps/Inputs/target-filename-cdb.json
index f7dfdc9c510f..af2e43e4e171 100644
--- a/clang/test/ClangScanDeps/Inputs/target-filename-cdb.json
+++ b/clang/test/ClangScanDeps/Inputs/target-filename-cdb.json
@@ -18,50 +18,5 @@
"directory": "DIR",
"command": "clang -E DIR/target-filename_input.cpp -o first.o -o last.o",
"file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp -o clangcl-a.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp -oclangcl-b.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp /o clangcl-c.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp /oclangcl-d.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp /Foclangcl-e.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp -o clangcl-firstf.o -o clangcl-lastf.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp /oclangcl-firstg.o /Foclangcl-lastg.o",
- "file": "DIR/target-filename_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/target-filename_input.cpp /Foclangcl-firsth.o -o clangcl-midh.o /oclangcl-lasth.o",
- "file": "DIR/target-filename_input.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json b/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json
index db43d87039af..779203bac674 100644
--- a/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json
+++ b/clang/test/ClangScanDeps/Inputs/vfsoverlay_cdb.json
@@ -3,10 +3,5 @@
"directory": "DIR",
"command": "clang -E DIR/vfsoverlay_input.cpp -IInputs -ivfsoverlay DIR/vfsoverlay.yaml",
"file": "DIR/vfsoverlay_input.cpp"
-},
-{
- "directory": "DIR",
- "command": "clang-cl /E DIR/vfsoverlay_input_clangcl.cpp /IInputs -Xclang -ivfsoverlay -Xclang DIR/vfsoverlay.yaml",
- "file": "DIR/vfsoverlay_input_clangcl.cpp"
}
]
diff --git a/clang/test/ClangScanDeps/error.cpp b/clang/test/ClangScanDeps/error.cpp
index e18bf302af26..e4e052527890 100644
--- a/clang/test/ClangScanDeps/error.cpp
+++ b/clang/test/ClangScanDeps/error.cpp
@@ -3,16 +3,11 @@
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/regular_cdb_input.cpp
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb
-// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb_clangcl.json > %t_clangcl.cdb
//
// RUN: not clang-scan-deps -compilation-database %t.cdb -j 1 2>%t.dir/errs
// RUN: echo EOF >> %t.dir/errs
// RUN: FileCheck %s --input-file %t.dir/errs
-// RUN: not clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 2>%t.dir/errs_clangcl
-// RUN: echo EOF >> %t.dir/errs_clangcl
-// RUN: FileCheck %s --input-file %t.dir/errs_clangcl
-
#include "missing.h"
// CHECK: Error while scanning dependencies
diff --git a/clang/test/ClangScanDeps/has_include_if_elif.cpp b/clang/test/ClangScanDeps/has_include_if_elif.cpp
index 17eda40c1662..dd56ecac69db 100644
--- a/clang/test/ClangScanDeps/has_include_if_elif.cpp
+++ b/clang/test/ClangScanDeps/has_include_if_elif.cpp
@@ -2,7 +2,6 @@
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/has_include_if_elif2.cpp
-// RUN: cp %s %t.dir/has_include_if_elif2_clangcl.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header2.h
@@ -37,9 +36,3 @@
// CHECK-NEXT: Inputs{{/|\\}}header2.h
// CHECK-NEXT: Inputs{{/|\\}}header3.h
// CHECK-NEXT: Inputs{{/|\\}}header4.h
-
-// CHECK: has_include_if_elif2_clangcl.cpp
-// CHECK-NEXT: Inputs{{/|\\}}header.h
-// CHECK-NEXT: Inputs{{/|\\}}header2.h
-// CHECK-NEXT: Inputs{{/|\\}}header3.h
-// CHECK-NEXT: Inputs{{/|\\}}header4.h
diff --git a/clang/test/ClangScanDeps/header_stat_before_open.m b/clang/test/ClangScanDeps/header_stat_before_open.m
index ce6f58f434ae..f9f7d240f2c1 100644
--- a/clang/test/ClangScanDeps/header_stat_before_open.m
+++ b/clang/test/ClangScanDeps/header_stat_before_open.m
@@ -2,7 +2,6 @@
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/header_stat_before_open_input.m
-// RUN: cp %s %t.dir/header_stat_before_open_input_clangcl.m
// RUN: mkdir %t.dir/Inputs
// RUN: cp -R %S/Inputs/frameworks %t.dir/Inputs/frameworks
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/header_stat_before_open_cdb.json > %t.cdb
@@ -17,8 +16,3 @@
// CHECK-NEXT: header_stat_before_open_input.m
// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h
// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}PrivateHeaders{{/|\\}}PrivateHeader.h
-
-// CHECK: header_stat_before_open_input_clangcl.o
-// CHECK-NEXT: header_stat_before_open_input_clangcl.m
-// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}Headers{{/|\\}}Framework.h
-// CHECK-NEXT: Inputs{{/|\\}}frameworks{{/|\\}}Framework.framework{{/|\\}}PrivateHeaders{{/|\\}}PrivateHeader.h
diff --git a/clang/test/ClangScanDeps/headerwithdirname.cpp b/clang/test/ClangScanDeps/headerwithdirname.cpp
index b6c7f796e90e..b0f60333aa4c 100644
--- a/clang/test/ClangScanDeps/headerwithdirname.cpp
+++ b/clang/test/ClangScanDeps/headerwithdirname.cpp
@@ -4,7 +4,6 @@
// RUN: mkdir -p %t.dir
// RUN: mkdir -p %t.dir/foodir
// RUN: cp %s %t.dir/headerwithdirname_input.cpp
-// RUN: cp %s %t.dir/headerwithdirname_input_clangcl.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/foodir %t.dir/Inputs/foodir
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/headerwithdirname.json > %t.cdb
@@ -16,7 +15,3 @@
// CHECK: headerwithdirname_input.o
// CHECK-NEXT: headerwithdirname_input.cpp
// CHECK-NEXT: Inputs{{/|\\}}foodir
-
-// CHECK: headerwithdirname_input_clangcl.o
-// CHECK-NEXT: headerwithdirname_input_clangcl.cpp
-// CHECK-NEXT: Inputs{{/|\\}}foodir
diff --git a/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp b/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp
index 1f9133dc74e8..e8e8a69e82e2 100644
--- a/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp
+++ b/clang/test/ClangScanDeps/headerwithdirnamefollowedbyinclude.cpp
@@ -7,7 +7,6 @@
// RUN: cp %S/Inputs/header.h %t.dir/foodir/foodirheader.h
// RUN: cp %s %t.dir/headerwithdirname_input.cpp
-// RUN: cp %s %t.dir/headerwithdirname_input_clangcl.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/foodir %t.dir/Inputs/foodir
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/headerwithdirnamefollowedbyinclude.json > %t.cdb
@@ -20,7 +19,3 @@
// CHECK: headerwithdirname_input.o
// CHECK-NEXT: headerwithdirname_input.cpp
// CHECK-NEXT: Inputs{{/|\\}}foodir
-
-// CHECK: headerwithdirname_input_clangcl.o
-// CHECK-NEXT: headerwithdirname_input_clangcl.cpp
-// CHECK-NEXT: Inputs{{/|\\}}foodir
diff --git a/clang/test/ClangScanDeps/modules-full.cpp b/clang/test/ClangScanDeps/modules-full.cpp
index db2549670392..1e6a740c2739 100644
--- a/clang/test/ClangScanDeps/modules-full.cpp
+++ b/clang/test/ClangScanDeps/modules-full.cpp
@@ -8,18 +8,12 @@
// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb
-// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl.json > %t_clangcl.cdb
//
// RUN: echo %t.dir > %t.result
// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -full-command-line \
// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t.result
// RUN: cat %t.result | sed 's/\\/\//g' | FileCheck --check-prefixes=CHECK %s
-// RUN: echo %t.dir > %t_clangcl.result
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 4 -full-command-line \
-// RUN: -mode preprocess-minimized-sources -format experimental-full >> %t_clangcl.result
-// RUN: cat %t_clangcl.result | sed 's/\\/\//g' | FileCheck --check-prefixes=CHECK %s
-
// FIXME: Backslash issues.
// XFAIL: system-windows
@@ -39,7 +33,7 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps",
-// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
+// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "context-hash": "[[CONTEXT_HASH_H1]]",
@@ -90,7 +84,7 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps",
-// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
+// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "file-deps": [
@@ -109,7 +103,7 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps",
-// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
+// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "file-deps": [
@@ -128,7 +122,7 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps",
-// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
+// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H2]]/header1-{{[A-Z0-9]+}}.pcm",
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "file-deps": [
@@ -147,9 +141,9 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps",
-// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
+// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm",
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap",
-// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm",
+// CHECK-NEXT: "-fmodule-file=[[PREFIX]]/module-cache/[[CONTEXT_HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm",
// CHECK-NEXT: "-fmodule-map-file=[[PREFIX]]/Inputs/module.modulemap"
// CHECK-NEXT: ],
// CHECK-NEXT: "file-deps": [
diff --git a/clang/test/ClangScanDeps/modules.cpp b/clang/test/ClangScanDeps/modules.cpp
index f0d97dc0c5c2..599fcd1b4353 100644
--- a/clang/test/ClangScanDeps/modules.cpp
+++ b/clang/test/ClangScanDeps/modules.cpp
@@ -1,8 +1,6 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t.cdb
-// RUN: rm -rf %t_clangcl.cdb
// RUN: rm -rf %t.module-cache
-// RUN: rm -rf %t.module-cache_clangcl
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/modules_cdb_input.cpp
// RUN: cp %s %t.dir/modules_cdb_input2.cpp
@@ -11,12 +9,9 @@
// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
// RUN: cp %S/Inputs/module.modulemap %t.dir/Inputs/module.modulemap
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb.json > %t.cdb
-// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/modules_cdb_clangcl.json > %t_clangcl.cdb
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-minimized-sources | \
-// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO %s
//
// The output order is non-deterministic when using more than one thread,
// so check the output using two runs. Note that the 'NOT' check is not used
@@ -25,20 +20,12 @@
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefix=CHECK1 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-minimized-sources | \
-// RUN: FileCheck --check-prefix=CHECK1 %s
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
// RUN: FileCheck --check-prefix=CHECK1 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \
-// RUN: FileCheck --check-prefix=CHECK1 %s
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefix=CHECK2 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-minimized-sources | \
-// RUN: FileCheck --check-prefix=CHECK2 %s
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
// RUN: FileCheck --check-prefix=CHECK2 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \
-// RUN: FileCheck --check-prefix=CHECK2 %s
#include "header.h"
diff --git a/clang/test/ClangScanDeps/no-werror.cpp b/clang/test/ClangScanDeps/no-werror.cpp
index 11f1b718dac5..95407c51b3cc 100644
--- a/clang/test/ClangScanDeps/no-werror.cpp
+++ b/clang/test/ClangScanDeps/no-werror.cpp
@@ -2,7 +2,6 @@
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/no-werror_input.cpp
-// RUN: cp %s %t.dir/no-werror_input_clangcl.cpp
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/sys-header.h %t.dir/Inputs/sys-header.h
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/no-werror.json > %t.cdb
@@ -15,6 +14,3 @@
// CHECK: no-werror_input.cpp
// CHECK-NEXT: Inputs{{/|\\}}sys-header.h
-
-// CHECK: no-werror_input_clangcl.cpp
-// CHECK-NEXT: Inputs{{/|\\}}sys-header.h
diff --git a/clang/test/ClangScanDeps/regular_cdb.cpp b/clang/test/ClangScanDeps/regular_cdb.cpp
index d7ba2519067e..8fb94350e4c2 100644
--- a/clang/test/ClangScanDeps/regular_cdb.cpp
+++ b/clang/test/ClangScanDeps/regular_cdb.cpp
@@ -1,6 +1,5 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t.cdb
-// RUN: rm -rf %t_clangcl.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/regular_cdb_input.cpp
// RUN: cp %s %t.dir/regular_cdb_input2.cpp
@@ -8,28 +7,17 @@
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
// RUN: cp %S/Inputs/header2.h %t.dir/Inputs/header2.h
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb.json > %t.cdb
-// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/regular_cdb_clangcl.json > %t_clangcl.cdb
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-minimized-sources | \
-// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
-
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess | \
// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess | \
-// RUN: FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
-
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -mode preprocess-minimized-sources \
// RUN: -skip-excluded-pp-ranges=0 | FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 1 -mode preprocess-minimized-sources \
-// RUN: -skip-excluded-pp-ranges=0 | FileCheck --check-prefixes=CHECK1,CHECK2,CHECK2NO,CHECK3 %s
//
// Make sure we didn't produce any dependency files!
// RUN: not cat %t.dir/regular_cdb.d
-// RUN: not cat %t.dir/regular_cdb_clangcl.d
// RUN: not cat %t.dir/regular_cdb2.d
-// RUN: not cat %t.dir/regular_cdb2_clangcl.d
//
// The output order is non-deterministic when using more than one thread,
// so check the output using two runs. Note that the 'NOT' check is not used
@@ -38,23 +26,12 @@
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefix=CHECK1 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-minimized-sources | \
-// RUN: FileCheck --check-prefix=CHECK1 %s
-
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
// RUN: FileCheck --check-prefix=CHECK1 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \
-// RUN: FileCheck --check-prefix=CHECK1 %s
-
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess-minimized-sources | \
// RUN: FileCheck --check-prefix=CHECK2 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess-minimized-sources | \
-// RUN: FileCheck --check-prefix=CHECK2 %s
-
// RUN: clang-scan-deps -compilation-database %t.cdb -j 2 -mode preprocess | \
// RUN: FileCheck --check-prefix=CHECK2 %s
-// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 2 -mode preprocess | \
-// RUN: FileCheck --check-prefix=CHECK2 %s
#include "header.h"
diff --git a/clang/test/ClangScanDeps/static-analyzer.c b/clang/test/ClangScanDeps/static-analyzer.c
index 053e4573d056..c4af9b076bb2 100644
--- a/clang/test/ClangScanDeps/static-analyzer.c
+++ b/clang/test/ClangScanDeps/static-analyzer.c
@@ -1,8 +1,7 @@
// RUN: rm -rf %t.dir
// RUN: rm -rf %t-cdb.json
// RUN: mkdir -p %t.dir
-// RUN: cp %s %t.dir/static-analyzer_clang.c
-// RUN: cp %s %t.dir/static-analyzer_clangcl.c
+// RUN: cp %s %t.dir/static-analyzer.c
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/analyze_header_input.h
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/static-analyzer-cdb.json > %t-cdb.json
@@ -13,9 +12,5 @@
#include "Inputs/analyze_header_input.h"
#endif
-// CHECK: static-analyzer_clang.c
-// CHECK-NEXT: analyze_header_input.h
-
-// CHECK: static-analyzer_clangcl.c
-// CHECK-NEXT: analyze_header_input.h
+// CHECK: analyze_header_input.h
diff --git a/clang/test/ClangScanDeps/strip_diag_serialize.cpp b/clang/test/ClangScanDeps/strip_diag_serialize.cpp
index d9f758882027..ec62e7513481 100644
--- a/clang/test/ClangScanDeps/strip_diag_serialize.cpp
+++ b/clang/test/ClangScanDeps/strip_diag_serialize.cpp
@@ -2,12 +2,10 @@
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/strip_diag_serialize_input.cpp
-// RUN: cp %s %t.dir/strip_diag_serialize_input_clangcl.cpp
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/strip_diag_serialize.json > %t.cdb
//
-// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 2>&1 | FileCheck %s
+// RUN: clang-scan-deps -compilation-database %t.cdb 2>&1 | FileCheck %s
// CHECK-NOT: unable to open file
// CHECK: strip_diag_serialize_input.cpp
-// CHECK: strip_diag_serialize_input_clangcl.cpp
#warning "diagnostic"
diff --git a/clang/test/ClangScanDeps/target-filename.cpp b/clang/test/ClangScanDeps/target-filename.cpp
index 02084ee9b372..c47166b21e4e 100644
--- a/clang/test/ClangScanDeps/target-filename.cpp
+++ b/clang/test/ClangScanDeps/target-filename.cpp
@@ -18,30 +18,3 @@
// CHECK-NEXT: last.o:
// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK: target-filename_input.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-a.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-b.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-c.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-d.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-e.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-lastf.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-lastg.o:
-// CHECK-NEXT: target-filename_input.cpp
-
-// CHECK-NEXT: clangcl-lasth.o:
-// CHECK-NEXT: target-filename_input.cpp
diff --git a/clang/test/ClangScanDeps/vfsoverlay.cpp b/clang/test/ClangScanDeps/vfsoverlay.cpp
index b3a2b23daad7..517738943ab5 100644
--- a/clang/test/ClangScanDeps/vfsoverlay.cpp
+++ b/clang/test/ClangScanDeps/vfsoverlay.cpp
@@ -2,7 +2,6 @@
// RUN: rm -rf %t.cdb
// RUN: mkdir -p %t.dir
// RUN: cp %s %t.dir/vfsoverlay_input.cpp
-// RUN: cp %s %t.dir/vfsoverlay_input_clangcl.cpp
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/vfsoverlay.yaml > %t.dir/vfsoverlay.yaml
// RUN: mkdir %t.dir/Inputs
// RUN: cp %S/Inputs/header.h %t.dir/Inputs/header.h
@@ -16,7 +15,3 @@
// CHECK: vfsoverlay_input.o
// CHECK-NEXT: vfsoverlay_input.cpp
// CHECK-NEXT: Inputs{{/|\\}}header.h
-
-// CHECK: vfsoverlay_input_clangcl.o
-// CHECK-NEXT: vfsoverlay_input_clangcl.cpp
-// CHECK-NEXT: Inputs{{/|\\}}header.h
diff --git a/clang/tools/clang-scan-deps/ClangScanDeps.cpp b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
index 9e52f84615b9..1bb65ef12d6b 100644
--- a/clang/tools/clang-scan-deps/ClangScanDeps.cpp
+++ b/clang/tools/clang-scan-deps/ClangScanDeps.cpp
@@ -12,8 +12,6 @@
#include "clang/Tooling/DependencyScanning/DependencyScanningTool.h"
#include "clang/Tooling/DependencyScanning/DependencyScanningWorker.h"
#include "clang/Tooling/JSONCompilationDatabase.h"
-#include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/Twine.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/FileUtilities.h"
#include "llvm/Support/InitLLVM.h"
@@ -51,8 +49,7 @@ class ResourceDirectoryCache {
/// option and cache the results for reuse. \returns resource directory path
/// associated with the given invocation command or empty string if the
/// compiler path is NOT an absolute path.
- StringRef findResourceDir(const tooling::CommandLineArguments &Args,
- bool ClangCLMode) {
+ StringRef findResourceDir(const tooling::CommandLineArguments &Args) {
if (Args.size() < 1)
return "";
@@ -68,12 +65,8 @@ class ResourceDirectoryCache {
if (CachedResourceDir != Cache.end())
return CachedResourceDir->second;
- std::vector<StringRef> PrintResourceDirArgs{ClangBinaryName};
- if (ClangCLMode)
- PrintResourceDirArgs.push_back("/clang:-print-resource-dir");
- else
- PrintResourceDirArgs.push_back("-print-resource-dir");
-
+ std::vector<StringRef> PrintResourceDirArgs{ClangBinaryName,
+ "-print-resource-dir"};
llvm::SmallString<64> OutputFile, ErrorFile;
llvm::sys::fs::createTemporaryFile("print-resource-dir-output",
"" /*no-suffix*/, OutputFile);
@@ -428,52 +421,23 @@ int main(int argc, const char **argv) {
bool HasMQ = false;
bool HasMD = false;
bool HasResourceDir = false;
- bool ClangCLMode = false;
-
// We need to find the last -o value.
if (!Args.empty()) {
- ClangCLMode =
- llvm::sys::path::stem(Args[0]).contains_lower("clang-cl") ||
- llvm::is_contained(Args, "--driver-mode=cl");
-
std::size_t Idx = Args.size() - 1;
for (auto It = Args.rbegin(); It != Args.rend(); ++It) {
StringRef Arg = Args[Idx];
- if (ClangCLMode) {
- if (LastO.empty()) {
- // With clang-cl, the output obj file can be specified with
- // "/opath", "/o path", "/Fopath", and the dash counterparts.
- // Also, clang-cl adds ".obj" extension if none is found.
- if ((Arg == "-o" || Arg == "/o") && It != Args.rbegin())
- LastO = Args[Idx + 1];
- else if (Arg.startswith("/Fo") || Arg.startswith("-Fo"))
- LastO = Arg.drop_front(3).str();
- else if (Arg.startswith("/o") || Arg.startswith("-o"))
- LastO = Arg.drop_front(2).str();
-
- if (!LastO.empty() && !llvm::sys::path::has_extension(LastO))
- LastO.append(".obj");
- }
- if (Arg == "/clang:-MT")
- HasMT = true;
- if (Arg == "/clang:-MQ")
- HasMQ = true;
- if (Arg == "/clang:-MD")
- HasMD = true;
- } else {
- if (LastO.empty()) {
- if (Arg == "-o" && It != Args.rbegin())
- LastO = Args[Idx + 1];
- else if (Arg.startswith("-o"))
- LastO = Arg.drop_front(2).str();
- }
- if (Arg == "-MT")
- HasMT = true;
- if (Arg == "-MQ")
- HasMQ = true;
- if (Arg == "-MD")
- HasMD = true;
+ if (LastO.empty()) {
+ if (Arg == "-o" && It != Args.rbegin())
+ LastO = Args[Idx + 1];
+ else if (Arg.startswith("-o"))
+ LastO = Arg.drop_front(2).str();
}
+ if (Arg == "-MT")
+ HasMT = true;
+ if (Arg == "-MQ")
+ HasMQ = true;
+ if (Arg == "-MD")
+ HasMD = true;
if (Arg == "-resource-dir")
HasResourceDir = true;
--Idx;
@@ -482,36 +446,21 @@ int main(int argc, const char **argv) {
// If there's no -MT/-MQ Driver would add -MT with the value of the last
// -o option.
tooling::CommandLineArguments AdjustedArgs = Args;
-
AdjustedArgs.push_back("-o");
-#ifdef _WIN32
- AdjustedArgs.push_back("nul");
-#else
AdjustedArgs.push_back("/dev/null");
-#endif
-
if (!HasMT && !HasMQ) {
+ AdjustedArgs.push_back("-M");
+ AdjustedArgs.push_back("-MT");
// We're interested in source dependencies of an object file.
- std::string FileNameArg;
if (!HasMD) {
// FIXME: We are missing the directory unless the -o value is an
// absolute path.
- FileNameArg = !LastO.empty() ? LastO : getObjFilePath(FileName);
+ AdjustedArgs.push_back(!LastO.empty() ? LastO
+ : getObjFilePath(FileName));
} else {
- FileNameArg = std::string(FileName);
- }
-
- if (ClangCLMode) {
- AdjustedArgs.push_back("/clang:-M");
- AdjustedArgs.push_back("/clang:-MT");
- AdjustedArgs.push_back(Twine("/clang:", FileNameArg).str());
- } else {
- AdjustedArgs.push_back("-M");
- AdjustedArgs.push_back("-MT");
- AdjustedArgs.push_back(std::move(FileNameArg));
+ AdjustedArgs.push_back(std::string(FileName));
}
}
-
AdjustedArgs.push_back("-Xclang");
AdjustedArgs.push_back("-Eonly");
AdjustedArgs.push_back("-Xclang");
@@ -520,7 +469,7 @@ int main(int argc, const char **argv) {
if (!HasResourceDir) {
StringRef ResourceDir =
- ResourceDirCache.findResourceDir(Args, ClangCLMode);
+ ResourceDirCache.findResourceDir(Args);
if (!ResourceDir.empty()) {
AdjustedArgs.push_back("-resource-dir");
AdjustedArgs.push_back(std::string(ResourceDir));
More information about the llvm-branch-commits
mailing list