Skip to content

Commit

Permalink
Revert "Reapply "[clang][deps] Support inferred modules""
Browse files Browse the repository at this point in the history
This reverts commit c98833c.
The test `ClangScanDeps/modules-inferred-explicit-build.m` creates files
in the current directory.
  • Loading branch information
frgossen committed May 19, 2021
1 parent f66ba4c commit 76b8754
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 200 deletions.
12 changes: 2 additions & 10 deletions clang/lib/Tooling/DependencyScanning/ModuleDepCollector.cpp
Expand Up @@ -33,6 +33,7 @@ makeInvocationForModuleBuildWithoutPaths(const ModuleDeps &Deps,
CI.getFrontendOpts().IsSystemModule = Deps.IsSystem;

CI.getLangOpts()->ImplicitModules = false;
CI.getHeaderSearchOpts().ImplicitModuleMaps = false;

return CI;
}
Expand Down Expand Up @@ -178,22 +179,13 @@ ModuleID ModuleDepCollectorPP::handleTopLevelModule(const Module *M) {
const FileEntry *ModuleMap = Instance.getPreprocessor()
.getHeaderSearchInfo()
.getModuleMap()
.getModuleMapFileForUniquing(M);
.getContainingModuleMapFile(M);
MD.ClangModuleMapFile = std::string(ModuleMap ? ModuleMap->getName() : "");

serialization::ModuleFile *MF =
MDC.Instance.getASTReader()->getModuleManager().lookup(M->getASTFile());
MDC.Instance.getASTReader()->visitInputFiles(
*MF, true, true, [&](const serialization::InputFile &IF, bool isSystem) {
// __inferred_module.map is the result of the way in which an implicit
// module build handles inferred modules. It adds an overlay VFS with
// this file in the proper directory and relies on the rest of Clang to
// handle it like normal. With explicitly built modules we don't need
// to play VFS tricks, so replace it with the correct module map.
if (IF.getFile()->getName().endswith("__inferred_module.map")) {
MD.FileDeps.insert(ModuleMap->getName());
return;
}
MD.FileDeps.insert(IF.getFile()->getName());
});

Expand Down
Empty file.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 0 additions & 7 deletions clang/test/ClangScanDeps/Inputs/modules_inferred_cdb.json

This file was deleted.

3 changes: 3 additions & 0 deletions clang/test/ClangScanDeps/modules-full.cpp
Expand Up @@ -48,6 +48,7 @@
// CHECK: "-emit-module"
// CHECK-NO-ABS-NOT: "-fmodule-file={{.*}}"
// CHECK-ABS: "-fmodule-file=[[PREFIX]]/module-cache{{(_clangcl)?}}/[[CONTEXT_HASH_H1]]/header2-{{[A-Z0-9]+}}.pcm"
// CHECK-NOT: "-fimplicit-module-maps"
// CHECK: "-fmodule-name=header1"
// CHECK: "-fno-implicit-modules"
// CHECK: ],
Expand All @@ -64,6 +65,7 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-cc1",
// CHECK: "-emit-module",
// CHECK-NOT: "-fimplicit-module-maps",
// CHECK: "-fmodule-name=header1",
// CHECK: "-fno-implicit-modules",
// CHECK: ],
Expand All @@ -80,6 +82,7 @@
// CHECK-NEXT: "command-line": [
// CHECK-NEXT: "-cc1",
// CHECK: "-emit-module",
// CHECK-NOT: "-fimplicit-module-maps",
// CHECK: "-fmodule-name=header2",
// CHECK: "-fno-implicit-modules",
// CHECK: ],
Expand Down
22 changes: 0 additions & 22 deletions clang/test/ClangScanDeps/modules-inferred-explicit-build.m

This file was deleted.

61 changes: 0 additions & 61 deletions clang/test/ClangScanDeps/modules-inferred.m

This file was deleted.

94 changes: 0 additions & 94 deletions clang/utils/module-deps-to-rsp.py

This file was deleted.

0 comments on commit 76b8754

Please sign in to comment.