Coverage Report

Created: 2020-09-19 12:23

/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
54
  SharedStream(raw_ostream &OS) : OS(OS) {}
34
61
  void applyLocked(llvm::function_ref<void(raw_ostream &OS)> Fn) {
35
61
    std::unique_lock<std::mutex> LockGuard(Lock);
36
61
    Fn(OS);
37
61
    OS.flush();
38
61
  }
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
65
  StringRef findResourceDir(const tooling::CommandLineArguments &Args) {
53
65
    if (Args.size() < 1)
54
0
      return "";
55
65
56
65
    const std::string &ClangBinaryPath = Args[0];
57
65
    if (!llvm::sys::path::is_absolute(ClangBinaryPath))
58
65
      return "";
59
0
60
0
    const std::string &ClangBinaryName =
61
0
        std::string(llvm::sys::path::filename(ClangBinaryPath));
62
0
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
0
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
0
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
0
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
31
static std::string getObjFilePath(StringRef SrcFile) {
172
31
  SmallString<128> ObjFileName(SrcFile);
173
31
  llvm::sys::path::replace_extension(ObjFileName, "o");
174
31
  return std::string(ObjFileName.str());
175
31
}
176
177
class SingleCommandCompilationDatabase : public tooling::CompilationDatabase {
178
public:
179
  SingleCommandCompilationDatabase(tooling::CompileCommand Cmd)
180
65
      : Command(std::move(Cmd)) {}
181
182
  std::vector<tooling::CompileCommand>
183
61
  getCompileCommands(StringRef FilePath) const override {
184
61
    return {Command};
185
61
  }
186
187
195
  std::vector<tooling::CompileCommand> getAllCompileCommands() const override {
188
195
    return {Command};
189
195
  }
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
61
                               SharedStream &OS, SharedStream &Errs) {
203
61
  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
58
  OS.applyLocked([&](raw_ostream &OS) { OS << *MaybeFile; });
214
58
  return false;
215
58
}
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
7
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
4
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
4
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
4
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
4
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
1
283
4
    llvm::sort(Inputs, [](const InputDeps &A, const InputDeps &B) {
284
4
      return A.FileName < B.FileName;
285
4
    });
286
1
287
1
    using namespace llvm::json;
288
1
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
1
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
1
322
1
    Object Output{
323
1
        {"modules", std::move(OutModules)},
324
1
        {"translation-units", std::move(TUs)},
325
1
    };
326
1
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
20
    bool operator==(const ContextModulePair &Other) const {
349
20
      return ContextHash == Other.ContextHash && 
ModuleName == Other.ModuleName17
;
350
20
    }
351
  };
