15#include "llvm/ADT/STLExtras.h"
16#include "llvm/Support/BLAKE3.h"
20using namespace tooling;
21using namespace dependencies;
26 for (StringRef FileDep : FileDeps) {
27 auto ResolvedFileDep =
36 assert(!std::holds_alternative<std::monostate>(BuildInfo) &&
37 "Using uninitialized ModuleDeps");
38 if (
const auto *CI = std::get_if<CowCompilerInvocation>(&BuildInfo))
39 BuildInfo = CI->getCC1CommandLine();
40 return std::get<std::vector<std::string>>(BuildInfo);
46 for (
const auto Dep : ModuleFileDependents) {
49 PrebuiltModulesMap[Dep].updateDependentsNotInStableDirs(PrebuiltModulesMap);
60 std::vector<HeaderSearchOptions::Entry> Entries;
63 llvm::BitVector SearchPathUsage(Entries.size());
64 llvm::DenseSet<const serialization::ModuleFile *>
Visited;
75 if (SearchPathUsage.size() != Entries.size())
76 llvm::report_fatal_error(
77 "Inconsistent search path options between modules detected");
79 for (
auto Idx : SearchPathUsage.set_bits())
80 Opts.
UserEntries.push_back(std::move(Entries[Idx]));
83 std::vector<std::string> VFSOverlayFiles;
86 llvm::BitVector VFSUsage(VFSOverlayFiles.size());
87 llvm::DenseSet<const serialization::ModuleFile *>
Visited;
101 auto PrebuiltModulePropIt =
102 PrebuiltModulesASTMap.find(MF->
FileName);
103 if (PrebuiltModulePropIt == PrebuiltModulesASTMap.end())
105 for (std::size_t I = 0,
E = VFSOverlayFiles.size(); I !=
E; ++I) {
106 if (PrebuiltModulePropIt->second.getVFS().contains(
114 if (VFSUsage.size() != VFSOverlayFiles.size())
115 llvm::report_fatal_error(
116 "Inconsistent -ivfsoverlay options between modules detected");
118 for (
auto Idx : VFSUsage.set_bits())
124 bool IsSystemModule) {
129 bool Wsystem_headers =
false;
130 for (StringRef Opt : Opts.
Warnings) {
131 bool isPositive = !Opt.consume_front(
"no-");
132 if (Opt ==
"system-headers")
133 Wsystem_headers = isPositive;
151static std::vector<std::string>
splitString(std::string S,
char Separator) {
153 StringRef(S).split(Segments, Separator, -1,
false);
154 std::vector<std::string>
Result;
155 Result.reserve(Segments.size());
156 for (StringRef Segment : Segments)
157 Result.push_back(Segment.str());
207 const StringRef Input) {
208 using namespace llvm::sys;
210 if (!path::is_absolute(Input))
213 auto PathStartsWith = [](StringRef Prefix, StringRef
Path) {
214 auto PrefixIt = path::begin(Prefix), PrefixEnd = path::end(Prefix);
215 for (
auto PathIt = path::begin(
Path), PathEnd = path::end(
Path);
216 PrefixIt != PrefixEnd && PathIt != PathEnd; ++PrefixIt, ++PathIt) {
217 if (*PrefixIt != *PathIt)
220 return PrefixIt == PrefixEnd;
223 return any_of(Directories, [&](StringRef Dir) {
224 return !Dir.empty() && PathStartsWith(Dir, Input);
231 "Sysroots differ between module dependencies and current TU");
234 "ResourceDirs differ between module dependencies and current TU");
237 if (!Entry.IgnoreSysRoot)
287 [&CI](
const std::pair<std::string, bool> &Def) {
288 StringRef MacroDef = Def.first;
289 return CI.getHeaderSearchOpts().ModulesIgnoreMacros.contains(
290 llvm::CachedHashString(MacroDef.split(
'=').first));
300ModuleDepCollector::getInvocationAdjustedForModuleBuildWithoutOutputs(
314 auto CurrentModuleMapEntry =
316 assert(CurrentModuleMapEntry &&
"module map file entry not found");
325 auto ModuleMapEntry =
327 assert(ModuleMapEntry &&
"module map file entry not found");
335 DepModuleMapFiles.contains(*ModuleMapEntry))
340 if (*ModuleMapEntry == *CurrentModuleMapEntry &&
341 !DepModuleMapFiles.contains(*ModuleMapEntry))
368llvm::DenseSet<const FileEntry *> ModuleDepCollector::collectModuleMapFiles(
370 llvm::DenseSet<const FileEntry *> ModuleMapFiles;
371 for (
const ModuleID &MID : ClangModuleDeps) {
373 assert(MD &&
"Inconsistent dependency info");
377 assert(FE &&
"Missing module map file that was previously found");
378 ModuleMapFiles.insert(*FE);
380 return ModuleMapFiles;
383void ModuleDepCollector::addModuleMapFiles(
388 for (
const ModuleID &MID : ClangModuleDeps) {
390 assert(MD &&
"Inconsistent dependency info");
395void ModuleDepCollector::addModuleFiles(
397 for (
const ModuleID &MID : ClangModuleDeps) {
399 std::string PCMPath =
406 {MID.ModuleName, std::move(PCMPath)});
410void ModuleDepCollector::addModuleFiles(
412 for (
const ModuleID &MID : ClangModuleDeps) {
414 std::string PCMPath =
421 {MID.ModuleName, std::move(PCMPath)});
449 CurrentModuleMap->getNameAsRequested());
452 for (
const auto &KV : ModularDeps)
453 if (DirectModularDeps.contains(KV.first))
454 DirectDeps.push_back(KV.second->ID);
457 addModuleMapFiles(CI, DirectDeps);
459 addModuleFiles(CI, DirectDeps);
461 for (
const auto &KV : DirectPrebuiltModularDeps)
470#define IF_RELATIVE_RETURN_FALSE(PATH) \
472 if (!PATH.empty() && !llvm::sys::path::is_absolute(PATH)) \
476#define IF_ANY_RELATIVE_RETURN_FALSE(PATHS) \
478 if (llvm::any_of(PATHS, [](const auto &P) { \
479 return !P.empty() && !llvm::sys::path::is_absolute(P); \
487 for (
auto &Entry : HeaderSearchOpts.UserEntries)
488 if (Entry.IgnoreSysRoot)
493 for (
auto I = HeaderSearchOpts.PrebuiltModuleFiles.begin(),
494 E = HeaderSearchOpts.PrebuiltModuleFiles.end();
551 llvm::vfs::FileSystem &
VFS) {
552 llvm::HashBuilder<llvm::TruncatedBLAKE3<16>, llvm::endianness::native>
559 llvm::ErrorOr<std::string> CWD =
VFS.getCurrentWorkingDirectory();
561 HashBuilder.add(*CWD);
565 ArgVec.reserve(4096);
567 Arg.toVector(ArgVec);
568 ArgVec.push_back(
'\0');
570 HashBuilder.add(ArgVec);
578 HashBuilder.add(ID.ModuleName);
579 HashBuilder.add(ID.ContextHash);
582 HashBuilder.add(EagerLoadModules);
584 llvm::BLAKE3Result<16> Hash = HashBuilder.final();
585 std::array<uint64_t, 2> Words;
586 static_assert(
sizeof(Hash) ==
sizeof(Words),
"Hash must match Words");
587 std::memcpy(Words.data(), Hash.data(),
sizeof(Hash));
588 return toString(llvm::APInt(
sizeof(Words) * 8, Words), 36,
false);
591void ModuleDepCollector::associateWithContextHash(
596 bool Inserted = ModuleDepsByID.insert({Deps.
ID, &Deps}).second;
598 assert(Inserted &&
"duplicate module mapping");
614 if (std::optional<StringRef>
Filename =
SM.getNonBuiltinFilenameForID(FID))
615 MDC.addFileDep(llvm::sys::path::remove_leading_dotslash(*
Filename));
621 StringRef SearchPath, StringRef RelativePath,
const Module *SuggestedModule,
623 if (!
File && !ModuleImported) {
628 handleImport(SuggestedModule);
636 RequiredModule.
ModuleName =
Path[0].getIdentifierInfo()->getName().str();
638 MDC.RequiredStdCXXModules.push_back(std::move(RequiredModule));
642 handleImport(Imported);
645void ModuleDepCollectorPP::handleImport(
const Module *Imported) {
651 if (MDC.isPrebuiltModule(TopLevelModule))
652 MDC.DirectPrebuiltModularDeps.insert(
655 MDC.DirectModularDeps.insert(TopLevelModule);
656 MDC.DirectImports.insert(Imported);
667 if (PP.isInNamedModule()) {
669 ProvidedModule.
ModuleName = PP.getNamedModuleName();
675 if (PP.isInImplementationUnit())
676 MDC.RequiredStdCXXModules.push_back(ProvidedModule);
678 MDC.ProvidedStdCXXModule = ProvidedModule;
686 if (!MDC.isPrebuiltModule(M))
687 MDC.DirectModularDeps.insert(M);
689 MDC.addVisibleModules();
691 for (
const Module *M : MDC.DirectModularDeps)
692 handleTopLevelModule(M);
700 MDC.ProvidedStdCXXModule, MDC.RequiredStdCXXModules);
702 for (
auto &&I : MDC.ModularDeps)
705 for (
const Module *M : MDC.DirectModularDeps) {
706 auto It = MDC.ModularDeps.find(M);
708 if (It != MDC.ModularDeps.end())
712 for (
auto &&I : MDC.VisibleModules)
715 for (
auto &&I : MDC.FileDeps)
718 for (
auto &&I : MDC.DirectPrebuiltModularDeps)
722std::optional<ModuleID>
723ModuleDepCollectorPP::handleTopLevelModule(
const Module *M) {
734 if (
auto ModI = MDC.ModularDeps.find(M); ModI != MDC.ModularDeps.end())
735 return ModI->second->ID;
737 auto OwnedMD = std::make_unique<ModuleDeps>();
763 MDC.ScanInstance.
getASTReader()->getModuleManager().lookup(
779 llvm::DenseSet<const Module *> SeenDeps;
780 addAllSubmodulePrebuiltDeps(M, MD, SeenDeps);
781 addAllSubmoduleDeps(M, MD, SeenDeps);
782 addAllAffectingClangModules(M, MD, SeenDeps);
785 PathBuf.reserve(256);
790 auto FullFilePath = ASTReader::ResolveImportedPath(
791 PathBuf, IFI.UnresolvedImportedFilename, MF->BaseDirectory);
792 MD.IsInStableDirectories =
793 isPathInStableDir(MDC.StableDirs, *FullFilePath);
798 "__inferred_module.map"))
808 MDC.getInvocationAdjustedForModuleBuildWithoutOutputs(
815 MDC.PrebuiltModulesASTMap,
828 llvm::ErrorOr<std::string> CWD =
830 .getCurrentWorkingDirectory();
842 MDC.associateWithContextHash(CI,
IgnoreCWD, MD);
845 MDC.addOutputPaths(CI, MD);
847 MD.BuildInfo = std::move(CI);
849 MDC.ModularDeps.insert({M, std::move(OwnedMD)});
855 llvm::function_ref<
void(
const Module *)> F) {
860 llvm::stable_sort(Submodules, [](
const Module *A,
const Module *B) {
863 for (
const Module *SubM : Submodules)
867void ModuleDepCollectorPP::addAllSubmodulePrebuiltDeps(
869 llvm::DenseSet<const Module *> &SeenSubmodules) {
870 addModulePrebuiltDeps(M, MD, SeenSubmodules);
873 addAllSubmodulePrebuiltDeps(SubM, MD, SeenSubmodules);
877void ModuleDepCollectorPP::addModulePrebuiltDeps(
879 llvm::DenseSet<const Module *> &SeenSubmodules) {
882 if (MDC.isPrebuiltModule(
Import->getTopLevelModule()))
883 if (SeenSubmodules.insert(
Import->getTopLevelModule()).second) {
886 auto PrebuiltModulePropIt = MDC.PrebuiltModulesASTMap.find(
889 (PrebuiltModulePropIt != MDC.PrebuiltModulesASTMap.end()) &&
890 PrebuiltModulePropIt->second.isInStableDir();
895void ModuleDepCollectorPP::addAllSubmoduleDeps(
897 llvm::DenseSet<const Module *> &AddedModules) {
898 addModuleDep(M, MD, AddedModules);
901 addAllSubmoduleDeps(SubM, MD, AddedModules);
905void ModuleDepCollectorPP::addOneModuleDep(
const Module *M,
const ModuleID ID,
912void ModuleDepCollectorPP::addModuleDep(
914 llvm::DenseSet<const Module *> &AddedModules) {
917 !MDC.isPrebuiltModule(
Import)) {
918 if (
auto ImportID = handleTopLevelModule(
Import->getTopLevelModule()))
919 if (AddedModules.insert(
Import->getTopLevelModule()).second)
920 addOneModuleDep(
Import->getTopLevelModule(), *ImportID, MD);
925void ModuleDepCollectorPP::addAllAffectingClangModules(
927 llvm::DenseSet<const Module *> &AddedModules) {
928 addAffectingClangModule(M, MD, AddedModules);
931 addAllAffectingClangModules(SubM, MD, AddedModules);
934void ModuleDepCollectorPP::addAffectingClangModule(
936 llvm::DenseSet<const Module *> &AddedModules) {
939 "Not quite import not top-level module");
941 !MDC.isPrebuiltModule(Affecting)) {
942 if (
auto ImportID = handleTopLevelModule(Affecting))
943 if (AddedModules.insert(Affecting).second)
944 addOneModuleDep(Affecting, *ImportID, MD);
951 std::unique_ptr<DependencyOutputOptions> Opts,
956 : Service(Service), ScanInstance(ScanInstance), Consumer(
C),
957 Controller(Controller),
958 PrebuiltModulesASTMap(
std::move(PrebuiltModulesASTMap)),
959 StableDirs(StableDirs), Opts(
std::move(Opts)),
969bool ModuleDepCollector::isPrebuiltModule(
const Module *M) {
971 const auto &PrebuiltModuleFiles =
973 auto PrebuiltModuleFileIt = PrebuiltModuleFiles.find(Name);
974 if (PrebuiltModuleFileIt == PrebuiltModuleFiles.end())
976 assert(
"Prebuilt module came from the expected AST file" &&
981void ModuleDepCollector::addVisibleModules() {
982 llvm::DenseSet<const Module *> ImportedModules;
983 auto InsertVisibleModules = [&](
const Module *M) {
984 if (ImportedModules.contains(M))
990 while (!Stack.empty()) {
991 const Module *CurrModule = Stack.pop_back_val();
992 if (ImportedModules.contains(CurrModule))
994 ImportedModules.insert(CurrModule);
1001 InsertVisibleModules(
Import);
1006 if (llvm::sys::path::is_absolute(
Path) &&
1007 !llvm::sys::path::is_style_windows(llvm::sys::path::Style::native))
1009 Storage.assign(
Path.begin(),
Path.end());
1011 llvm::sys::path::make_preferred(Storage);
1012 return StringRef(Storage.data(), Storage.size());
1015void ModuleDepCollector::addFileDep(StringRef
Path) {
1019 FileDeps.emplace_back(
Path);
1025 FileDeps.emplace_back(
Path);
1028void ModuleDepCollector::addFileDep(
ModuleDeps &MD, StringRef
Path) {
1029 MD.FileDeps.emplace_back(
Path);
llvm::DenseSet< const void * > Visited
llvm::MachO::FileType FileType
llvm::MachO::Target Target
static std::vector< std::string > splitString(std::string S, char Separator)
static void optimizeHeaderSearchOpts(HeaderSearchOptions &Opts, ASTReader &Reader, const serialization::ModuleFile &MF, const PrebuiltModulesAttrsMap &PrebuiltModulesASTMap, ScanningOptimizations OptimizeArgs)
static void optimizeDiagnosticOpts(DiagnosticOptions &Opts, bool IsSystemModule)
static StringRef makeAbsoluteAndPreferred(CompilerInstance &CI, StringRef Path, SmallVectorImpl< char > &Storage)
#define IF_RELATIVE_RETURN_FALSE(PATH)
static CowCompilerInvocation makeCommonInvocationForModuleBuild(CompilerInvocation CI)
static void forEachSubmoduleSorted(const Module *M, llvm::function_ref< void(const Module *)> F)
static bool needsModules(FrontendInputFile FIF)
static bool isSafeToIgnoreCWD(const CowCompilerInvocation &CI)
#define IF_ANY_RELATIVE_RETURN_FALSE(PATHS)
static std::string getModuleContextHash(const ModuleDeps &MD, const CowCompilerInvocation &CI, bool EagerLoadModules, bool IgnoreCWD, llvm::vfs::FileSystem &VFS)
static void optimizeCWD(CowCompilerInvocation &BuildInvocation, StringRef CWD)
Defines the clang::Preprocessor interface.
static std::string toString(const clang::SanitizerSet &Sanitizers)
Produce a string containing comma-separated names of sanitizers in Sanitizers set.
Reads an AST files chain containing the contents of a translation unit.
static TemporarilyOwnedStringRef ResolveImportedPath(SmallString< 0 > &Buf, StringRef Path, ModuleFile &ModF)
Resolve Path in the context of module file M.
Represents a character-granular source range.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
std::string CoverageNotesFile
The filename with path we use for coverage notes files.
std::string ProfileInstrumentUsePath
Name of the profile file to use as input for -fprofile-instr-use.
std::string SampleProfileFile
Name of the profile file to use with -fprofile-sample-use.
std::string CoverageDataFile
The filename with path we use for coverage data files.
std::string DebugCompilationDir
The string to embed in debug information as the current working directory.
std::string MainFileName
The user provided name for the "main file", if non-empty.
std::string CoverageCompilationDir
The string to embed in coverage mapping as the current working directory.
std::string ProfileRemappingFile
Name of the profile remapping file to apply to the profile data supplied by -fprofile-sample-use or -...
std::string DwarfDebugFlags
The string to embed in the debug information for the compile unit, if non-empty.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
FileManager & getFileManager() const
Return the current file manager to the caller.
IntrusiveRefCntPtr< ASTReader > getASTReader() const
Preprocessor & getPreprocessor() const
Return the current preprocessor.
HeaderSearchOptions & getHeaderSearchOpts()
CompilerInvocation & getInvocation()
PreprocessorOptions & getPreprocessorOpts()
llvm::vfs::FileSystem & getVirtualFileSystem() const
SourceManager & getSourceManager() const
Return the current source manager.
const FrontendOptions & getFrontendOpts() const
const CodeGenOptions & getCodeGenOpts() const
const FileSystemOptions & getFileSystemOpts() const
void generateCC1CommandLine(llvm::SmallVectorImpl< const char * > &Args, StringAllocator SA) const
Generate cc1-compatible command line arguments from this instance.
const DependencyOutputOptions & getDependencyOutputOpts() const
const HeaderSearchOptions & getHeaderSearchOpts() const
const PreprocessorOptions & getPreprocessorOpts() const
const DiagnosticOptions & getDiagnosticOpts() const
const LangOptions & getLangOpts() const
Const getters.
Helper class for holding the data necessary to invoke the compiler.
PreprocessorOptions & getPreprocessorOpts()
void clearImplicitModuleBuildOptions()
Disable implicit modules and canonicalize options that are only used by implicit modules.
LangOptions & getLangOpts()
Mutable getters.
DependencyOutputOptions & getDependencyOutputOpts()
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
FrontendOptions & getFrontendOpts()
std::string getModuleHash() const
Retrieve a module hash string that is suitable for uniquely identifying the conditions under which th...
CodeGenOptions & getCodeGenOpts()
HeaderSearchOptions & getHeaderSearchOpts()
DiagnosticOptions & getDiagnosticOpts()
Same as CompilerInvocation, but with copy-on-write optimization.
FrontendOptions & getMutFrontendOpts()
LangOptions & getMutLangOpts()
Mutable getters.
HeaderSearchOptions & getMutHeaderSearchOpts()
CodeGenOptions & getMutCodeGenOpts()
FileSystemOptions & getMutFileSystemOpts()
DiagnosticOptions & getMutDiagnosticOpts()
DependencyOutputOptions & getMutDependencyOutputOpts()
std::string OutputFile
The file to write dependency output to.
std::vector< std::string > Targets
A list of names to use as the targets in the dependency file; this list must contain at least one ent...
std::vector< std::pair< std::string, ExtraDepKind > > ExtraDeps
A list of extra dependencies (filename and kind) to be used for every target.
Options for controlling the compiler diagnostics engine.
std::vector< std::string > Remarks
The list of -R... options used to alter the diagnostic mappings, with the prefixes removed.
std::vector< std::string > Warnings
The list of -W... options used to alter the diagnostic mappings, with the prefixes removed.
std::vector< std::string > UndefPrefixes
The list of prefixes from -Wundef-prefix=... used to generate warnings for undefined macros.
std::vector< std::string > SystemHeaderWarningsModules
The list of -Wsystem-headers-in-module=... options used to override whether -Wsystem-headers is enabl...
std::string DiagnosticSerializationFile
The file to serialize diagnostics to (non-appending).
StringRef getName() const
The name of this FileEntry.
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
OptionalFileEntryRef getOptionalFileRef(StringRef Filename, bool OpenFile=false, bool CacheFailure=true)
Get a FileEntryRef if it exists, without doing anything on error.
bool makeAbsolutePath(SmallVectorImpl< char > &Path) const
Makes Path absolute taking into account FileSystemOptions and the working directory option.
std::string WorkingDir
If set, paths are resolved as if the working directory was set to the value of WorkingDir.
InputKind DashX
The input kind, either specified via -x argument or deduced from the input file name.
std::vector< std::string > ModuleFiles
The list of additional prebuilt module files to load before processing the input.
unsigned IsSystemModule
When using -emit-module, treat the modulemap as a system module.
std::vector< std::string > LLVMArgs
A list of arguments to forward to LLVM's option processing; this should only be used for debugging an...
std::string OutputFile
The output file, if any.
SmallVector< FrontendInputFile, 0 > Inputs
The input files and their types.
frontend::ActionKind ProgramAction
The frontend action to perform.
std::vector< std::string > ModuleMapFiles
The list of module map files to load before processing the input.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
std::string ModuleName
The module currently being compiled as specified by -fmodule-name.
std::vector< std::string > NoSanitizeFiles
Paths to files specifying which objects (files, functions, variables) should not be instrumented.
OptionalFileEntryRef getModuleMapFileForUniquing(const Module *M) const
std::error_code canonicalizeModuleMapPath(SmallVectorImpl< char > &Path)
Canonicalize Path in a manner suitable for a module map file.
Describes a module or submodule.
StringRef getTopLevelModuleName() const
Retrieve the name of the top-level module.
llvm::SmallSetVector< Module *, 2 > Imports
The set of modules imported by this module, and on which this module depends.
unsigned IsSystem
Whether this is a "system" module (which assumes that all headers in it are system headers).
std::string Name
The name of this module.
llvm::iterator_range< submodule_iterator > submodules()
llvm::SmallVector< LinkLibrary, 2 > LinkLibraries
The set of libraries or frameworks to link against when an entity from this module is used.
llvm::SmallSetVector< Module *, 2 > AffectingClangModules
The set of top-level modules that affected the compilation of this module, but were not imported.
void getExportedModules(SmallVectorImpl< Module * > &Exported) const
Appends this module's list of exported modules to Exported.
std::string getFullModuleName(bool AllowStringLiterals=false) const
Retrieve the full name of this module, including the path from its top-level module.
Module * getTopLevelModule()
Retrieve the top-level module for this (sub)module, which may be this module.
OptionalFileEntryRef getASTFile() const
The serialized AST file for this module, if one was created.
bool UseExportAsModuleLinkName
Autolinking uses the framework name for linking purposes when this is false and the export_as name ot...
std::string ImplicitPCHInclude
The implicit PCH included at the start of the translation unit, or empty.
std::vector< std::pair< std::string, bool > > Macros
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
bool isInImportingCXXNamedModules() const
If we're importing a standard C++20 Named Modules.
void addPPCallbacks(std::unique_ptr< PPCallbacks > C)
Module * getCurrentModuleImplementation()
Retrieves the module whose implementation we're current compiling, if any.
HeaderSearch & getHeaderSearchInfo() const
const llvm::SmallSetVector< Module *, 2 > & getAffectingClangModules() const
Get the set of top-level clang modules that affected preprocessing, but were not imported.
Encodes a location in the source.
This class handles loading and caching of source files into memory.
OptionalFileEntryRef getFileEntryRefForID(FileID FID) const
Returns the FileEntryRef for the provided FileID.
FileID getMainFileID() const
Returns the FileID of the main source file.
Token - This structure provides full information about a lexed token.
Information about a module that has been loaded by the ASTReader.
std::string FileName
The file name of the module file.
llvm::SetVector< ModuleFile * > Imports
List of modules which this module directly imported.
llvm::BitVector SearchPathUsage
The bit vector denoting usage of each header search entry (true = used).
llvm::BitVector VFSUsage
The bit vector denoting usage of each VFS entry (true = used).
ModuleKind Kind
The type of this module.
std::string BaseDirectory
The base directory of the module.
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
@ GeneratePCH
Generate pre-compiled header.
@ GenerateModule
Generate pre-compiled module from a module map.
const unsigned VERSION_MINOR
AST file minor version number supported by this version of Clang.
const unsigned VERSION_MAJOR
AST file major version number supported by this version of Clang.
@ MK_ImplicitModule
File is an implicitly-loaded module.
The JSON file list parser is used to communicate input to InstallAPI.
if(T->getSizeExpr()) TRY_TO(TraverseStmt(const_cast< Expr * >(T -> getSizeExpr())))
void quoteMakeTarget(StringRef Target, SmallVectorImpl< char > &Res)
Quote target names for inclusion in GNU Make dependency files.
@ Asm
Assembly: we accept this only so that we can preprocess it.
@ Result
The result type of a method or function.
std::string getClangFullRepositoryVersion()
Retrieves the full repository version that is an amalgamation of the information in getClangRepositor...
int const char * function
int __ovld __cnfn any(char)
Returns 1 if the most significant bit in any component of x is set; otherwise returns 0.