clang-tools  9.0.0svn
ModularizeUtilities.cpp
Go to the documentation of this file.
1 //===--- extra/modularize/ModularizeUtilities.cpp -------------------===//
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 // This file implements a class for loading and validating a module map or
10 // header list by checking that all headers in the corresponding directories
11 // are accounted for.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "clang/Basic/SourceManager.h"
16 #include "clang/Driver/Options.h"
17 #include "clang/Frontend/CompilerInstance.h"
18 #include "clang/Frontend/FrontendActions.h"
19 #include "CoverageChecker.h"
20 #include "llvm/ADT/SmallString.h"
21 #include "llvm/Support/FileUtilities.h"
22 #include "llvm/Support/MemoryBuffer.h"
23 #include "llvm/Support/Path.h"
24 #include "llvm/Support/raw_ostream.h"
25 #include "ModularizeUtilities.h"
26 
27 using namespace clang;
28 using namespace llvm;
29 using namespace Modularize;
30 
31 namespace {
32 // Subclass TargetOptions so we can construct it inline with
33 // the minimal option, the triple.
34 class ModuleMapTargetOptions : public clang::TargetOptions {
35 public:
36  ModuleMapTargetOptions() { Triple = llvm::sys::getDefaultTargetTriple(); }
37 };
38 } // namespace
39 
40 // ModularizeUtilities class implementation.
41 
42 // Constructor.
43 ModularizeUtilities::ModularizeUtilities(std::vector<std::string> &InputPaths,
44  llvm::StringRef Prefix,
45  llvm::StringRef ProblemFilesListPath)
46  : InputFilePaths(InputPaths), HeaderPrefix(Prefix),
47  ProblemFilesPath(ProblemFilesListPath), HasModuleMap(false),
48  MissingHeaderCount(0),
49  // Init clang stuff needed for loading the module map and preprocessing.
50  LangOpts(new LangOptions()), DiagIDs(new DiagnosticIDs()),
51  DiagnosticOpts(new DiagnosticOptions()),
52  DC(llvm::errs(), DiagnosticOpts.get()),
53  Diagnostics(
54  new DiagnosticsEngine(DiagIDs, DiagnosticOpts.get(), &DC, false)),
55  TargetOpts(new ModuleMapTargetOptions()),
56  Target(TargetInfo::CreateTargetInfo(*Diagnostics, TargetOpts)),
57  FileMgr(new FileManager(FileSystemOpts)),
58  SourceMgr(new SourceManager(*Diagnostics, *FileMgr, false)),
59  HeaderInfo(new HeaderSearch(std::make_shared<HeaderSearchOptions>(),
60  *SourceMgr, *Diagnostics, *LangOpts,
61  Target.get())) {}
62 
63 // Create instance of ModularizeUtilities, to simplify setting up
64 // subordinate objects.
66  std::vector<std::string> &InputPaths, llvm::StringRef Prefix,
67  llvm::StringRef ProblemFilesListPath) {
68 
69  return new ModularizeUtilities(InputPaths, Prefix, ProblemFilesListPath);
70 }
71 
72 // Load all header lists and dependencies.
74  // For each input file.
75  for (auto I = InputFilePaths.begin(), E = InputFilePaths.end(); I != E; ++I) {
76  llvm::StringRef InputPath = *I;
77  // If it's a module map.
78  if (InputPath.endswith(".modulemap")) {
79  // Load the module map.
80  if (std::error_code EC = loadModuleMap(InputPath))
81  return EC;
82  }
83  else {
84  // Else we assume it's a header list and load it.
85  if (std::error_code EC = loadSingleHeaderListsAndDependencies(InputPath)) {
86  errs() << "modularize: error: Unable to get header list '" << InputPath
87  << "': " << EC.message() << '\n';
88  return EC;
89  }
90  }
91  }
92  // If we have a problem files list.
93  if (ProblemFilesPath.size() != 0) {
94  // Load problem files list.
95  if (std::error_code EC = loadProblemHeaderList(ProblemFilesPath)) {
96  errs() << "modularize: error: Unable to get problem header list '" << ProblemFilesPath
97  << "': " << EC.message() << '\n';
98  return EC;
99  }
100  }
101  return std::error_code();
102 }
103 
104 // Do coverage checks.
105 // For each loaded module map, do header coverage check.
106 // Starting from the directory of the module.map file,
107 // Find all header files, optionally looking only at files
108 // covered by the include path options, and compare against
109 // the headers referenced by the module.map file.
110 // Display warnings for unaccounted-for header files.
111 // Returns 0 if there were no errors or warnings, 1 if there
112 // were warnings, 2 if any other problem, such as a bad
113 // module map path argument was specified.
115  std::vector<std::string> &IncludePaths,
116  llvm::ArrayRef<std::string> CommandLine) {
117  int ModuleMapCount = ModuleMaps.size();
118  int ModuleMapIndex;
119  std::error_code EC;
120  for (ModuleMapIndex = 0; ModuleMapIndex < ModuleMapCount; ++ModuleMapIndex) {
121  std::unique_ptr<clang::ModuleMap> &ModMap = ModuleMaps[ModuleMapIndex];
123  InputFilePaths[ModuleMapIndex], IncludePaths, CommandLine,
124  ModMap.get());
125  std::error_code LocalEC = Checker->doChecks();
126  if (LocalEC.value() > 0)
127  EC = LocalEC;
128  }
129  return EC;
130 }
131 
132 // Load single header list and dependencies.
134  llvm::StringRef InputPath) {
135 
136  // By default, use the path component of the list file name.
137  SmallString<256> HeaderDirectory(InputPath);
138  llvm::sys::path::remove_filename(HeaderDirectory);
139  SmallString<256> CurrentDirectory;
140  llvm::sys::fs::current_path(CurrentDirectory);
141 
142  // Get the prefix if we have one.
143  if (HeaderPrefix.size() != 0)
144  HeaderDirectory = HeaderPrefix;
145 
146  // Read the header list file into a buffer.
147  ErrorOr<std::unique_ptr<MemoryBuffer>> listBuffer =
148  MemoryBuffer::getFile(InputPath);
149  if (std::error_code EC = listBuffer.getError())
150  return EC;
151 
152  // Parse the header list into strings.
153  SmallVector<StringRef, 32> Strings;
154  listBuffer.get()->getBuffer().split(Strings, "\n", -1, false);
155 
156  // Collect the header file names from the string list.
157  for (SmallVectorImpl<StringRef>::iterator I = Strings.begin(),
158  E = Strings.end();
159  I != E; ++I) {
160  StringRef Line = I->trim();
161  // Ignore comments and empty lines.
162  if (Line.empty() || (Line[0] == '#'))
163  continue;
164  std::pair<StringRef, StringRef> TargetAndDependents = Line.split(':');
165  SmallString<256> HeaderFileName;
166  // Prepend header file name prefix if it's not absolute.
167  if (llvm::sys::path::is_absolute(TargetAndDependents.first))
168  llvm::sys::path::native(TargetAndDependents.first, HeaderFileName);
169  else {
170  if (HeaderDirectory.size() != 0)
171  HeaderFileName = HeaderDirectory;
172  else
173  HeaderFileName = CurrentDirectory;
174  llvm::sys::path::append(HeaderFileName, TargetAndDependents.first);
175  llvm::sys::path::native(HeaderFileName);
176  }
177  // Handle optional dependencies.
178  DependentsVector Dependents;
179  SmallVector<StringRef, 4> DependentsList;
180  TargetAndDependents.second.split(DependentsList, " ", -1, false);
181  int Count = DependentsList.size();
182  for (int Index = 0; Index < Count; ++Index) {
183  SmallString<256> Dependent;
184  if (llvm::sys::path::is_absolute(DependentsList[Index]))
185  Dependent = DependentsList[Index];
186  else {
187  if (HeaderDirectory.size() != 0)
188  Dependent = HeaderDirectory;
189  else
190  Dependent = CurrentDirectory;
191  llvm::sys::path::append(Dependent, DependentsList[Index]);
192  }
193  llvm::sys::path::native(Dependent);
194  Dependents.push_back(getCanonicalPath(Dependent.str()));
195  }
196  // Get canonical form.
197  HeaderFileName = getCanonicalPath(HeaderFileName);
198  // Save the resulting header file path and dependencies.
199  HeaderFileNames.push_back(HeaderFileName.str());
200  Dependencies[HeaderFileName.str()] = Dependents;
201  }
202  return std::error_code();
203 }
204 
205 // Load problem header list.
207  llvm::StringRef InputPath) {
208 
209  // By default, use the path component of the list file name.
210  SmallString<256> HeaderDirectory(InputPath);
211  llvm::sys::path::remove_filename(HeaderDirectory);
212  SmallString<256> CurrentDirectory;
213  llvm::sys::fs::current_path(CurrentDirectory);
214 
215  // Get the prefix if we have one.
216  if (HeaderPrefix.size() != 0)
217  HeaderDirectory = HeaderPrefix;
218 
219  // Read the header list file into a buffer.
220  ErrorOr<std::unique_ptr<MemoryBuffer>> listBuffer =
221  MemoryBuffer::getFile(InputPath);
222  if (std::error_code EC = listBuffer.getError())
223  return EC;
224 
225  // Parse the header list into strings.
226  SmallVector<StringRef, 32> Strings;
227  listBuffer.get()->getBuffer().split(Strings, "\n", -1, false);
228 
229  // Collect the header file names from the string list.
230  for (SmallVectorImpl<StringRef>::iterator I = Strings.begin(),
231  E = Strings.end();
232  I != E; ++I) {
233  StringRef Line = I->trim();
234  // Ignore comments and empty lines.
235  if (Line.empty() || (Line[0] == '#'))
236  continue;
237  SmallString<256> HeaderFileName;
238  // Prepend header file name prefix if it's not absolute.
239  if (llvm::sys::path::is_absolute(Line))
240  llvm::sys::path::native(Line, HeaderFileName);
241  else {
242  if (HeaderDirectory.size() != 0)
243  HeaderFileName = HeaderDirectory;
244  else
245  HeaderFileName = CurrentDirectory;
246  llvm::sys::path::append(HeaderFileName, Line);
247  llvm::sys::path::native(HeaderFileName);
248  }
249  // Get canonical form.
250  HeaderFileName = getCanonicalPath(HeaderFileName);
251  // Save the resulting header file path.
252  ProblemFileNames.push_back(HeaderFileName.str());
253  }
254  return std::error_code();
255 }
256 
257 // Load single module map and extract header file list.
259  llvm::StringRef InputPath) {
260  // Get file entry for module.modulemap file.
261  const FileEntry *ModuleMapEntry =
262  SourceMgr->getFileManager().getFile(InputPath);
263 
264  // return error if not found.
265  if (!ModuleMapEntry) {
266  llvm::errs() << "error: File \"" << InputPath << "\" not found.\n";
267  return std::error_code(1, std::generic_category());
268  }
269 
270  // Because the module map parser uses a ForwardingDiagnosticConsumer,
271  // which doesn't forward the BeginSourceFile call, we do it explicitly here.
272  DC.BeginSourceFile(*LangOpts, nullptr);
273 
274  // Figure out the home directory for the module map file.
275  const DirectoryEntry *Dir = ModuleMapEntry->getDir();
276  StringRef DirName(Dir->getName());
277  if (llvm::sys::path::filename(DirName) == "Modules") {
278  DirName = llvm::sys::path::parent_path(DirName);
279  if (DirName.endswith(".framework"))
280  Dir = FileMgr->getDirectory(DirName);
281  // FIXME: This assert can fail if there's a race between the above check
282  // and the removal of the directory.
283  assert(Dir && "parent must exist");
284  }
285 
286  std::unique_ptr<ModuleMap> ModMap;
287  ModMap.reset(new ModuleMap(*SourceMgr, *Diagnostics, *LangOpts,
288  Target.get(), *HeaderInfo));
289 
290  // Parse module.modulemap file into module map.
291  if (ModMap->parseModuleMapFile(ModuleMapEntry, false, Dir)) {
292  return std::error_code(1, std::generic_category());
293  }
294 
295  // Do matching end call.
296  DC.EndSourceFile();
297 
298  // Reset missing header count.
299  MissingHeaderCount = 0;
300 
301  if (!collectModuleMapHeaders(ModMap.get()))
302  return std::error_code(1, std::generic_category());
303 
304  // Save module map.
305  ModuleMaps.push_back(std::move(ModMap));
306 
307  // Indicate we are using module maps.
308  HasModuleMap = true;
309 
310  // Return code of 1 for missing headers.
311  if (MissingHeaderCount)
312  return std::error_code(1, std::generic_category());
313 
314  return std::error_code();
315 }
316 
317 // Collect module map headers.
318 // Walks the modules and collects referenced headers into
319 // HeaderFileNames.
320 bool ModularizeUtilities::collectModuleMapHeaders(clang::ModuleMap *ModMap) {
321  for (ModuleMap::module_iterator I = ModMap->module_begin(),
322  E = ModMap->module_end();
323  I != E; ++I) {
324  if (!collectModuleHeaders(*I->second))
325  return false;
326  }
327  return true;
328 }
329 
330 // Collect referenced headers from one module.
331 // Collects the headers referenced in the given module into
332 // HeaderFileNames.
333 bool ModularizeUtilities::collectModuleHeaders(const clang::Module &Mod) {
334 
335  // Ignore explicit modules because they often have dependencies
336  // we can't know.
337  if (Mod.IsExplicit)
338  return true;
339 
340  // Treat headers in umbrella directory as dependencies.
341  DependentsVector UmbrellaDependents;
342 
343  // Recursively do submodules.
344  for (auto MI = Mod.submodule_begin(), MIEnd = Mod.submodule_end();
345  MI != MIEnd; ++MI)
346  collectModuleHeaders(**MI);
347 
348  if (const FileEntry *UmbrellaHeader = Mod.getUmbrellaHeader().Entry) {
349  std::string HeaderPath = getCanonicalPath(UmbrellaHeader->getName());
350  // Collect umbrella header.
351  HeaderFileNames.push_back(HeaderPath);
352 
353  // FUTURE: When needed, umbrella header header collection goes here.
354  }
355  else if (const DirectoryEntry *UmbrellaDir = Mod.getUmbrellaDir().Entry) {
356  // If there normal headers, assume these are umbrellas and skip collection.
357  if (Mod.Headers->size() == 0) {
358  // Collect headers in umbrella directory.
359  if (!collectUmbrellaHeaders(UmbrellaDir->getName(), UmbrellaDependents))
360  return false;
361  }
362  }
363 
364  // We ignore HK_Private, HK_Textual, HK_PrivateTextual, and HK_Excluded,
365  // assuming they are marked as such either because of unsuitability for
366  // modules or because they are meant to be included by another header,
367  // and thus should be ignored by modularize.
368 
369  int NormalHeaderCount = Mod.Headers[clang::Module::HK_Normal].size();
370 
371  for (int Index = 0; Index < NormalHeaderCount; ++Index) {
372  DependentsVector NormalDependents;
373  // Collect normal header.
374  const clang::Module::Header &Header(
375  Mod.Headers[clang::Module::HK_Normal][Index]);
376  std::string HeaderPath = getCanonicalPath(Header.Entry->getName());
377  HeaderFileNames.push_back(HeaderPath);
378  }
379 
380  int MissingCountThisModule = Mod.MissingHeaders.size();
381 
382  for (int Index = 0; Index < MissingCountThisModule; ++Index) {
383  std::string MissingFile = Mod.MissingHeaders[Index].FileName;
384  SourceLocation Loc = Mod.MissingHeaders[Index].FileNameLoc;
385  errs() << Loc.printToString(*SourceMgr)
386  << ": error : Header not found: " << MissingFile << "\n";
387  }
388 
389  MissingHeaderCount += MissingCountThisModule;
390 
391  return true;
392 }
393 
394 // Collect headers from an umbrella directory.
395 bool ModularizeUtilities::collectUmbrellaHeaders(StringRef UmbrellaDirName,
396  DependentsVector &Dependents) {
397  // Initialize directory name.
398  SmallString<256> Directory(UmbrellaDirName);
399  // Walk the directory.
400  std::error_code EC;
401  for (llvm::sys::fs::directory_iterator I(Directory.str(), EC), E; I != E;
402  I.increment(EC)) {
403  if (EC)
404  return false;
405  std::string File(I->path());
406  llvm::ErrorOr<llvm::sys::fs::basic_file_status> Status = I->status();
407  if (!Status)
408  return false;
409  llvm::sys::fs::file_type Type = Status->type();
410  // If the file is a directory, ignore the name and recurse.
411  if (Type == llvm::sys::fs::file_type::directory_file) {
412  if (!collectUmbrellaHeaders(File, Dependents))
413  return false;
414  continue;
415  }
416  // If the file does not have a common header extension, ignore it.
417  if (!isHeader(File))
418  continue;
419  // Save header name.
420  std::string HeaderPath = getCanonicalPath(File);
421  Dependents.push_back(HeaderPath);
422  }
423  return true;
424 }
425 
426 // Replace .. embedded in path for purposes of having
427 // a canonical path.
428 static std::string replaceDotDot(StringRef Path) {
429  SmallString<128> Buffer;
430  llvm::sys::path::const_iterator B = llvm::sys::path::begin(Path),
431  E = llvm::sys::path::end(Path);
432  while (B != E) {
433  if (B->compare(".") == 0) {
434  }
435  else if (B->compare("..") == 0)
436  llvm::sys::path::remove_filename(Buffer);
437  else
438  llvm::sys::path::append(Buffer, *B);
439  ++B;
440  }
441  if (Path.endswith("/") || Path.endswith("\\"))
442  Buffer.append(1, Path.back());
443  return Buffer.c_str();
444 }
445 
446 // Convert header path to canonical form.
447 // The canonical form is basically just use forward slashes, and remove "./".
448 // \param FilePath The file path, relative to the module map directory.
449 // \returns The file path in canonical form.
450 std::string ModularizeUtilities::getCanonicalPath(StringRef FilePath) {
451  std::string Tmp(replaceDotDot(FilePath));
452  std::replace(Tmp.begin(), Tmp.end(), '\\', '/');
453  StringRef Tmp2(Tmp);
454  if (Tmp2.startswith("./"))
455  Tmp = Tmp2.substr(2);
456  return Tmp;
457 }
458 
459 // Check for header file extension.
460 // If the file extension is .h, .inc, or missing, it's
461 // assumed to be a header.
462 // \param FileName The file name. Must not be a directory.
463 // \returns true if it has a header extension or no extension.
465  StringRef Extension = llvm::sys::path::extension(FileName);
466  if (Extension.size() == 0)
467  return true;
468  if (Extension.equals_lower(".h"))
469  return true;
470  if (Extension.equals_lower(".inc"))
471  return true;
472  return false;
473 }
474 
475 // Get directory path component from file path.
476 // \returns the component of the given path, which will be
477 // relative if the given path is relative, absolute if the
478 // given path is absolute, or "." if the path has no leading
479 // path component.
481  SmallString<256> Directory(Path);
482  sys::path::remove_filename(Directory);
483  if (Directory.size() == 0)
484  return ".";
485  return Directory.str();
486 }
487 
488 // Add unique problem file.
489 // Also standardizes the path.
490 void ModularizeUtilities::addUniqueProblemFile(std::string FilePath) {
491  FilePath = getCanonicalPath(FilePath);
492  // Don't add if already present.
493  for(auto &TestFilePath : ProblemFileNames) {
494  if (TestFilePath == FilePath)
495  return;
496  }
497  ProblemFileNames.push_back(FilePath);
498 }
499 
500 // Add file with no compile errors.
501 // Also standardizes the path.
503  FilePath = getCanonicalPath(FilePath);
504  GoodFileNames.push_back(FilePath);
505 }
506 
507 // List problem files.
509  errs() << "\nThese are the files with possible errors:\n\n";
510  for (auto &ProblemFile : ProblemFileNames) {
511  errs() << ProblemFile << "\n";
512  }
513 }
514 
515 // List files with no problems.
517  errs() << "\nThese are the files with no detected errors:\n\n";
518  for (auto &GoodFile : HeaderFileNames) {
519  bool Good = true;
520  for (auto &ProblemFile : ProblemFileNames) {
521  if (ProblemFile == GoodFile) {
522  Good = false;
523  break;
524  }
525  }
526  if (Good)
527  errs() << GoodFile << "\n";
528  }
529 }
530 
531 // List files with problem files commented out.
533  errs() <<
534  "\nThese are the combined files, with problem files preceded by #:\n\n";
535  for (auto &File : HeaderFileNames) {
536  bool Good = true;
537  for (auto &ProblemFile : ProblemFileNames) {
538  if (ProblemFile == File) {
539  Good = false;
540  break;
541  }
542  }
543  errs() << (Good ? "" : "#") << File << "\n";
544  }
545 }
ModularizeUtilities(std::vector< std::string > &InputPaths, llvm::StringRef Prefix, llvm::StringRef ProblemFilesListPath)
Constructor.
SourceLocation Loc
&#39;#&#39; location in the include directive
void displayGoodFiles()
List files with no problems.
DependencyMap Dependencies
Map of top-level header file dependencies.
std::error_code doCoverageCheck(std::vector< std::string > &IncludePaths, llvm::ArrayRef< std::string > CommandLine)
Do coverage checks.
llvm::IntrusiveRefCntPtr< clang::DiagnosticsEngine > Diagnostics
Diagnostic engine.
Some operations such as code completion produce a set of candidates.
static std::string getCanonicalPath(llvm::StringRef FilePath)
Convert header path to canonical form.
llvm::SmallVector< std::string, 4 > DependentsVector
Definition: Modularize.h:31
void displayCombinedFiles()
List files with problem files commented out.
std::error_code loadProblemHeaderList(llvm::StringRef InputPath)
Load problem header list.
static std::string getDirectoryFromPath(llvm::StringRef Path)
Get directory path component from file path.
bool HasModuleMap
True if we have module maps.
static cl::opt< std::string > HeaderPrefix("prefix", cl::init(""), cl::desc("Prepend header file paths with this prefix." " If not specified," " the files are considered to be relative to the header list file."))
std::error_code loadSingleHeaderListsAndDependencies(llvm::StringRef InputPath)
Load single header list and dependencies.
llvm::IntrusiveRefCntPtr< clang::TargetInfo > Target
Target information.
static ModularizeUtilities * createModularizeUtilities(std::vector< std::string > &InputPaths, llvm::StringRef Prefix, llvm::StringRef ProblemFilesListPath)
Create instance of ModularizeUtilities.
llvm::IntrusiveRefCntPtr< clang::FileManager > FileMgr
File system manager.
clang::TextDiagnosticPrinter DC
Diagnostic consumer.
std::unique_ptr< clang::HeaderSearch > HeaderInfo
Header search manager.
std::vector< HeaderHandle > Path
ModularizeUtilities class definition.
std::shared_ptr< clang::LangOptions > LangOpts
Options controlling the language variant.
bool collectModuleMapHeaders(clang::ModuleMap *ModMap)
Collect module Map headers.
llvm::StringRef ProblemFilesPath
The path of problem files list file.
static cl::opt< std::string > Directory(cl::Positional, cl::Required, cl::desc("<Search Root Directory>"))
Definitions for CoverageChecker.
int MissingHeaderCount
Missing header count.
std::error_code loadModuleMap(llvm::StringRef InputPath)
Load single module map and extract header file list.
static std::unique_ptr< CoverageChecker > createCoverageChecker(llvm::StringRef ModuleMapPath, std::vector< std::string > &IncludePaths, llvm::ArrayRef< std::string > CommandLine, clang::ModuleMap *ModuleMap)
Create instance of CoverageChecker.
PathRef FileName
std::error_code loadAllHeaderListsAndDependencies()
Load header list and dependencies.
std::string CommandLine
Definition: Modularize.cpp:335
llvm::SmallVector< std::string, 32 > ProblemFileNames
List of header files with problems.
llvm::SmallVector< std::string, 32 > GoodFileNames
List of header files with no problems during the first pass, that is, no compile errors.
Modularize utilities class.
std::vector< llvm::StringRef > Strings
llvm::SmallVector< std::string, 32 > HeaderFileNames
List of top-level header files.
llvm::IntrusiveRefCntPtr< clang::SourceManager > SourceMgr
Source manager.
static cl::list< std::string > IncludePaths("I", cl::desc("Include path for coverage check."), cl::ZeroOrMore, cl::value_desc("path"))
llvm::StringRef HeaderPrefix
The header prefix.
bool collectModuleHeaders(const clang::Module &Mod)
Collect referenced headers from one module.
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
std::vector< std::unique_ptr< clang::ModuleMap > > ModuleMaps
bool collectUmbrellaHeaders(llvm::StringRef UmbrellaDirName, DependentsVector &Dependents)
Collect headers from an umbrella directory.
void addUniqueProblemFile(std::string FilePath)
Add unique problem file.
void displayProblemFiles()
List problem files.
std::vector< std::string > InputFilePaths
The input file paths.
static std::string replaceDotDot(StringRef Path)
static bool isHeader(llvm::StringRef FileName)
Check for header file extension.
void addNoCompileErrorsFile(std::string FilePath)
Add file with no compile errors.
const SymbolIndex * Index
Definition: Dexp.cpp:84