clang  3.9.0
Basic/Module.cpp
Go to the documentation of this file.
1 //===--- Module.cpp - Describe a module -----------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file defines the Module class, which describes a module in the source
11 // code.
12 //
13 //===----------------------------------------------------------------------===//
14 
15 #include "clang/Basic/Module.h"
18 #include "clang/Basic/TargetInfo.h"
19 #include "llvm/ADT/ArrayRef.h"
20 #include "llvm/ADT/SmallVector.h"
21 #include "llvm/ADT/StringSwitch.h"
22 #include "llvm/Support/ErrorHandling.h"
23 #include "llvm/Support/raw_ostream.h"
24 
25 using namespace clang;
26 
27 Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent,
28  bool IsFramework, bool IsExplicit, unsigned VisibilityID)
29  : Name(Name), DefinitionLoc(DefinitionLoc), Parent(Parent), Directory(),
30  Umbrella(), Signature(0), ASTFile(nullptr), VisibilityID(VisibilityID),
31  IsMissingRequirement(false), HasIncompatibleModuleFile(false),
32  IsAvailable(true), IsFromModuleFile(false), IsFramework(IsFramework),
33  IsExplicit(IsExplicit), IsSystem(false), IsExternC(false),
34  IsInferred(false), InferSubmodules(false), InferExplicitSubmodules(false),
35  InferExportWildcard(false), ConfigMacrosExhaustive(false),
36  NameVisibility(Hidden) {
37  if (Parent) {
38  if (!Parent->isAvailable())
39  IsAvailable = false;
40  if (Parent->IsSystem)
41  IsSystem = true;
42  if (Parent->IsExternC)
43  IsExternC = true;
45 
46  Parent->SubModuleIndex[Name] = Parent->SubModules.size();
47  Parent->SubModules.push_back(this);
48  }
49 }
50 
53  I != IEnd; ++I) {
54  delete *I;
55  }
56 }
57 
58 /// \brief Determine whether a translation unit built using the current
59 /// language options has the given feature.
60 static bool hasFeature(StringRef Feature, const LangOptions &LangOpts,
61  const TargetInfo &Target) {
62  bool HasFeature = llvm::StringSwitch<bool>(Feature)
63  .Case("altivec", LangOpts.AltiVec)
64  .Case("blocks", LangOpts.Blocks)
65  .Case("cplusplus", LangOpts.CPlusPlus)
66  .Case("cplusplus11", LangOpts.CPlusPlus11)
67  .Case("objc", LangOpts.ObjC1)
68  .Case("objc_arc", LangOpts.ObjCAutoRefCount)
69  .Case("opencl", LangOpts.OpenCL)
70  .Case("tls", Target.isTLSSupported())
71  .Case("zvector", LangOpts.ZVector)
72  .Default(Target.hasFeature(Feature));
73  if (!HasFeature)
74  HasFeature = std::find(LangOpts.ModuleFeatures.begin(),
75  LangOpts.ModuleFeatures.end(),
76  Feature) != LangOpts.ModuleFeatures.end();
77  return HasFeature;
78 }
79 
80 bool Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target,
81  Requirement &Req,
82  UnresolvedHeaderDirective &MissingHeader) const {
83  if (IsAvailable)
84  return true;
85 
86  for (const Module *Current = this; Current; Current = Current->Parent) {
87  for (unsigned I = 0, N = Current->Requirements.size(); I != N; ++I) {
88  if (hasFeature(Current->Requirements[I].first, LangOpts, Target) !=
89  Current->Requirements[I].second) {
90  Req = Current->Requirements[I];
91  return false;
92  }
93  }
94  if (!Current->MissingHeaders.empty()) {
95  MissingHeader = Current->MissingHeaders.front();
96  return false;
97  }
98  }
99 
100  llvm_unreachable("could not find a reason why module is unavailable");
101 }
102 
103 bool Module::isSubModuleOf(const Module *Other) const {
104  const Module *This = this;
105  do {
106  if (This == Other)
107  return true;
108 
109  This = This->Parent;
110  } while (This);
111 
112  return false;
113 }
114 
116  const Module *Result = this;
117  while (Result->Parent)
118  Result = Result->Parent;
119 
120  return Result;
121 }
122 
123 std::string Module::getFullModuleName() const {
125 
126  // Build up the set of module names (from innermost to outermost).
127  for (const Module *M = this; M; M = M->Parent)
128  Names.push_back(M->Name);
129 
130  std::string Result;
131  for (SmallVectorImpl<StringRef>::reverse_iterator I = Names.rbegin(),
132  IEnd = Names.rend();
133  I != IEnd; ++I) {
134  if (!Result.empty())
135  Result += '.';
136 
137  Result += *I;
138  }
139 
140  return Result;
141 }
142 
144  for (const Module *M = this; M; M = M->Parent) {
145  if (nameParts.empty() || M->Name != nameParts.back())
146  return false;
147  nameParts = nameParts.drop_back();
148  }
149  return nameParts.empty();
150 }
151 
153  if (Header U = getUmbrellaHeader())
154  return {"", U.Entry->getDir()};
155 
156  return {UmbrellaAsWritten, Umbrella.dyn_cast<const DirectoryEntry *>()};
157 }
158 
160  if (!TopHeaderNames.empty()) {
162  I = TopHeaderNames.begin(), E = TopHeaderNames.end(); I != E; ++I) {
163  if (const FileEntry *FE = FileMgr.getFile(*I))
164  TopHeaders.insert(FE);
165  }
166  TopHeaderNames.clear();
167  }
168 
169  return llvm::makeArrayRef(TopHeaders.begin(), TopHeaders.end());
170 }
171 
172 bool Module::directlyUses(const Module *Requested) const {
173  auto *Top = getTopLevelModule();
174 
175  // A top-level module implicitly uses itself.
176  if (Requested->isSubModuleOf(Top))
177  return true;
178 
179  for (auto *Use : Top->DirectUses)
180  if (Requested->isSubModuleOf(Use))
181  return true;
182  return false;
183 }
184 
185 void Module::addRequirement(StringRef Feature, bool RequiredState,
186  const LangOptions &LangOpts,
187  const TargetInfo &Target) {
188  Requirements.push_back(Requirement(Feature, RequiredState));
189 
190  // If this feature is currently available, we're done.
191  if (hasFeature(Feature, LangOpts, Target) == RequiredState)
192  return;
193 
194  markUnavailable(/*MissingRequirement*/true);
195 }
196 
197 void Module::markUnavailable(bool MissingRequirement) {
198  auto needUpdate = [MissingRequirement](Module *M) {
199  return M->IsAvailable || (!M->IsMissingRequirement && MissingRequirement);
200  };
201 
202  if (!needUpdate(this))
203  return;
204 
206  Stack.push_back(this);
207  while (!Stack.empty()) {
208  Module *Current = Stack.back();
209  Stack.pop_back();
210 
211  if (!needUpdate(Current))
212  continue;
213 
214  Current->IsAvailable = false;
215  Current->IsMissingRequirement |= MissingRequirement;
216  for (submodule_iterator Sub = Current->submodule_begin(),
217  SubEnd = Current->submodule_end();
218  Sub != SubEnd; ++Sub) {
219  if (needUpdate(*Sub))
220  Stack.push_back(*Sub);
221  }
222  }
223 }
224 
225 Module *Module::findSubmodule(StringRef Name) const {
226  llvm::StringMap<unsigned>::const_iterator Pos = SubModuleIndex.find(Name);
227  if (Pos == SubModuleIndex.end())
228  return nullptr;
229 
230  return SubModules[Pos->getValue()];
231 }
232 
233 static void printModuleId(raw_ostream &OS, const ModuleId &Id) {
234  for (unsigned I = 0, N = Id.size(); I != N; ++I) {
235  if (I)
236  OS << ".";
237  OS << Id[I].first;
238  }
239 }
240 
242  // All non-explicit submodules are exported.
243  for (std::vector<Module *>::const_iterator I = SubModules.begin(),
244  E = SubModules.end();
245  I != E; ++I) {
246  Module *Mod = *I;
247  if (!Mod->IsExplicit)
248  Exported.push_back(Mod);
249  }
250 
251  // Find re-exported modules by filtering the list of imported modules.
252  bool AnyWildcard = false;
253  bool UnrestrictedWildcard = false;
254  SmallVector<Module *, 4> WildcardRestrictions;
255  for (unsigned I = 0, N = Exports.size(); I != N; ++I) {
256  Module *Mod = Exports[I].getPointer();
257  if (!Exports[I].getInt()) {
258  // Export a named module directly; no wildcards involved.
259  Exported.push_back(Mod);
260 
261  continue;
262  }
263 
264  // Wildcard export: export all of the imported modules that match
265  // the given pattern.
266  AnyWildcard = true;
267  if (UnrestrictedWildcard)
268  continue;
269 
270  if (Module *Restriction = Exports[I].getPointer())
271  WildcardRestrictions.push_back(Restriction);
272  else {
273  WildcardRestrictions.clear();
274  UnrestrictedWildcard = true;
275  }
276  }
277 
278  // If there were any wildcards, push any imported modules that were
279  // re-exported by the wildcard restriction.
280  if (!AnyWildcard)
281  return;
282 
283  for (unsigned I = 0, N = Imports.size(); I != N; ++I) {
284  Module *Mod = Imports[I];
285  bool Acceptable = UnrestrictedWildcard;
286  if (!Acceptable) {
287  // Check whether this module meets one of the restrictions.
288  for (unsigned R = 0, NR = WildcardRestrictions.size(); R != NR; ++R) {
289  Module *Restriction = WildcardRestrictions[R];
290  if (Mod == Restriction || Mod->isSubModuleOf(Restriction)) {
291  Acceptable = true;
292  break;
293  }
294  }
295  }
296 
297  if (!Acceptable)
298  continue;
299 
300  Exported.push_back(Mod);
301  }
302 }
303 
304 void Module::buildVisibleModulesCache() const {
305  assert(VisibleModulesCache.empty() && "cache does not need building");
306 
307  // This module is visible to itself.
308  VisibleModulesCache.insert(this);
309 
310  // Every imported module is visible.
312  while (!Stack.empty()) {
313  Module *CurrModule = Stack.pop_back_val();
314 
315  // Every module transitively exported by an imported module is visible.
316  if (VisibleModulesCache.insert(CurrModule).second)
317  CurrModule->getExportedModules(Stack);
318  }
319 }
320 
321 void Module::print(raw_ostream &OS, unsigned Indent) const {
322  OS.indent(Indent);
323  if (IsFramework)
324  OS << "framework ";
325  if (IsExplicit)
326  OS << "explicit ";
327  OS << "module " << Name;
328 
329  if (IsSystem || IsExternC) {
330  OS.indent(Indent + 2);
331  if (IsSystem)
332  OS << " [system]";
333  if (IsExternC)
334  OS << " [extern_c]";
335  }
336 
337  OS << " {\n";
338 
339  if (!Requirements.empty()) {
340  OS.indent(Indent + 2);
341  OS << "requires ";
342  for (unsigned I = 0, N = Requirements.size(); I != N; ++I) {
343  if (I)
344  OS << ", ";
345  if (!Requirements[I].second)
346  OS << "!";
347  OS << Requirements[I].first;
348  }
349  OS << "\n";
350  }
351 
352  if (Header H = getUmbrellaHeader()) {
353  OS.indent(Indent + 2);
354  OS << "umbrella header \"";
355  OS.write_escaped(H.NameAsWritten);
356  OS << "\"\n";
357  } else if (DirectoryName D = getUmbrellaDir()) {
358  OS.indent(Indent + 2);
359  OS << "umbrella \"";
360  OS.write_escaped(D.NameAsWritten);
361  OS << "\"\n";
362  }
363 
364  if (!ConfigMacros.empty() || ConfigMacrosExhaustive) {
365  OS.indent(Indent + 2);
366  OS << "config_macros ";
368  OS << "[exhaustive]";
369  for (unsigned I = 0, N = ConfigMacros.size(); I != N; ++I) {
370  if (I)
371  OS << ", ";
372  OS << ConfigMacros[I];
373  }
374  OS << "\n";
375  }
376 
377  struct {
378  StringRef Prefix;
380  } Kinds[] = {{"", HK_Normal},
381  {"textual ", HK_Textual},
382  {"private ", HK_Private},
383  {"private textual ", HK_PrivateTextual},
384  {"exclude ", HK_Excluded}};
385 
386  for (auto &K : Kinds) {
387  for (auto &H : Headers[K.Kind]) {
388  OS.indent(Indent + 2);
389  OS << K.Prefix << "header \"";
390  OS.write_escaped(H.NameAsWritten);
391  OS << "\"\n";
392  }
393  }
394 
396  MI != MIEnd; ++MI)
397  // Print inferred subframework modules so that we don't need to re-infer
398  // them (requires expensive directory iteration + stat calls) when we build
399  // the module. Regular inferred submodules are OK, as we need to look at all
400  // those header files anyway.
401  if (!(*MI)->IsInferred || (*MI)->IsFramework)
402  (*MI)->print(OS, Indent + 2);
403 
404  for (unsigned I = 0, N = Exports.size(); I != N; ++I) {
405  OS.indent(Indent + 2);
406  OS << "export ";
407  if (Module *Restriction = Exports[I].getPointer()) {
408  OS << Restriction->getFullModuleName();
409  if (Exports[I].getInt())
410  OS << ".*";
411  } else {
412  OS << "*";
413  }
414  OS << "\n";
415  }
416 
417  for (unsigned I = 0, N = UnresolvedExports.size(); I != N; ++I) {
418  OS.indent(Indent + 2);
419  OS << "export ";
421  if (UnresolvedExports[I].Wildcard)
422  OS << (UnresolvedExports[I].Id.empty() ? "*" : ".*");
423  OS << "\n";
424  }
425 
426  for (unsigned I = 0, N = DirectUses.size(); I != N; ++I) {
427  OS.indent(Indent + 2);
428  OS << "use ";
429  OS << DirectUses[I]->getFullModuleName();
430  OS << "\n";
431  }
432 
433  for (unsigned I = 0, N = UnresolvedDirectUses.size(); I != N; ++I) {
434  OS.indent(Indent + 2);
435  OS << "use ";
437  OS << "\n";
438  }
439 
440  for (unsigned I = 0, N = LinkLibraries.size(); I != N; ++I) {
441  OS.indent(Indent + 2);
442  OS << "link ";
444  OS << "framework ";
445  OS << "\"";
446  OS.write_escaped(LinkLibraries[I].Library);
447  OS << "\"";
448  }
449 
450  for (unsigned I = 0, N = UnresolvedConflicts.size(); I != N; ++I) {
451  OS.indent(Indent + 2);
452  OS << "conflict ";
454  OS << ", \"";
455  OS.write_escaped(UnresolvedConflicts[I].Message);
456  OS << "\"\n";
457  }
458 
459  for (unsigned I = 0, N = Conflicts.size(); I != N; ++I) {
460  OS.indent(Indent + 2);
461  OS << "conflict ";
462  OS << Conflicts[I].Other->getFullModuleName();
463  OS << ", \"";
464  OS.write_escaped(Conflicts[I].Message);
465  OS << "\"\n";
466  }
467 
468  if (InferSubmodules) {
469  OS.indent(Indent + 2);
471  OS << "explicit ";
472  OS << "module * {\n";
473  if (InferExportWildcard) {
474  OS.indent(Indent + 4);
475  OS << "export *\n";
476  }
477  OS.indent(Indent + 2);
478  OS << "}\n";
479  }
480 
481  OS.indent(Indent);
482  OS << "}\n";
483 }
484 
485 LLVM_DUMP_METHOD void Module::dump() const {
486  print(llvm::errs());
487 }
488 
491  assert(Loc.isValid() && "setVisible expects a valid import location");
492  if (isVisible(M))
493  return;
494 
495  ++Generation;
496 
497  struct Visiting {
498  Module *M;
499  Visiting *ExportedBy;
500  };
501 
502  std::function<void(Visiting)> VisitModule = [&](Visiting V) {
503  // Modules that aren't available cannot be made visible.
504  if (!V.M->isAvailable())
505  return;
506 
507  // Nothing to do for a module that's already visible.
508  unsigned ID = V.M->getVisibilityID();
509  if (ImportLocs.size() <= ID)
510  ImportLocs.resize(ID + 1);
511  else if (ImportLocs[ID].isValid())
512  return;
513 
514  ImportLocs[ID] = Loc;
515  Vis(M);
516 
517  // Make any exported modules visible.
519  V.M->getExportedModules(Exports);
520  for (Module *E : Exports)
521  VisitModule({E, &V});
522 
523  for (auto &C : V.M->Conflicts) {
524  if (isVisible(C.Other)) {
526  for (Visiting *I = &V; I; I = I->ExportedBy)
527  Path.push_back(I->M);
528  Cb(Path, C.Other, C.Message);
529  }
530  }
531  };
532  VisitModule({M, nullptr});
533 }
unsigned IsAvailable
Whether this module is available in the current translation unit.
Definition: Basic/Module.h:160
SmallVector< UnresolvedExportDecl, 2 > UnresolvedExports
The set of export declarations that have yet to be resolved.
Definition: Basic/Module.h:248
std::string Name
The name of this module.
Definition: Basic/Module.h:50
Header getUmbrellaHeader() const
Retrieve the header that serves as the umbrella header for this module.
Definition: Basic/Module.h:401
Implements support for file system lookup, file system caching, and directory search management...
Definition: FileManager.h:117
Defines the clang::FileManager interface and associated types.
submodule_iterator submodule_begin()
Definition: Basic/Module.h:474
unsigned IsExternC
Whether this is an 'extern "C"' module (which implicitly puts all headers in it within an 'extern "...
Definition: Basic/Module.h:178
std::vector< UnresolvedConflict > UnresolvedConflicts
The list of conflicts for which the module-id has not yet been resolved.
Definition: Basic/Module.h:292
Module * getTopLevelModule()
Retrieve the top-level module for this (sub)module, which may be this module.
Definition: Basic/Module.h:368
Defines the clang::Module class, which describes a module in the source code.
static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, const TargetInfo &Target)
Determine whether a translation unit built using the current language options has the given feature...
unsigned IsFramework
Whether this is a framework module.
Definition: Basic/Module.h:166
void addRequirement(StringRef Feature, bool RequiredState, const LangOptions &LangOpts, const TargetInfo &Target)
Add the given feature requirement to the list of features required by this module.
void getExportedModules(SmallVectorImpl< Module * > &Exported) const
Appends this module's list of exported modules to Exported.
llvm::function_ref< void(Module *M)> VisibleCallback
A callback to call when a module is made visible (directly or indirectly) by a call to setVisible...
Definition: Basic/Module.h:545
void markUnavailable(bool MissingRequirement=false)
Mark this module and all of its submodules as unavailable.
std::string getFullModuleName() const
Retrieve the full name of this module, including the path from its top-level module.
class LLVM_ALIGNAS(8) DependentTemplateSpecializationType const IdentifierInfo * Name
Represents a template specialization type whose template cannot be resolved, e.g. ...
Definition: Type.h:4549
static bool HasFeature(const Preprocessor &PP, StringRef Feature)
HasFeature - Return true if we recognize and implement the feature specified by the identifier as a s...
void dump() const
Dump the contents of this module to the given output stream.
SmallVector< Requirement, 2 > Requirements
The set of language features required to use this module.
Definition: Basic/Module.h:148
bool fullModuleNameIs(ArrayRef< StringRef > nameParts) const
Whether the full name of this module is equal to joining nameParts with "."s.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
Definition: LangOptions.h:48
Describes a module or submodule.
Definition: Basic/Module.h:47
bool directlyUses(const Module *Requested) const
Determine whether this module has declared its intention to directly use another module.
unsigned InferExportWildcard
Whether, when inferring submodules, the inferr submodules should export all modules they import (e...
Definition: Basic/Module.h:195
bool isAvailable() const
Determine whether this module is available for use within the current translation unit...
Definition: Basic/Module.h:314
Module * Parent
The parent of this module.
Definition: Basic/Module.h:57
submodule_iterator submodule_end()
Definition: Basic/Module.h:476
detail::InMemoryDirectory::const_iterator I
std::vector< Module * >::iterator submodule_iterator
Definition: Basic/Module.h:471
std::vector< std::string > ModuleFeatures
The names of any features to enable in module 'requires' decls in addition to the hard-coded list in ...
Definition: LangOptions.h:113
unsigned IsSystem
Whether this is a "system" module (which assumes that all headers in it are system headers)...
Definition: Basic/Module.h:173
const FileEntry * getFile(StringRef Filename, bool OpenFile=false, bool CacheFailure=true)
Lookup, cache, and verify the specified file (real or virtual).
Module * findSubmodule(StringRef Name) const
Find the submodule with the given name.
llvm::SmallSetVector< Module *, 2 > Imports
The set of modules imported by this module, and on which this module depends.
Definition: Basic/Module.h:221
static void printModuleId(raw_ostream &OS, const ModuleId &Id)
std::vector< bool > & Stack
const DirectoryEntry * Entry
Definition: Basic/Module.h:120
void setVisible(Module *M, SourceLocation Loc, VisibleCallback Vis=[](Module *){}, ConflictCallback Cb=[](ArrayRef< Module * >, Module *, StringRef){})
Make a specific module visible.
Exposes information about the current target.
Defines the clang::LangOptions interface.
SmallVector< ModuleId, 2 > UnresolvedDirectUses
The set of use declarations that have yet to be resolved.
Definition: Basic/Module.h:254
unsigned ConfigMacrosExhaustive
Whether the set of configuration macros is exhaustive.
Definition: Basic/Module.h:202
ArrayRef< const FileEntry * > getTopHeaders(FileManager &FileMgr)
The top-level headers associated with this module.
llvm::SmallVector< LinkLibrary, 2 > LinkLibraries
The set of libraries or frameworks to link against when an entity from this module is used...
Definition: Basic/Module.h:275
Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, bool IsFramework, bool IsExplicit, unsigned VisibilityID)
Construct a new module or submodule.
SmallVector< std::pair< std::string, SourceLocation >, 2 > ModuleId
Describes the name of a module.
Definition: Basic/Module.h:41
bool isSubModuleOf(const Module *Other) const
Determine whether this module is a submodule of the given other module.
std::vector< Module * >::const_iterator submodule_const_iterator
Definition: Basic/Module.h:472
DirectoryName getUmbrellaDir() const
Retrieve the directory for which this module serves as the umbrella.
Information about a header directive as found in the module map file.
Definition: Basic/Module.h:109
The result type of a method or function.
SmallVector< ExportDecl, 2 > Exports
The set of export declarations.
Definition: Basic/Module.h:230
#define false
Definition: stdbool.h:33
Kind
void print(raw_ostream &OS, unsigned Indent=0) const
Print the module map for this module to the given stream.
Encodes a location in the source.
const TemplateArgument * iterator
Definition: Type.h:4233
bool isValid() const
Return true if this is a valid SourceLocation object.
const std::string ID
Information about a directory name as found in the module map file.
Definition: Basic/Module.h:118
Cached information about one file (either on disk or in the virtual file system). ...
Definition: FileManager.h:53
SmallVector< Header, 2 > Headers[5]
The headers that are part of this module.
Definition: Basic/Module.h:126
unsigned IsMissingRequirement
Whether this module is missing a feature from Requirements.
Definition: Basic/Module.h:151
Stored information about a header directive that was found in the module map file but has not been re...
Definition: Basic/Module.h:130
llvm::PointerUnion< const DirectoryEntry *, const FileEntry * > Umbrella
The umbrella header or directory.
Definition: Basic/Module.h:65
detail::InMemoryDirectory::const_iterator E
llvm::function_ref< void(ArrayRef< Module * > Path, Module *Conflict, StringRef Message)> ConflictCallback
A callback to call when a module conflict is found.
Definition: Basic/Module.h:551
std::vector< Conflict > Conflicts
The list of conflicts.
Definition: Basic/Module.h:304
SmallVector< Module *, 2 > DirectUses
The directly used modules.
Definition: Basic/Module.h:251
std::pair< std::string, bool > Requirement
An individual requirement: a feature name and a flag indicating the required state of that feature...
Definition: Basic/Module.h:142
Cached information about one directory (either on disk or in the virtual file system).
Definition: FileManager.h:40
bool isTLSSupported() const
Whether the target supports thread-local storage.
FormatToken * Current
unsigned InferSubmodules
Whether we should infer submodules for this module based on the headers.
Definition: Basic/Module.h:187
Defines the clang::TargetInfo interface.
std::vector< std::string > ConfigMacros
The set of "configuration macros", which are macros that (intentionally) change how this module is bu...
Definition: Basic/Module.h:279
virtual bool hasFeature(StringRef Feature) const
Determine whether the given target has the given feature.
std::string UmbrellaAsWritten
The name of the umbrella entry, as written in the module map.
Definition: Basic/Module.h:71
#define true
Definition: stdbool.h:32
unsigned IsExplicit
Whether this is an explicit submodule.
Definition: Basic/Module.h:169
unsigned InferExplicitSubmodules
Whether, when inferring submodules, the inferred submodules should be explicit.
Definition: Basic/Module.h:191
unsigned Indent
The current line's indent.