@@ -22,27 +22,6 @@ using namespace tooling;
22
22
using namespace dependencies ;
23
23
using llvm::Error;
24
24
25
- static std::vector<std::string>
26
- makeTUCommandLineWithoutPaths (ArrayRef<std::string> OriginalCommandLine) {
27
- std::vector<std::string> Args = OriginalCommandLine;
28
-
29
- Args.push_back (" -fno-implicit-modules" );
30
- Args.push_back (" -fno-implicit-module-maps" );
31
-
32
- // These arguments are unused in explicit compiles.
33
- llvm::erase_if (Args, [](StringRef Arg) {
34
- if (Arg.consume_front (" -fmodules-" )) {
35
- return Arg.startswith (" cache-path=" ) ||
36
- Arg.startswith (" prune-interval=" ) ||
37
- Arg.startswith (" prune-after=" ) ||
38
- Arg == " validate-once-per-build-session" ;
39
- }
40
- return Arg.startswith (" -fbuild-session-file=" );
41
- });
42
-
43
- return Args;
44
- }
45
-
46
25
DependencyScanningTool::DependencyScanningTool (
47
26
DependencyScanningService &Service,
48
27
llvm::IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS)
@@ -144,8 +123,8 @@ class GetDependencyTree : public FullDependencyConsumer {
144
123
145
124
GetDependencyTree (llvm::cas::CachingOnDiskFileSystem &FS,
146
125
DepscanPrefixMapping PrefixMapping)
147
- : FullDependencyConsumer(AlreadySeen, nullptr , /* EagerModules= */ false ,
148
- &FS, std::move(PrefixMapping)),
126
+ : FullDependencyConsumer(AlreadySeen, nullptr , &FS ,
127
+ std::move (PrefixMapping)),
149
128
FS(FS) {}
150
129
151
130
private:
@@ -567,7 +546,6 @@ DependencyScanningTool::getFullDependencies(
567
546
LookupModuleOutputCallback LookupModuleOutput,
568
547
llvm::Optional<StringRef> ModuleName, DepscanPrefixMapping PrefixMapping) {
569
548
FullDependencyConsumer Consumer (AlreadySeen, LookupModuleOutput,
570
- Worker.shouldEagerLoadModules (),
571
549
Worker.getCASFS (), std::move (PrefixMapping));
572
550
llvm::Error Result =
573
551
Worker.computeDependencies (CWD, CommandLine, Consumer, ModuleName);
@@ -576,22 +554,6 @@ DependencyScanningTool::getFullDependencies(
576
554
return Consumer.takeFullDependencies ();
577
555
}
578
556
579
- llvm::Expected<FullDependenciesResult>
580
- DependencyScanningTool::getFullDependenciesLegacyDriverCommand (
581
- const std::vector<std::string> &CommandLine, StringRef CWD,
582
- const llvm::StringSet<> &AlreadySeen,
583
- LookupModuleOutputCallback LookupModuleOutput,
584
- llvm::Optional<StringRef> ModuleName) {
585
- FullDependencyConsumer Consumer (AlreadySeen, LookupModuleOutput,
586
- Worker.shouldEagerLoadModules (),
587
- Worker.getCASFS ());
588
- llvm::Error Result =
589
- Worker.computeDependencies (CWD, CommandLine, Consumer, ModuleName);
590
- if (Result)
591
- return std::move (Result);
592
- return Consumer.getFullDependenciesLegacyDriverCommand (CommandLine);
593
- }
594
-
595
557
Error FullDependencyConsumer::initialize (CompilerInstance &ScanInstance,
596
558
CompilerInvocation &NewInvocation) {
597
559
if (CacheFS) {
@@ -756,52 +718,3 @@ FullDependenciesResult FullDependencyConsumer::takeFullDependencies() {
756
718
757
719
return FDR;
758
720
}
759
-
760
- FullDependenciesResult
761
- FullDependencyConsumer::getFullDependenciesLegacyDriverCommand (
762
- const std::vector<std::string> &OriginalCommandLine) const {
763
- FullDependencies FD;
764
-
765
- FD.DriverCommandLine = makeTUCommandLineWithoutPaths (
766
- ArrayRef<std::string>(OriginalCommandLine).slice (1 ));
767
-
768
- FD.ID .ContextHash = std::move (ContextHash);
769
-
770
- FD.FileDeps .assign (Dependencies.begin (), Dependencies.end ());
771
-
772
- for (const PrebuiltModuleDep &PMD : PrebuiltModuleDeps)
773
- FD.DriverCommandLine .push_back (" -fmodule-file=" + PMD.PCMFile );
774
-
775
- for (auto &&M : ClangModuleDeps) {
776
- auto &MD = M.second ;
777
- if (MD.ImportedByMainFile ) {
778
- FD.ClangModuleDeps .push_back (MD.ID );
779
- auto PCMPath = LookupModuleOutput (MD.ID , ModuleOutputKind::ModuleFile);
780
- if (EagerLoadModules) {
781
- FD.DriverCommandLine .push_back (" -fmodule-file=" + PCMPath);
782
- } else {
783
- FD.DriverCommandLine .push_back (" -fmodule-map-file=" +
784
- MD.ClangModuleMapFile );
785
- FD.DriverCommandLine .push_back (" -fmodule-file=" + MD.ID .ModuleName +
786
- " =" + PCMPath);
787
- }
788
- }
789
- }
790
-
791
- FD.PrebuiltModuleDeps = std::move (PrebuiltModuleDeps);
792
-
793
- FD.CASFileSystemRootID = CASFileSystemRootID;
794
-
795
- FullDependenciesResult FDR;
796
-
797
- for (auto &&M : ClangModuleDeps) {
798
- // TODO: Avoid handleModuleDependency even being called for modules
799
- // we've already seen.
800
- if (AlreadySeen.count (M.first ))
801
- continue ;
802
- FDR.DiscoveredModules .push_back (std::move (M.second ));
803
- }
804
-
805
- FDR.FullDeps = std::move (FD);
806
- return FDR;
807
- }
0 commit comments