Skip to content

Commit

Permalink
[clang][deps] Always generate module paths
Browse files Browse the repository at this point in the history
Since D129389 (and downstream PR apple#4965), the dependency scanner is responsible for generating full command-lines, including the modules paths. This patch removes the flag that was making this an opt-in behavior in clang-scan-deps.

Reviewed By: benlangmuir

Differential Revision: https://reviews.llvm.org/D131420
  • Loading branch information
jansvoboda11 committed Aug 10, 2022
1 parent 2d34cb7 commit 71e32d5
Show file tree
Hide file tree
Showing 25 changed files with 47 additions and 119 deletions.
Expand Up @@ -53,9 +53,6 @@ struct FullDependencies {
std::vector<std::string> getCommandLine(
llvm::function_ref<std::string(const ModuleID &, ModuleOutputKind)>
LookupModuleOutput) const;

/// Get the full command line, excluding -fmodule-file=" arguments.
std::vector<std::string> getCommandLineWithoutModulePaths() const;
};

struct FullDependenciesResult {
Expand Down
Expand Up @@ -138,10 +138,6 @@ struct ModuleDeps {
std::vector<std::string> getCanonicalCommandLine(
llvm::function_ref<std::string(const ModuleID &, ModuleOutputKind)>
LookupModuleOutput) const;

/// Gets the canonical command line suitable for passing to clang, excluding
/// "-fmodule-file=" and "-o" arguments.
std::vector<std::string> getCanonicalCommandLineWithoutModulePaths() const;
};

class ModuleDepCollector;
Expand Down
15 changes: 3 additions & 12 deletions clang/lib/Tooling/DependencyScanning/DependencyScanningTool.cpp
Expand Up @@ -16,24 +16,15 @@ using namespace dependencies;
std::vector<std::string> FullDependencies::getCommandLine(
llvm::function_ref<std::string(const ModuleID &, ModuleOutputKind)>
LookupModuleOutput) const {
std::vector<std::string> Ret = getCommandLineWithoutModulePaths();

for (ModuleID MID : ClangModuleDeps) {
auto PCM = LookupModuleOutput(MID, ModuleOutputKind::ModuleFile);
Ret.push_back("-fmodule-file=" + PCM);
}

return Ret;
}

std::vector<std::string>
FullDependencies::getCommandLineWithoutModulePaths() const {
std::vector<std::string> Args = OriginalCommandLine;

Args.push_back("-fno-implicit-modules");
Args.push_back("-fno-implicit-module-maps");
for (const PrebuiltModuleDep &PMD : PrebuiltModuleDeps)
Args.push_back("-fmodule-file=" + PMD.PCMFile);
for (ModuleID MID : ClangModuleDeps)
Args.push_back("-fmodule-file=" +
LookupModuleOutput(MID, ModuleOutputKind::ModuleFile));

// These arguments are unused in explicit compiles.
llvm::erase_if(Args, [](StringRef Arg) {
Expand Down
5 changes: 0 additions & 5 deletions clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Expand Up @@ -214,11 +214,6 @@ static std::string getModuleContextHash(const ModuleDeps &MD) {
return toString(llvm::APInt(sizeof(Words) * 8, Words), 36, /*Signed=*/false);
}

std::vector<std::string>
ModuleDeps::getCanonicalCommandLineWithoutModulePaths() const {
return serializeCompilerInvocation(BuildInvocation);
}

void ModuleDepCollectorPP::FileChanged(SourceLocation Loc,
FileChangeReason Reason,
SrcMgr::CharacteristicKind FileType,
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ClangScanDeps/diagnostics.c
Expand Up @@ -37,8 +37,8 @@
// CHECK-NEXT: ],
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules"
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NEXT: ],
// CHECK: "-fno-implicit-module-maps"
// CHECK: ],
// CHECK-NEXT: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/tu.c"
// CHECK-NEXT: ],
Expand Down
8 changes: 4 additions & 4 deletions clang/test/ClangScanDeps/generate-modules-path-args.c
Expand Up @@ -3,16 +3,16 @@
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
// RUN: sed "s|DIR|%/t|g" %t/cdb_without.json.template > %t/cdb_without.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json \
// RUN: -format experimental-full -generate-modules-path-args > %t/deps.json
// RUN: -format experimental-full > %t/deps.json
// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
// RUN: clang-scan-deps -compilation-database %t/cdb.json \
// RUN: -format experimental-full -generate-modules-path-args -dependency-target foo > %t/deps_mt1.json
// RUN: -format experimental-full -dependency-target foo > %t/deps_mt1.json
// RUN: cat %t/deps_mt1.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s -check-prefix=DEPS_MT1
// RUN: clang-scan-deps -compilation-database %t/cdb.json \
// RUN: -format experimental-full -generate-modules-path-args -dependency-target foo -dependency-target bar > %t/deps_mt2.json
// RUN: -format experimental-full -dependency-target foo -dependency-target bar > %t/deps_mt2.json
// RUN: cat %t/deps_mt2.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s -check-prefix=DEPS_MT2
// RUN: clang-scan-deps -compilation-database %t/cdb_without.json \
// RUN: -format experimental-full -generate-modules-path-args > %t/deps_without.json
// RUN: -format experimental-full > %t/deps_without.json
// RUN: cat %t/deps_without.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t -check-prefix=WITHOUT %s

// CHECK: {
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ClangScanDeps/modulemap-via-vfs.m
Expand Up @@ -4,7 +4,7 @@
// RUN: sed -e "s|DIR|%/t.dir|g" %t.dir/build/vfs.yaml.in > %t.dir/build/vfs.yaml
// RUN: clang-scan-deps -compilation-database %t.dir/build/compile-commands.json \
// RUN: -reuse-filemanager=0 -j 1 -format experimental-full \
// RUN: -mode preprocess-dependency-directives -generate-modules-path-args > %t.db
// RUN: -mode preprocess-dependency-directives > %t.db
// RUN: %deps-to-rsp %t.db --module-name=A > %t.A.cc1.rsp
// RUN: cat %t.A.cc1.rsp | sed 's:\\\\\?:/:g' | FileCheck %s

Expand Down
Expand Up @@ -8,13 +8,13 @@
// RUN: split-file %s %t
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json

// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 -generate-modules-path-args \
// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 \
// RUN: -format experimental-full > %t/deps.json

// RUN: mv %t/module.modulemap %t/module.map
// RUN: echo 'AFTER_MOVE' >> %t/deps.json

// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 -generate-modules-path-args \
// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 \
// RUN: -format experimental-full >> %t/deps.json

// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ClangScanDeps/modules-context-hash-outputs.c
Expand Up @@ -5,7 +5,7 @@
// RUN: split-file %s %t
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json

// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 -generate-modules-path-args \
// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 \
// RUN: -format experimental-full > %t/deps.json
// RUN: cat %t/deps.json | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t %s

Expand Down
8 changes: 2 additions & 6 deletions clang/test/ClangScanDeps/modules-context-hash.c
Expand Up @@ -48,9 +48,7 @@
// CHECK-NEXT: }
// CHECK-NEXT: ],
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NEXT: ],
// CHECK: ],
// CHECK-NEXT: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/tu.c"
// CHECK-NEXT: ],
Expand Down Expand Up @@ -89,9 +87,7 @@
// CHECK-NEXT: }
// CHECK-NEXT: ],
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules",
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NEXT: ],
// CHECK: ],
// CHECK-NEXT: "file-deps": [
// CHECK-NEXT: "[[PREFIX]]/tu.c"
// CHECK-NEXT: ],
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ClangScanDeps/modules-disable-free.c
Expand Up @@ -3,7 +3,7 @@
// RUN: sed -e "s|DIR|%/t|g" %t/compile-commands.json.in > %t/compile-commands.json

// RUN: clang-scan-deps -compilation-database %t/compile-commands.json -j 1 -format experimental-full \
// RUN: -mode preprocess-dependency-directives -generate-modules-path-args > %t/output
// RUN: -mode preprocess-dependency-directives > %t/output
// RUN: FileCheck %s < %t/output

// CHECK: "-disable-free",
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ClangScanDeps/modules-file-path-isolation.c
Expand Up @@ -11,7 +11,7 @@
// RUN: ln -s A.h %t/Z.h

// RUN: clang-scan-deps -compilation-database %t/cdb.json -j 1 -format experimental-full \
// RUN: -mode preprocess-dependency-directives -generate-modules-path-args > %t/output
// RUN: -mode preprocess-dependency-directives > %t/output
// RUN: FileCheck %s < %t/output

// CHECK: "modules": [
Expand Down
Expand Up @@ -10,7 +10,7 @@
// RUN: sed -e "s|DIR|%/t.dir|g" %S/Inputs/module_fmodule_name_cdb.json > %t.cdb

// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -format experimental-full \
// RUN: -generate-modules-path-args -mode preprocess-dependency-directives > %t.result
// RUN: -mode preprocess-dependency-directives > %t.result
// RUN: cat %t.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK %s

#import "header3.h"
Expand Down
13 changes: 2 additions & 11 deletions clang/test/ClangScanDeps/modules-full.cpp
Expand Up @@ -12,20 +12,16 @@
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -format experimental-full \
// RUN: -mode preprocess-dependency-directives > %t.result
// RUN: cat %t.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK,CHECK-NO-ABS %s
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -format experimental-full \
// RUN: -generate-modules-path-args -mode preprocess-dependency-directives > %t.result
// RUN: cat %t.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK,CHECK-ABS %s
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 4 -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t.dir/custom \
// RUN: -module-files-dir %t.dir/custom \
// RUN: -mode preprocess-dependency-directives > %t.result
// RUN: cat %t.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK,CHECK-CUSTOM %s
//
// RUN: clang-scan-deps -compilation-database %t_clangcl.cdb -j 4 -format experimental-full \
// RUN: -mode preprocess-dependency-directives > %t_clangcl.result
// RUN: cat %t_clangcl.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK,CHECK-NO-ABS %s
// RUN: cat %t_clangcl.result | sed 's:\\\\\?:/:g' | FileCheck -DPREFIX=%/t.dir --check-prefixes=CHECK,CHECK-ABS %s

#include "header.h"

Expand All @@ -42,7 +38,6 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-cc1"
// CHECK: "-emit-module"
// CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}"
// CHECK-ABS: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H2_DINCLUDE]]/header2-{{[A-Z0-9]+}}.pcm"
// CHECK-CUSTOM: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H2_DINCLUDE]]/header2-{{[A-Z0-9]+}}.pcm"
// CHECK-NOT: "-fimplicit-module-maps"
Expand Down Expand Up @@ -103,7 +98,6 @@
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules"
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}"
// CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-NEXT: ],
Expand All @@ -123,7 +117,6 @@
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules"
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NO-ABS-NOT: "-fmodule-file={{.*}},
// CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-NEXT: ],
Expand All @@ -143,7 +136,6 @@
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules"
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}"
// CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-NEXT: ],
Expand All @@ -163,7 +155,6 @@
// CHECK-NEXT: "command-line": [
// CHECK: "-fno-implicit-modules"
// CHECK-NEXT: "-fno-implicit-module-maps"
// CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}"
// CHECK-ABS-NEXT: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[HASH_H1_DINCLUDE]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-CUSTOM-NEXT: "-fmodule-file=[[PREFIX]]/custom/[[HASH_H1_DINCLUDE]]/header1-{{[A-Z0-9]+}}.pcm"
// CHECK-NEXT: ],
Expand Down
3 changes: 1 addition & 2 deletions clang/test/ClangScanDeps/modules-inferred-explicit-build.m
Expand Up @@ -5,8 +5,7 @@
// RUN: sed -e "s|DIR|%/t.dir|g" -e "s|FRAMEWORKS|%/S/Inputs/frameworks|g" -e "s|-E|-x objective-c -E|g" \
// RUN: %S/Inputs/modules_inferred_cdb.json > %t.cdb
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -format experimental-full \
// RUN: -mode preprocess-dependency-directives -generate-modules-path-args > %t.db
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -format experimental-full -mode preprocess-dependency-directives > %t.db
// RUN: %deps-to-rsp %t.db --module-name=Inferred > %t.inferred.cc1.rsp
// RUN: %deps-to-rsp %t.db --module-name=System > %t.system.cc1.rsp
// RUN: %deps-to-rsp %t.db --tu-index=0 > %t.tu.rsp
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ClangScanDeps/modules-inferred.m
Expand Up @@ -6,7 +6,7 @@
// RUN: %/S/Inputs/modules_inferred_cdb.json > %t.cdb
//
// RUN: clang-scan-deps -compilation-database %t.cdb -j 1 -format experimental-full \
// RUN: -generate-modules-path-args -mode preprocess-dependency-directives > %t.result
// RUN: -mode preprocess-dependency-directives > %t.result
// RUN: cat %t.result | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t.dir -DSOURCEDIR=%/S --check-prefixes=CHECK

#include <Inferred/Inferred.h>
Expand Down
2 changes: 1 addition & 1 deletion clang/test/ClangScanDeps/modules-no-undeclared-includes.c
Expand Up @@ -30,7 +30,7 @@ module User [no_undeclared_includes] { header "user.h" }

// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result.json
// RUN: -module-files-dir %t/build > %t/result.json
// RUN: cat %t/result.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t

// CHECK: {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ClangScanDeps/modules-pch-common-submodule.c
Expand Up @@ -15,7 +15,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch-common-submodule/cdb_pch.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_pch.json
// RUN: -module-files-dir %t/build > %t/result_pch.json
// RUN: cat %t/result_pch.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-PCH
//
// CHECK-PCH: {
Expand Down Expand Up @@ -73,7 +73,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch-common-submodule/cdb_tu.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_tu.json
// RUN: -module-files-dir %t/build > %t/result_tu.json
// RUN: cat %t/result_tu.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-TU
//
// CHECK-TU: {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ClangScanDeps/modules-pch-common-via-submodule.c
Expand Up @@ -13,7 +13,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch-common-via-submodule/cdb_pch.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_pch.json
// RUN: -module-files-dir %t/build > %t/result_pch.json
// RUN: cat %t/result_pch.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-PCH
//
// CHECK-PCH: {
Expand Down Expand Up @@ -70,7 +70,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch-common-via-submodule/cdb_tu.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_tu.json
// RUN: -module-files-dir %t/build > %t/result_tu.json
// RUN: cat %t/result_tu.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-TU
//
// CHECK-TU: {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ClangScanDeps/modules-pch-dangling.c
Expand Up @@ -88,7 +88,7 @@ module mod { header "mod.h" }
//
// RUN: sed "s|DIR|%/t|g" %t/cdb_pch.json.template > %t/cdb_pch.json
// RUN: clang-scan-deps -compilation-database %t/cdb_pch.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_pch.json
// RUN: -module-files-dir %t/build > %t/result_pch.json

// Explicitly build the PCH:
//
Expand Down Expand Up @@ -136,4 +136,4 @@ module mod { header "mod.h" }
//
// RUN: sed "s|DIR|%/t|g" %t/cdb_tu.json.template > %t/cdb_tu.json
// RUN: clang-scan-deps -compilation-database %t/cdb_tu.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build
// RUN: -module-files-dir %t/build
6 changes: 3 additions & 3 deletions clang/test/ClangScanDeps/modules-pch.c
Expand Up @@ -9,7 +9,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_pch.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_pch.json
// RUN: -module-files-dir %t/build > %t/result_pch.json
// RUN: cat %t/result_pch.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-PCH
//
// Check we didn't build the PCH during dependency scanning.
Expand Down Expand Up @@ -121,7 +121,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_tu.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_tu.json
// RUN: -module-files-dir %t/build > %t/result_tu.json
// RUN: cat %t/result_tu.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-TU
//
// CHECK-TU: {
Expand Down Expand Up @@ -179,7 +179,7 @@
//
// RUN: sed "s|DIR|%/t|g" %S/Inputs/modules-pch/cdb_tu_with_common.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_tu_with_common.json
// RUN: -module-files-dir %t/build > %t/result_tu_with_common.json
// RUN: cat %t/result_tu_with_common.json | sed 's:\\\\\?:/:g' | FileCheck %s -DPREFIX=%/t -check-prefix=CHECK-TU-WITH-COMMON
//
// CHECK-TU-WITH-COMMON: {
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ClangScanDeps/modules-symlink.c
Expand Up @@ -41,7 +41,7 @@ static int foo = MACRO; // Macro usage that will trigger

// RUN: sed -e "s|DIR|%/t|g" %t/cdb_pch.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_pch.json
// RUN: -module-files-dir %t/build > %t/result_pch.json
//
// RUN: %deps-to-rsp %t/result_pch.json --module-name=mod > %t/mod.cc1.rsp
// RUN: %deps-to-rsp %t/result_pch.json --tu-index=0 > %t/pch.rsp
Expand All @@ -51,4 +51,4 @@ static int foo = MACRO; // Macro usage that will trigger

// RUN: sed -e "s|DIR|%/t|g" %t/cdb_tu.json > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full \
// RUN: -generate-modules-path-args -module-files-dir %t/build > %t/result_tu.json
// RUN: -module-files-dir %t/build > %t/result_tu.json
6 changes: 0 additions & 6 deletions clang/test/ClangScanDeps/removed-args.c
Expand Up @@ -29,9 +29,6 @@
// CHECK-NOT: "-fbuild-session-timestamp=
// CHECK-NOT: "-fmodules-prune-interval=
// CHECK-NOT: "-fmodules-prune-after=
// CHECK-NOT: "-dependency-file"
// CHECK-NOT: "-MT"
// CHECK-NOT: "-serialize-diagnostic-file"
// CHECK: ],
// CHECK-NEXT: "context-hash": "[[HASH_MOD_HEADER:.*]]",
// CHECK-NEXT: "file-deps": [
Expand All @@ -53,9 +50,6 @@
// CHECK-NOT: "-fbuild-session-timestamp=
// CHECK-NOT: "-fmodules-prune-interval=
// CHECK-NOT: "-fmodules-prune-after=
// CHECK-NOT: "-dependency-file"
// CHECK-NOT: "-MT"
// CHECK-NOT: "-serialize-diagnostic-file"
// CHECK: ],
// CHECK-NEXT: "context-hash": "[[HASH_MOD_TU:.*]]",
// CHECK-NEXT: "file-deps": [
Expand Down
4 changes: 2 additions & 2 deletions clang/test/ClangScanDeps/submodule-order.c
@@ -1,9 +1,9 @@
// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: sed "s|DIR|%/t|g" %t/cdb.json.template > %t/cdb.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -generate-modules-path-args > %t/deps1.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps1.json
// RUN: mv %t/tu2.c %t/tu.c
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full -generate-modules-path-args > %t/deps2.json
// RUN: clang-scan-deps -compilation-database %t/cdb.json -format experimental-full > %t/deps2.json
// RUN: diff -u %t/deps1.json %t/deps2.json
// RUN: FileCheck %s < %t/deps1.json

Expand Down

0 comments on commit 71e32d5

Please sign in to comment.