Skip to content

Commit 35515c9

Browse files
committed
Merge commit '060b25346b95' from llvm.org/main into next
Conflicts: clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
2 parents 09a9a47 + 060b253 commit 35515c9

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,15 @@ ModuleDepCollector::makeInvocationForModuleBuildWithoutOutputs(
9999
CI.getFrontendOpts().OutputFile.clear();
100100
// FIXME: a build system may want to provide a new path.
101101
CI.getFrontendOpts().IndexUnitOutputPath.clear();
102+
103+
// TODO: Figure out better way to set options to their default value.
102104
CI.getCodeGenOpts().MainFileName.clear();
103105
CI.getCodeGenOpts().DwarfDebugFlags.clear();
106+
if (!CI.getLangOpts()->ModulesCodegen) {
107+
CI.getCodeGenOpts().DebugCompilationDir.clear();
108+
CI.getCodeGenOpts().CoverageCompilationDir.clear();
109+
}
110+
104111
// Map output paths that affect behaviour to "-" so their existence is in the
105112
// context hash. The final path will be computed in addOutputPaths.
106113
if (!CI.getDiagnosticOpts().DiagnosticSerializationFile.empty())
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[
22
{
33
"directory": "DIR",
4-
"command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps -fmodules-validate-once-per-build-session -fbuild-session-file=DIR/build-session -fmodules-prune-interval=123 -fmodules-prune-after=123 -fmodules-cache-path=DIR/cache -include DIR/header.h -grecord-command-line -o DIR/tu.o -serialize-diagnostics DIR/tu.diag -MT tu -MD -MF DIR/tu.d",
4+
"command": "clang -fsyntax-only DIR/tu.c -fmodules -fimplicit-module-maps -fmodules-validate-once-per-build-session -fbuild-session-file=DIR/build-session -fmodules-prune-interval=123 -fmodules-prune-after=123 -fmodules-cache-path=DIR/cache -include DIR/header.h -grecord-command-line -fdebug-compilation-dir=DIR/debug -fcoverage-compilation-dir=DIR/coverage -o DIR/tu.o -serialize-diagnostics DIR/tu.diag -MT tu -MD -MF DIR/tu.d",
55
"file": "DIR/tu.c"
66
}
77
]

clang/test/ClangScanDeps/removed-args.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
2222
// CHECK-NEXT: "command-line": [
2323
// CHECK-NEXT: "-cc1"
24+
// CHECK-NOT: "-fdebug-compilation-dir="
25+
// CHECK-NOT: "-fcoverage-compilation-dir="
2426
// CHECK-NOT: "-dwarf-debug-flags"
2527
// CHECK-NOT: "-main-file-name"
2628
// CHECK-NOT: "-include"
@@ -42,6 +44,8 @@
4244
// CHECK-NEXT: "clang-modulemap-file": "[[PREFIX]]/module.modulemap",
4345
// CHECK-NEXT: "command-line": [
4446
// CHECK-NEXT: "-cc1"
47+
// CHECK-NOT: "-fdebug-compilation-dir=
48+
// CHECK-NOT: "-fcoverage-compilation-dir=
4549
// CHECK-NOT: "-dwarf-debug-flags"
4650
// CHECK-NOT: "-main-file-name"
4751
// CHECK-NOT: "-include"

0 commit comments

Comments
 (0)