Coverage Report

Created: 2021-01-19 06:58

/Users/buildslave/jenkins/workspace/coverage/llvm-project/clang/tools/clang-scan-deps/ClangScanDeps.cpp
Line
Count
Source (jump to first uncovered line)
1
//===- ClangScanDeps.cpp - Implementation of clang-scan-deps --------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "clang/Frontend/CompilerInstance.h"
10
#include "clang/Tooling/CommonOptionsParser.h"
11
#include "clang/Tooling/DependencyScanning/DependencyScanningService.h"
12
#include "clang/Tooling/DependencyScanning/DependencyScanningTool.h"
13
#include "clang/Tooling/DependencyScanning/DependencyScanningWorker.h"
14
#include "clang/Tooling/JSONCompilationDatabase.h"
15
#include "llvm/Support/CommandLine.h"
16
#include "llvm/Support/FileUtilities.h"
17
#include "llvm/Support/InitLLVM.h"
18
#include "llvm/Support/JSON.h"
19
#include "llvm/Support/Program.h"
20
#include "llvm/Support/Signals.h"
21
#include "llvm/Support/ThreadPool.h"
22
#include "llvm/Support/Threading.h"
23
#include <mutex>
24
#include <thread>
25
26
using namespace clang;
27
using namespace tooling::dependencies;
28
29
namespace {
30
31
class SharedStream {
32
public:
33
62
  SharedStream(raw_ostream &OS) : OS(OS) {}
34
71
  void applyLocked(llvm::function_ref<void(raw_ostream &OS)> Fn) {
35
71
    std::unique_lock<std::mutex> LockGuard(Lock);
36
71
    Fn(OS);
37
71
    OS.flush();
38
71
  }
39
40
private:
41
  std::mutex Lock;
42
  raw_ostream &OS;
43
};
44
45
class ResourceDirectoryCache {
46
public:
47
  /// findResourceDir finds the resource directory relative to the clang
48
  /// compiler being used in Args, by running it with "-print-resource-dir"
49
  /// option and cache the results for reuse. \returns resource directory path
50
  /// associated with the given invocation command or empty string if the
51
  /// compiler path is NOT an absolute path.
52
75
  StringRef findResourceDir(const tooling::CommandLineArguments &Args) {
53
75
    if (Args.size() < 1)
54
0
      return "";
55
56
75
    const std::string &ClangBinaryPath = Args[0];
57
75
    if (!llvm::sys::path::is_absolute(ClangBinaryPath))
58
75
      return "";
59
60
0
    const std::string &ClangBinaryName =
61
0
        std::string(llvm::sys::path::filename(ClangBinaryPath));
62
63
0
    std::unique_lock<std::mutex> LockGuard(CacheLock);
64
0
    const auto &CachedResourceDir = Cache.find(ClangBinaryPath);
65
0
    if (CachedResourceDir != Cache.end())
66
0
      return CachedResourceDir->second;
67
68
0
    std::vector<StringRef> PrintResourceDirArgs{ClangBinaryName,
69
0
                                                "-print-resource-dir"};
70
0
    llvm::SmallString<64> OutputFile, ErrorFile;
71
0
    llvm::sys::fs::createTemporaryFile("print-resource-dir-output",
72
0
                                       "" /*no-suffix*/, OutputFile);
73
0
    llvm::sys::fs::createTemporaryFile("print-resource-dir-error",
74
0
                                       "" /*no-suffix*/, ErrorFile);
75
0
    llvm::FileRemover OutputRemover(OutputFile.c_str());
76
0
    llvm::FileRemover ErrorRemover(ErrorFile.c_str());
77
0
    llvm::Optional<StringRef> Redirects[] = {
78
0
        {""}, // Stdin
79
0
        StringRef(OutputFile),
80
0
        StringRef(ErrorFile),
81
0
    };
82
0
    if (const int RC = llvm::sys::ExecuteAndWait(
83
0
            ClangBinaryPath, PrintResourceDirArgs, {}, Redirects)) {
84
0
      auto ErrorBuf = llvm::MemoryBuffer::getFile(ErrorFile.c_str());
85
0
      llvm::errs() << ErrorBuf.get()->getBuffer();
86
0
      return "";
87
0
    }
88
89
0
    auto OutputBuf = llvm::MemoryBuffer::getFile(OutputFile.c_str());
90
0
    if (!OutputBuf)
91
0
      return "";
92
0
    StringRef Output = OutputBuf.get()->getBuffer().rtrim('\n');
93
94
0
    Cache[ClangBinaryPath] = Output.str();
95
0
    return Cache[ClangBinaryPath];
96
0
  }
97
98
private:
99
  std::map<std::string, std::string> Cache;
100
  std::mutex CacheLock;
101
};
102
103
llvm::cl::opt<bool> Help("h", llvm::cl::desc("Alias for -help"),
104
                         llvm::cl::Hidden);
105
106
llvm::cl::OptionCategory DependencyScannerCategory("Tool options");
107
108
static llvm::cl::opt<ScanningMode> ScanMode(
109
    "mode",
110
    llvm::cl::desc("The preprocessing mode used to compute the dependencies"),
111
    llvm::cl::values(
112
        clEnumValN(ScanningMode::MinimizedSourcePreprocessing,
113
                   "preprocess-minimized-sources",
114
                   "The set of dependencies is computed by preprocessing the "
115
                   "source files that were minimized to only include the "
116
                   "contents that might affect the dependencies"),
117
        clEnumValN(ScanningMode::CanonicalPreprocessing, "preprocess",
118
                   "The set of dependencies is computed by preprocessing the "
119
                   "unmodified source files")),
120
    llvm::cl::init(ScanningMode::MinimizedSourcePreprocessing),
121
    llvm::cl::cat(DependencyScannerCategory));
122
123
static llvm::cl::opt<ScanningOutputFormat> Format(
124
    "format", llvm::cl::desc("The output format for the dependencies"),
125
    llvm::cl::values(clEnumValN(ScanningOutputFormat::Make, "make",
126
                                "Makefile compatible dep file"),
127
                     clEnumValN(ScanningOutputFormat::Full, "experimental-full",
128
                                "Full dependency graph suitable"
129
                                " for explicitly building modules. This format "
130
                                "is experimental and will change.")),
131
    llvm::cl::init(ScanningOutputFormat::Make),
132
    llvm::cl::cat(DependencyScannerCategory));
133
134
static llvm::cl::opt<bool> FullCommandLine(
135
    "full-command-line",
136
    llvm::cl::desc("Include the full command lines to use to build modules"),
137
    llvm::cl::init(false), llvm::cl::cat(DependencyScannerCategory));
138
139
llvm::cl::opt<unsigned>
140
    NumThreads("j", llvm::cl::Optional,
141
               llvm::cl::desc("Number of worker threads to use (default: use "
142
                              "all concurrent threads)"),
143
               llvm::cl::init(0), llvm::cl::cat(DependencyScannerCategory));
144
145
llvm::cl::opt<std::string>
146
    CompilationDB("compilation-database",
147
                  llvm::cl::desc("Compilation database"), llvm::cl::Required,
148
                  llvm::cl::cat(DependencyScannerCategory));
149
150
llvm::cl::opt<bool> ReuseFileManager(
151
    "reuse-filemanager",
152
    llvm::cl::desc("Reuse the file manager and its cache between invocations."),
153
    llvm::cl::init(true), llvm::cl::cat(DependencyScannerCategory));
154
155
llvm::cl::opt<bool> SkipExcludedPPRanges(
156
    "skip-excluded-pp-ranges",
157
    llvm::cl::desc(
158
        "Use the preprocessor optimization that skips excluded conditionals by "
159
        "bumping the buffer pointer in the lexer instead of lexing the tokens  "
160
        "until reaching the end directive."),
161
    llvm::cl::init(true), llvm::cl::cat(DependencyScannerCategory));
162
163
llvm::cl::opt<bool> Verbose("v", llvm::cl::Optional,
164
                            llvm::cl::desc("Use verbose output."),
165
                            llvm::cl::init(false),
166
                            llvm::cl::cat(DependencyScannerCategory));
167
168
} // end anonymous namespace
169
170
/// \returns object-file path derived from source-file path.
171
38
static std::string getObjFilePath(StringRef SrcFile) {
172
38
  SmallString<128> ObjFileName(SrcFile);
173
38
  llvm::sys::path::replace_extension(ObjFileName, "o");
174
38
  return std::string(ObjFileName.str());
175
38
}
176
177
class SingleCommandCompilationDatabase : public tooling::CompilationDatabase {
178
public:
179
  SingleCommandCompilationDatabase(tooling::CompileCommand Cmd)
180
75
      : Command(std::move(Cmd)) {}
181
182
  std::vector<tooling::CompileCommand>
183
75
  getCompileCommands(StringRef FilePath) const override {
184
75
    return {Command};
185
75
  }
186
187
225
  std::vector<tooling::CompileCommand> getAllCompileCommands() const override {
188
225
    return {Command};
189
225
  }
190
191
private:
192
  tooling::CompileCommand Command;
193
};
194
195
/// Takes the result of a dependency scan and prints error / dependency files
196
/// based on the result.
197
///
198
/// \returns True on error.
199
static bool
200
handleMakeDependencyToolResult(const std::string &Input,
201
                               llvm::Expected<std::string> &MaybeFile,
202
71
                               SharedStream &OS, SharedStream &Errs) {
203
71
  if (!MaybeFile) {
204
3
    llvm::handleAllErrors(
205
3
        MaybeFile.takeError(), [&Input, &Errs](llvm::StringError &Err) {
206
3
          Errs.applyLocked([&](raw_ostream &OS) {
207
3
            OS << "Error while scanning dependencies for " << Input << ":\n";
208
3
            OS << Err.getMessage();
209
3
          });
210
3
        });
211
3
    return true;
212
3
  }
213
68
  OS.applyLocked([&](raw_ostream &OS) { OS << *MaybeFile; });
214
68
  return false;
215
68
}
216
217
3
static llvm::json::Array toJSONSorted(const llvm::StringSet<> &Set) {
218
3
  std::vector<llvm::StringRef> Strings;
219
3
  for (auto &&I : Set)
220
6
    Strings.push_back(I.getKey());
221
3
  llvm::sort(Strings);
222
3
  return llvm::json::Array(Strings);
223
3
}
224
225
7
static llvm::json::Array toJSONSorted(std::vector<ClangModuleDep> V) {
226
0
  llvm::sort(V, [](const ClangModuleDep &A, const ClangModuleDep &B) {
227
0
    return std::tie(A.ModuleName, A.ContextHash) <
228
0
           std::tie(B.ModuleName, B.ContextHash);
229
0
  });
230
231
7
  llvm::json::Array Ret;
232
7
  for (const ClangModuleDep &CMD : V)
233
5
    Ret.push_back(llvm::json::Object(
234
5
        {{"module-name", CMD.ModuleName}, {"context-hash", CMD.ContextHash}}));
235
7
  return Ret;
236
7
}
237
238
// Thread safe.
239
class FullDeps {
240
public:
241
  void mergeDeps(StringRef Input, FullDependenciesResult FDR,
242
4
                 size_t InputIndex) {
243
4
    const FullDependencies &FD = FDR.FullDeps;
244
245
4
    InputDeps ID;
246
4
    ID.FileName = std::string(Input);
247
4
    ID.ContextHash = std::move(FD.ContextHash);
248
4
    ID.FileDeps = std::move(FD.FileDeps);
249
4
    ID.ModuleDeps = std::move(FD.ClangModuleDeps);
250
251
4
    std::unique_lock<std::mutex> ul(Lock);
252
5
    for (const ModuleDeps &MD : FDR.DiscoveredModules) {
253
5
      auto I = Modules.find({MD.ContextHash, MD.ModuleName, 0});
254
5
      if (I != Modules.end()) {
255
2
        I->first.InputIndex = std::min(I->first.InputIndex, InputIndex);
256
2
        continue;
257
2
      }
258
3
      Modules.insert(
259
3
          I, {{MD.ContextHash, MD.ModuleName, InputIndex}, std::move(MD)});
260
3
    }
261
262
4
    if (FullCommandLine)
263
4
      ID.AdditonalCommandLine = FD.getAdditionalCommandLine(
264
5
          [&](ClangModuleDep CMD) { return lookupPCMPath(CMD); },
265
5
          [&](ClangModuleDep CMD) -> const ModuleDeps & {
266
5
            return lookupModuleDeps(CMD);
267
5
          });
268
269
4
    Inputs.push_back(std::move(ID));
270
4
  }
271
272
1
  void printFullOutput(raw_ostream &OS) {
273
    // Sort the modules by name to get a deterministic order.
274
1
    std::vector<ContextModulePair> ModuleNames;
275
1
    for (auto &&M : Modules)
276
3
      ModuleNames.push_back(M.first);
277
1
    llvm::sort(ModuleNames,
278
3
               [](const ContextModulePair &A, const ContextModulePair &B) {
279
3
                 return std::tie(A.ModuleName, A.InputIndex) <
280
3
                        std::tie(B.ModuleName, B.InputIndex);
281
3
               });
282
283
3
    llvm::sort(Inputs, [](const InputDeps &A, const InputDeps &B) {
284
3
      return A.FileName < B.FileName;
285
3
    });
286
287
1
    using namespace llvm::json;
288
289
1
    Array OutModules;
290
3
    for (auto &&ModName : ModuleNames) {
291
3
      auto &MD = Modules[ModName];
292
3
      Object O{
293
3
          {"name", MD.ModuleName},
294
3
          {"context-hash", MD.ContextHash},
295
3
          {"file-deps", toJSONSorted(MD.FileDeps)},
296
3
          {"clang-module-deps", toJSONSorted(MD.ClangModuleDeps)},
297
3
          {"clang-modulemap-file", MD.ClangModuleMapFile},
298
3
          {"command-line",
299
3
           FullCommandLine
300
3
               ? MD.getFullCommandLine(
301
1
                     [&](ClangModuleDep CMD) { return lookupPCMPath(CMD); },
302
1
                     [&](ClangModuleDep CMD) -> const ModuleDeps & {
303
1
                       return lookupModuleDeps(CMD);
304
1
                     })
305
0
               : MD.NonPathCommandLine},
306
3
      };
307
3
      OutModules.push_back(std::move(O));
308
3
    }
309
310
1
    Array TUs;
311
4
    for (auto &&I : Inputs) {
312
4
      Object O{
313
4
          {"input-file", I.FileName},
314
4
          {"clang-context-hash", I.ContextHash},
315
4
          {"file-deps", I.FileDeps},
316
4
          {"clang-module-deps", toJSONSorted(I.ModuleDeps)},
317
4
          {"command-line", I.AdditonalCommandLine},
318
4
      };
319
4
      TUs.push_back(std::move(O));
320
4
    }
321
322
1
    Object Output{
323
1
        {"modules", std::move(OutModules)},
324
1
        {"translation-units", std::move(TUs)},
325
1
    };
326
327
1
    OS << llvm::formatv("{0:2}\n", Value(std::move(Output)));
328
1
  }
329
330
private:
331
6
  StringRef lookupPCMPath(ClangModuleDep CMD) {
332
6
    return Modules[ContextModulePair{CMD.ContextHash, CMD.ModuleName, 0}]
333
6
        .ImplicitModulePCMPath;
334
6
  }
335
336
6
  const ModuleDeps &lookupModuleDeps(ClangModuleDep CMD) {
337
6
    auto I =
338
6
        Modules.find(ContextModulePair{CMD.ContextHash, CMD.ModuleName, 0});
339
6
    assert(I != Modules.end());
340
6
    return I->second;
341
6
  };
342
343
  struct ContextModulePair {
344
    std::string ContextHash;
345
    std::string ModuleName;
346
    mutable size_t InputIndex;
347
348
21
    bool operator==(const ContextModulePair &Other) const {
349
21
      return ContextHash == Other.ContextHash && 
ModuleName == Other.ModuleName18
;
350
21
    }
351
  };
352
353
  struct ContextModulePairHasher {
354
23
    std::size_t operator()(const ContextModulePair &CMP) const {
355
23
      using llvm::hash_combine;
356
357
23
      return hash_combine(CMP.ContextHash, CMP.ModuleName);
358
23
    }
359
  };
360
361
  struct InputDeps {
362
    std::string FileName;
363
    std::string ContextHash;
364
    std::vector<std::string> FileDeps;
365
    std::vector<ClangModuleDep> ModuleDeps;
366
    std::vector<std::string> AdditonalCommandLine;
367
  };
368
369
  std::mutex Lock;
370
  std::unordered_map<ContextModulePair, ModuleDeps, ContextModulePairHasher>
371
      Modules;
372
  std::vector<InputDeps> Inputs;
373
};
374
375
static bool handleFullDependencyToolResult(
376
    const std::string &Input,
377
    llvm::Expected<FullDependenciesResult> &MaybeFullDeps, FullDeps &FD,
378
4
    size_t InputIndex, SharedStream &OS, SharedStream &Errs) {
379
4
  if (!MaybeFullDeps) {
380
0
    llvm::handleAllErrors(
381
0
        MaybeFullDeps.takeError(), [&Input, &Errs](llvm::StringError &Err) {
382
0
          Errs.applyLocked([&](raw_ostream &OS) {
383
0
            OS << "Error while scanning dependencies for " << Input << ":\n";
384
0
            OS << Err.getMessage();
385
0
          });
386
0
        });
387
0
    return true;
388
0
  }
389
4
  FD.mergeDeps(Input, std::move(*MaybeFullDeps), InputIndex);
390
4
  return false;
391
4
}
392
393
31
int main(int argc, const char **argv) {
394
31
  llvm::InitLLVM X(argc, argv);
395
31
  llvm::cl::HideUnrelatedOptions(DependencyScannerCategory);
396
31
  if (!llvm::cl::ParseCommandLineOptions(argc, argv))
397
0
    return 1;
398
399
31
  std::string ErrorMessage;
400
31
  std::unique_ptr<tooling::JSONCompilationDatabase> Compilations =
401
31
      tooling::JSONCompilationDatabase::loadFromFile(
402
31
          CompilationDB, ErrorMessage,
403
31
          tooling::JSONCommandLineSyntax::AutoDetect);
404
31
  if (!Compilations) {
405
0
    llvm::errs() << "error: " << ErrorMessage << "\n";
406
0
    return 1;
407
0
  }
408
409
31
  llvm::cl::PrintOptionValues();
410
411
  // The command options are rewritten to run Clang in preprocessor only mode.
412
31
  auto AdjustingCompilations =
413
31
      std::make_unique<tooling::ArgumentsAdjustingCompilations>(
414
31
          std::move(Compilations));
415
31
  ResourceDirectoryCache ResourceDirCache;
416
31
  AdjustingCompilations->appendArgumentsAdjuster(
417
31
      [&ResourceDirCache](const tooling::CommandLineArguments &Args,
418
75
                          StringRef FileName) {
419
75
        std::string LastO = "";
420
75
        bool HasMT = false;
421
75
        bool HasMQ = false;
422
75
        bool HasMD = false;
423
75
        bool HasResourceDir = false;
424
        // We need to find the last -o value.
425
75
        if (!Args.empty()) {
426
75
          std::size_t Idx = Args.size() - 1;
427
636
          for (auto It = Args.rbegin(); It != Args.rend(); 
++It561
) {
428
561
            StringRef Arg = Args[Idx];
429
561
            if (LastO.empty()) {
430
410
              if (Arg == "-o" && 
It != Args.rbegin()22
)
431
22
                LastO = Args[Idx + 1];
432
388
              else if (Arg.startswith("-o"))
433
1
                LastO = Arg.drop_front(2).str();
434
410
            }
435
561
            if (Arg == "-MT")
436
0
              HasMT = true;
437
561
            if (Arg == "-MQ")
438
0
              HasMQ = true;
439
561
            if (Arg == "-MD")
440
14
              HasMD = true;
441
561
            if (Arg == "-resource-dir")
442
0
              HasResourceDir = true;
443
561
            --Idx;
444
561
          }
445
75
        }
446
        // If there's no -MT/-MQ Driver would add -MT with the value of the last
447
        // -o option.
448
75
        tooling::CommandLineArguments AdjustedArgs = Args;
449
75
        AdjustedArgs.push_back("-o");
450
75
        AdjustedArgs.push_back("/dev/null");
451
75
        if (!HasMT && !HasMQ) {
452
75
          AdjustedArgs.push_back("-M");
453
75
          AdjustedArgs.push_back("-MT");
454
          // We're interested in source dependencies of an object file.
455
75
          if (!HasMD) {
456
            // FIXME: We are missing the directory unless the -o value is an
457
            // absolute path.
458
23
            AdjustedArgs.push_back(!LastO.empty() ? LastO
459
38
                                                  : getObjFilePath(FileName));
460
14
          } else {
461
14
            AdjustedArgs.push_back(std::string(FileName));
462
14
          }
463
75
        }
464
75
        AdjustedArgs.push_back("-Xclang");
465
75
        AdjustedArgs.push_back("-Eonly");
466
75
        AdjustedArgs.push_back("-Xclang");
467
75
        AdjustedArgs.push_back("-sys-header-deps");
468
75
        AdjustedArgs.push_back("-Wno-error");
469
470
75
        if (!HasResourceDir) {
471
75
          StringRef ResourceDir =
472
75
              ResourceDirCache.findResourceDir(Args);
473
75
          if (!ResourceDir.empty()) {
474
0
            AdjustedArgs.push_back("-resource-dir");
475
0
            AdjustedArgs.push_back(std::string(ResourceDir));
476
0
          }
477
75
        }
478
75
        return AdjustedArgs;
479
75
      });
480
31
  AdjustingCompilations->appendArgumentsAdjuster(
481
31
      tooling::getClangStripSerializeDiagnosticAdjuster());
482
483
31
  SharedStream Errs(llvm::errs());
484
  // Print out the dependency results to STDOUT by default.
485
31
  SharedStream DependencyOS(llvm::outs());
486
487
31
  DependencyScanningService Service(ScanMode, Format, ReuseFileManager,
488
31
                                    SkipExcludedPPRanges);
489
31
  llvm::ThreadPool Pool(llvm::hardware_concurrency(NumThreads));
490
31
  std::vector<std::unique_ptr<DependencyScanningTool>> WorkerTools;
491
90
  for (unsigned I = 0; I < Pool.getThreadCount(); 
++I59
)
492
59
    WorkerTools.push_back(std::make_unique<DependencyScanningTool>(Service));
493
494
31
  std::vector<SingleCommandCompilationDatabase> Inputs;
495
31
  for (tooling::CompileCommand Cmd :
496
31
       AdjustingCompilations->getAllCompileCommands())
497
75
    Inputs.emplace_back(Cmd);
498
499
31
  std::atomic<bool> HadErrors(false);
500
31
  FullDeps FD;
501
31
  std::mutex Lock;
502
31
  size_t Index = 0;
503
504
31
  if (Verbose) {
505
0
    llvm::outs() << "Running clang-scan-deps on " << Inputs.size()
506
0
                 << " files using " << Pool.getThreadCount() << " workers\n";
507
0
  }
508
90
  for (unsigned I = 0; I < Pool.getThreadCount(); 
++I59
) {
509
59
    Pool.async([I, &Lock, &Index, &Inputs, &HadErrors, &FD, &WorkerTools,
510
59
                &DependencyOS, &Errs]() {
511
59
      llvm::StringSet<> AlreadySeenModules;
512
134
      while (true) {
513
134
        const SingleCommandCompilationDatabase *Input;
514
134
        std::string Filename;
515
134
        std::string CWD;
516
134
        size_t LocalIndex;
517
        // Take the next input.
518
134
        {
519
134
          std::unique_lock<std::mutex> LockGuard(Lock);
520
134
          if (Index >= Inputs.size())
521
59
            return;
522
75
          LocalIndex = Index;
523
75
          Input = &Inputs[Index++];
524
75
          tooling::CompileCommand Cmd = Input->getAllCompileCommands()[0];
525
75
          Filename = std::move(Cmd.Filename);
526
75
          CWD = std::move(Cmd.Directory);
527
75
        }
528
        // Run the tool on it.
529
75
        if (Format == ScanningOutputFormat::Make) {
530
71
          auto MaybeFile = WorkerTools[I]->getDependencyFile(*Input, CWD);
531
71
          if (handleMakeDependencyToolResult(Filename, MaybeFile, DependencyOS,
532
71
                                             Errs))
533
3
            HadErrors = true;
534
4
        } else {
535
4
          auto MaybeFullDeps = WorkerTools[I]->getFullDependencies(
536
4
              *Input, CWD, AlreadySeenModules);
537
4
          if (handleFullDependencyToolResult(Filename, MaybeFullDeps, FD,
538
4
                                             LocalIndex, DependencyOS, Errs))
539
0
            HadErrors = true;
540
4
        }
541
75
      }
542
59
    });
543
59
  }
544
31
  Pool.wait();
545
546
31
  if (Format == ScanningOutputFormat::Full)
547
1
    FD.printFullOutput(llvm::outs());
548
549
31
  return HadErrors;
550
31
}