352
353
  struct ContextModulePairHasher {
354
23
    std::size_t operator()(const ContextModulePair &CMP) const {
355
23
      using llvm::hash_combine;
356
23
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
27
int main(int argc, const char **argv) {
394
27
  llvm::InitLLVM X(argc, argv);
395
27
  llvm::cl::HideUnrelatedOptions(DependencyScannerCategory);
396
27
  if (!llvm::cl::ParseCommandLineOptions(argc, argv))
397
0
    return 1;
398
27
399
27
  std::string ErrorMessage;
400
27
  std::unique_ptr<tooling::JSONCompilationDatabase> Compilations =
401
27
      tooling::JSONCompilationDatabase::loadFromFile(
402
27
          CompilationDB, ErrorMessage,
403
27
          tooling::JSONCommandLineSyntax::AutoDetect);
404
27
  if (!Compilations) {
405
0
    llvm::errs() << "error: " << ErrorMessage << "\n";
406
0
    return 1;
407
0
  }
408
27
409
27
  llvm::cl::PrintOptionValues();
410
27
411
  // The command options are rewritten to run Clang in preprocessor only mode.
412
27
  auto AdjustingCompilations =
413
27
      std::make_unique<tooling::ArgumentsAdjustingCompilations>(
414
27
          std::move(Compilations));
415
27
  ResourceDirectoryCache ResourceDirCache;
416
27
  AdjustingCompilations->appendArgumentsAdjuster(
417
27
      [&ResourceDirCache](const tooling::CommandLineArguments &Args,
418
65
                          StringRef FileName) {
419
65
        std::string LastO = "";
420
65
        bool HasMT = false;
421
65
        bool HasMQ = false;
422
65
        bool HasMD = false;
423
65
        bool HasResourceDir = false;
424
        // We need to find the last -o value.
425
65
        if (!Args.empty()) {
426
65
          std::size_t Idx = Args.size() - 1;
427
583
          for (auto It = Args.rbegin(); It != Args.rend(); 
++It518
) {
428
518
            if (It != Args.rbegin()) {
429
453
              if (Args[Idx] == "-o")
430
20
                LastO = Args[Idx + 1];
431
453
              if (Args[Idx] == "-MT")
432
0
                HasMT = true;
433
453
              if (Args[Idx] == "-MQ")
434
0
                HasMQ = true;
435
453
              if (Args[Idx] == "-MD")
436
14
                HasMD = true;
437
453
              if (Args[Idx] == "-resource-dir")
438
0
                HasResourceDir = true;
439
453
            }
440
518
            --Idx;
441
518
          }
442
65
        }
443
        // If there's no -MT/-MQ Driver would add -MT with the value of the last
444
        // -o option.
445
65
        tooling::CommandLineArguments AdjustedArgs = Args;
446
65
        AdjustedArgs.push_back("-o");
447
65
        AdjustedArgs.push_back("/dev/null");
448
65
        if (!HasMT && !HasMQ) {
449
65
          AdjustedArgs.push_back("-M");
450
65
          AdjustedArgs.push_back("-MT");
451
          // We're interested in source dependencies of an object file.
452
65
          if (!HasMD) {
453
            // FIXME: We are missing the directory unless the -o value is an
454
            // absolute path.
455
20
            AdjustedArgs.push_back(!LastO.empty() ? LastO
456
31
                                                  : getObjFilePath(FileName));
457
14
          } else {
458
14
            AdjustedArgs.push_back(std::string(FileName));
459
14
          }
460
65
        }
461
65
        AdjustedArgs.push_back("-Xclang");
462
65
        AdjustedArgs.push_back("-Eonly");
463
65
        AdjustedArgs.push_back("-Xclang");
464
65
        AdjustedArgs.push_back("-sys-header-deps");
465
65
        AdjustedArgs.push_back("-Wno-error");
466
65
467
65
        if (!HasResourceDir) {
468
65
          StringRef ResourceDir =
469
65
              ResourceDirCache.findResourceDir(Args);
470
65
          if (!ResourceDir.empty()) {
471
0
            AdjustedArgs.push_back("-resource-dir");
472
0
            AdjustedArgs.push_back(std::string(ResourceDir));
473
0
          }
474
65
        }
475
65
        return AdjustedArgs;
476
65
      });
477
27
  AdjustingCompilations->appendArgumentsAdjuster(
478
27
      tooling::getClangStripSerializeDiagnosticAdjuster());
479
27
480
27
  SharedStream Errs(llvm::errs());
481
  // Print out the dependency results to STDOUT by default.
482
27
  SharedStream DependencyOS(llvm::outs());
483
27
484
27
  DependencyScanningService Service(ScanMode, Format, ReuseFileManager,
485
27
                                    SkipExcludedPPRanges);
486
27
  llvm::ThreadPool Pool(llvm::hardware_concurrency(NumThreads));
487
27
  std::vector<std::unique_ptr<DependencyScanningTool>> WorkerTools;
488
80
  for (unsigned I = 0; I < Pool.getThreadCount(); 
++I53
)
489
53
    WorkerTools.push_back(std::make_unique<DependencyScanningTool>(Service));
490
27
491
27
  std::vector<SingleCommandCompilationDatabase> Inputs;
492
27
  for (tooling::CompileCommand Cmd :
493
27
       AdjustingCompilations->getAllCompileCommands())
494
65
    Inputs.emplace_back(Cmd);
495
27
496
27
  std::atomic<bool> HadErrors(false);
497
27
  FullDeps FD;
498
27
  std::mutex Lock;
499
27
  size_t Index = 0;
500
27
501
27
  if (Verbose) {
502
0
    llvm::outs() << "Running clang-scan-deps on " << Inputs.size()
503
0
                 << " files using " << Pool.getThreadCount() << " workers\n";
504
0
  }
505
80
  for (unsigned I = 0; I < Pool.getThreadCount(); 
++I53
) {
506
53
    Pool.async([I, &Lock, &Index, &Inputs, &HadErrors, &FD, &WorkerTools,
507
53
                &DependencyOS, &Errs]() {
508
53
      llvm::StringSet<> AlreadySeenModules;
509
118
      while (true) {
510
118
        const SingleCommandCompilationDatabase *Input;
511
118
        std::string Filename;
512
118
        std::string CWD;
513
118
        size_t LocalIndex;
514
        // Take the next input.
515
118
        {
516
118
          std::unique_lock<std::mutex> LockGuard(Lock);
517
118
          if (Index >= Inputs.size())
518
53
            return;
519
65
          LocalIndex = Index;
520
65
          Input = &Inputs[Index++];
521
65
          tooling::CompileCommand Cmd = Input->getAllCompileCommands()[0];
522
65
          Filename = std::move(Cmd.Filename);
523
65
          CWD = std::move(Cmd.Directory);
524
65
        }
525
        // Run the tool on it.
526
65
        if (Format == ScanningOutputFormat::Make) {
527
61
          auto MaybeFile = WorkerTools[I]->getDependencyFile(*Input, CWD);
528
61
          if (handleMakeDependencyToolResult(Filename, MaybeFile, DependencyOS,
529
61
                                             Errs))
530
3
            HadErrors = true;
531
4
        } else {
532
4
          auto MaybeFullDeps = WorkerTools[I]->getFullDependencies(
533
4
              *Input, CWD, AlreadySeenModules);
534
4
          if (handleFullDependencyToolResult(Filename, MaybeFullDeps, FD,
535
4
                                             LocalIndex, DependencyOS, Errs))
536
0
            HadErrors = true;
537
4
        }
538
65
      }
539
53
    });
540
53
  }
541
27
  Pool.wait();
542
27
543
27
  if (Format == ScanningOutputFormat::Full)
544
1
    FD.printFullOutput(llvm::outs());
545
27
546
27
  return HadErrors;
547
27
}