18#include "llvm/ADT/IntrusiveRefCntPtr.h"
19#include "llvm/ADT/ScopeExit.h"
20#include "llvm/Option/Option.h"
21#include "llvm/Support/AdvisoryLock.h"
22#include "llvm/Support/CrashRecoveryContext.h"
23#include "llvm/Support/VirtualFileSystem.h"
24#include "llvm/TargetParser/Host.h"
36 if (LangOpts.Modules) {
39 Diags->
Report(diag::warn_pch_vfsoverlay_mismatch);
41 if (VFSOverlays.empty()) {
42 Diags->
Report(diag::note_pch_vfsoverlay_empty) <<
Type;
44 std::string Files = llvm::join(VFSOverlays,
"\n");
45 Diags->
Report(diag::note_pch_vfsoverlay_files) <<
Type << Files;
65 PrebuiltModuleListener(PrebuiltModuleFilesT &PrebuiltModuleFiles,
66 llvm::SmallVector<std::string> &NewModuleFiles,
68 const HeaderSearchOptions &HSOpts,
69 const LangOptions &LangOpts, DiagnosticsEngine &Diags,
70 const ArrayRef<StringRef> StableDirs)
71 : PrebuiltModuleFiles(PrebuiltModuleFiles),
72 NewModuleFiles(NewModuleFiles),
73 PrebuiltModulesASTMap(PrebuiltModulesASTMap), ExistingHSOpts(HSOpts),
74 ExistingLangOpts(LangOpts), Diags(Diags), StableDirs(StableDirs) {}
76 bool needsImportVisitation()
const override {
return true; }
77 bool needsInputFileVisitation()
override {
return true; }
78 bool needsSystemInputFileVisitation()
override {
return true; }
82 void visitImport(StringRef ModuleName, StringRef Filename)
override {
83 if (PrebuiltModuleFiles.insert({ModuleName.str(), Filename.str()}).second)
84 NewModuleFiles.push_back(Filename.str());
86 auto PrebuiltMapEntry = PrebuiltModulesASTMap.try_emplace(Filename);
87 PrebuiltModuleASTAttrs &PrebuiltModule = PrebuiltMapEntry.first->second;
88 if (PrebuiltMapEntry.second)
91 if (
auto It = PrebuiltModulesASTMap.find(CurrentFile);
92 It != PrebuiltModulesASTMap.end() && CurrentFile != Filename)
99 bool visitInputFileAsRequested(StringRef FilenameAsRequested,
100 StringRef Filename,
bool isSystem,
101 bool isOverridden, time_t StoredTime,
102 bool isExplicitModule)
override {
103 if (StableDirs.empty())
105 auto PrebuiltEntryIt = PrebuiltModulesASTMap.find(CurrentFile);
106 if ((PrebuiltEntryIt == PrebuiltModulesASTMap.end()) ||
107 (!PrebuiltEntryIt->second.isInStableDir()))
110 PrebuiltEntryIt->second.setInStableDir(
112 return PrebuiltEntryIt->second.isInStableDir();
117 bool DirectlyImported)
override {
120 auto PrebuiltEntryIt = PrebuiltModulesASTMap.find(CurrentFile);
121 if ((PrebuiltEntryIt != PrebuiltModulesASTMap.end()) &&
122 !PrebuiltEntryIt->second.isInStableDir())
123 PrebuiltEntryIt->second.updateDependentsNotInStableDirs(
124 PrebuiltModulesASTMap);
125 CurrentFile = Filename.
str();
130 bool ReadHeaderSearchOptions(
const HeaderSearchOptions &HSOpts,
131 StringRef ModuleFilename, StringRef ContextHash,
132 bool Complain)
override {
134 auto PrebuiltMapEntry = PrebuiltModulesASTMap.try_emplace(CurrentFile);
135 PrebuiltModuleASTAttrs &PrebuiltModule = PrebuiltMapEntry.first->second;
136 if (PrebuiltMapEntry.second)
146 bool ReadHeaderSearchPaths(
const HeaderSearchOptions &HSOpts,
147 bool Complain)
override {
149 auto PrebuiltMapEntry = PrebuiltModulesASTMap.try_emplace(CurrentFile);
150 PrebuiltModuleASTAttrs &PrebuiltModule = PrebuiltMapEntry.first->second;
151 if (PrebuiltMapEntry.second)
158 HSOpts, ExistingHSOpts, Complain ? &Diags :
nullptr, ExistingLangOpts);
162 PrebuiltModuleFilesT &PrebuiltModuleFiles;
163 llvm::SmallVector<std::string> &NewModuleFiles;
165 const HeaderSearchOptions &ExistingHSOpts;
166 const LangOptions &ExistingLangOpts;
167 DiagnosticsEngine &Diags;
168 std::string CurrentFile;
169 const ArrayRef<StringRef> StableDirs;
174static bool visitPrebuiltModule(StringRef PrebuiltModuleFilename,
176 PrebuiltModuleFilesT &ModuleFiles,
183 PrebuiltModuleListener Listener(ModuleFiles, Worklist, PrebuiltModulesASTMap,
197 while (!Worklist.empty()) {
217static std::string makeObjFileName(StringRef
FileName) {
219 llvm::sys::path::replace_extension(ObjFileName,
"o");
220 return std::string(ObjFileName);
225deduceDepTarget(
const std::string &OutputFile,
227 if (OutputFile !=
"-")
230 if (InputFiles.empty() || !InputFiles.front().isFile())
231 return "clang-scan-deps\\ dependency";
233 return makeObjFileName(InputFiles.front().getFile());
246static std::optional<StringRef> getSimpleMacroName(StringRef
Macro) {
247 StringRef Name =
Macro.split(
"=").first.ltrim(
" \t");
250 auto FinishName = [&]() -> std::optional<StringRef> {
251 StringRef SimpleName = Name.slice(0, I);
252 if (SimpleName.empty())
257 for (; I != Name.size(); ++I) {
266 if (llvm::isAlnum(Name[I]))
276 using MacroOpt = std::pair<StringRef, std::size_t>;
277 std::vector<MacroOpt> SimpleNames;
278 SimpleNames.reserve(PPOpts.
Macros.size());
279 std::size_t Index = 0;
280 for (
const auto &M : PPOpts.
Macros) {
281 auto SName = getSimpleMacroName(M.first);
285 SimpleNames.emplace_back(*SName, Index);
289 llvm::stable_sort(SimpleNames, llvm::less_first());
291 auto NewEnd = std::unique(
292 SimpleNames.rbegin(), SimpleNames.rend(),
293 [](
const MacroOpt &A,
const MacroOpt &B) { return A.first == B.first; });
294 SimpleNames.erase(SimpleNames.begin(), NewEnd.base());
297 decltype(PPOpts.
Macros) NewMacros;
298 NewMacros.reserve(SimpleNames.size());
299 for (std::size_t I = 0, E = SimpleNames.size(); I != E; ++I) {
300 std::size_t OriginalIndex = SimpleNames[I].second;
302 NewMacros.push_back(std::move(PPOpts.
Macros[OriginalIndex]));
304 std::swap(PPOpts.
Macros, NewMacros);
313 FileMgr.getVirtualFileSystem().visit([&](llvm::vfs::FileSystem &FS) {
314 auto *
DFS = llvm::dyn_cast<DependencyScanningWorkerFilesystem>(&FS);
316 assert(!DepFS &&
"Found multiple scanning VFSs");
320 assert(DepFS &&
"Did not find scanning VFS");
323 std::unique_ptr<DependencyDirectivesGetter>
324 cloneFor(FileManager &FileMgr)
override {
325 return std::make_unique<ScanningDependencyDirectivesGetter>(FileMgr);
328 std::optional<ArrayRef<dependency_directives_scan::Directive>>
329 operator()(FileEntryRef
File)
override {
330 return DepFS->getDirectiveTokens(
File.getName());
337 DiagOpts.ShowCarets =
false;
348 return llvm::StringSwitch<bool>(Warning)
349 .Cases({
"pch-vfs-diff",
"error=pch-vfs-diff"},
false)
350 .StartsWith(
"no-error=",
false)
356std::unique_ptr<DiagnosticOptions>
358 std::vector<const char *> CLI;
359 for (
const std::string &Arg : CommandLine)
360 CLI.push_back(Arg.c_str());
362 sanitizeDiagOpts(*DiagOpts);
369 std::vector<const char *> CCommandLine(CommandLine.size(),
nullptr);
370 llvm::transform(CommandLine, CCommandLine.begin(),
371 [](
const std::string &Str) { return Str.c_str(); });
378std::unique_ptr<CompilerInvocation>
381 llvm::opt::ArgStringList Argv;
382 for (
const std::string &Str :
ArrayRef(CommandLine).drop_front())
383 Argv.push_back(Str.c_str());
385 auto Invocation = std::make_unique<CompilerInvocation>();
409 std::make_unique<ScanningDependencyDirectivesGetter>(
417 auto ScanInvocation = std::make_shared<CompilerInvocation>(Invocation);
419 sanitizeDiagOpts(ScanInvocation->getDiagnosticOpts());
421 ScanInvocation->getPreprocessorOpts().AllowPCHWithDifferentModulesCachePath =
424 if (ScanInvocation->getHeaderSearchOpts().ModulesValidateOncePerBuildSession)
425 ScanInvocation->getHeaderSearchOpts().BuildSessionTimestamp =
428 ScanInvocation->getFrontendOpts().DisableFree =
false;
429 ScanInvocation->getFrontendOpts().GenerateGlobalModuleIndex =
false;
430 ScanInvocation->getFrontendOpts().UseGlobalModuleIndex =
false;
431 ScanInvocation->getFrontendOpts().GenReducedBMI =
false;
432 ScanInvocation->getFrontendOpts().ModuleOutputPath.clear();
435 ScanInvocation->getFrontendOpts().ModulesShareFileManager =
true;
436 ScanInvocation->getHeaderSearchOpts().ModuleFormat =
"raw";
437 ScanInvocation->getHeaderSearchOpts().ModulesIncludeVFSUsage =
445 ScanInvocation->getHeaderSearchOpts().ModulesStrictContextHash =
true;
446 ScanInvocation->getHeaderSearchOpts().ModulesSerializeOnlyPreprocessor =
true;
447 ScanInvocation->getHeaderSearchOpts().ModulesSkipDiagnosticOptions =
true;
448 ScanInvocation->getHeaderSearchOpts().ModulesSkipHeaderSearchPaths =
true;
449 ScanInvocation->getHeaderSearchOpts().ModulesSkipPragmaDiagnosticMappings =
451 ScanInvocation->getHeaderSearchOpts().ModulesForceValidateUserHeaders =
false;
455 ScanInvocation->getDependencyOutputOpts() = {};
459 return ScanInvocation;
469 if (!Sysroot.empty() && (llvm::sys::path::root_directory(Sysroot) != Sysroot))
474std::optional<PrebuiltModulesAttrsMap>
484 if (visitPrebuiltModule(
487 PrebuiltModulesASTMap, ScanInstance.
getDiagnostics(), StableDirs))
490 return PrebuiltModulesASTMap;
493std::unique_ptr<DependencyOutputOptions>
496 auto Opts = std::make_unique<DependencyOutputOptions>(
500 if (Opts->Targets.empty())
503 Opts->IncludeSystemHeaders =
true;
508std::shared_ptr<ModuleDepCollector>
511 std::unique_ptr<DependencyOutputOptions> DepOutputOpts,
516 auto MDC = std::make_shared<ModuleDepCollector>(
517 Service, std::move(DepOutputOpts), ScanInstance, Controller, Inv,
518 std::move(PrebuiltModulesASTMap), StableDirs);
528 std::vector<std::thread> Compiles;
533 void add(llvm::unique_function<
void()> Compile) {
534 std::lock_guard<std::mutex> Lock(Mutex);
536 Compiles.emplace_back(std::move(Compile));
542 std::lock_guard<std::mutex> Lock(Mutex);
547 for (std::thread &Compile : Compiles)
587 if (Timestamp >
CI.getHeaderSearchOpts().BuildSessionTimestamp)
590 if (!
CI.getASTReader())
591 CI.createASTReader();
597 switch (
CI.getASTReader()->ReadASTCore(
599 nullptr, Imported, {}, {}, {},
620 llvm::Error LockErr = Lock->tryLock().moveInto(Owned);
622 if (!LockErr && !Owned)
626 llvm::makeIntrusiveRefCnt<DependencyScanningWorkerFilesystem>(
629 CI.getDiagnostics(), std::move(
VFS));
630 auto DC = std::make_unique<DiagnosticConsumer>();
644 Compiles.add([Lock = std::move(Lock), ModCI1 = std::move(ModCI1),
645 ModCI2 = std::move(ModCI2), DC = std::move(DC),
648 llvm::CrashRecoveryContext CRC;
649 (void)CRC.RunSafely([&] {
651 SingleModuleWithAsyncModuleCompiles Action1(*Service, *ModController,
653 (void)ModCI1->ExecuteAction(Action1);
655 ModCI2->getPreprocessorOpts().SingleModuleParseMode = false;
656 GenerateModuleFromModuleMapAction Action2;
657 (void)ModCI2->ExecuteAction(Action2);
692 std::string Executable,
693 std::unique_ptr<CompilerInvocation> OriginalInvocation,
695 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
710 MDC->applyDiscoveredDependencies(*OriginalInvocation);
712 if (!Controller.finalize(ScanInstance, *OriginalInvocation))
715 Consumer.handleBuildCommand(
716 {Executable, OriginalInvocation->getCC1CommandLine()});
723 auto ScanInvocation =
727 std::optional<AsyncModuleCompiles> AsyncCompiles;
728 if (Service.getOpts().AsyncScanModules) {
730 auto ScanInstanceStorage = std::make_unique<CompilerInstance>(
731 std::make_shared<CompilerInvocation>(*ScanInvocation), PCHContainerOps,
732 std::move(ModCache));
741 auto MaybePrebuiltModulesASTMap =
743 if (!MaybePrebuiltModulesASTMap)
750 AsyncCompiles.emplace();
756 ScanInstanceStorage.emplace(std::move(ScanInvocation),
757 std::move(PCHContainerOps), std::move(ModCache));
764 auto MaybePrebuiltModulesASTMap =
766 if (!MaybePrebuiltModulesASTMap)
772 ScanInstance, std::move(DepOutputOpts), Service, *OriginalInvocation,
773 Controller, *MaybePrebuiltModulesASTMap, StableDirs);
778 if (!Controller.initialize(ScanInstance, *OriginalInvocation))
787 MDC->applyDiscoveredDependencies(*OriginalInvocation);
790 if (!Controller.finalize(ScanInstance, *OriginalInvocation))
793 Consumer.handleBuildCommand(
794 {Executable, OriginalInvocation->getCC1CommandLine()});
static bool checkHeaderSearchPaths(const HeaderSearchOptions &HSOpts, const HeaderSearchOptions &ExistingHSOpts, DiagnosticsEngine *Diags, const LangOptions &LangOpts)
Manages (and terminates) the asynchronous compilation of modules.
void add(llvm::unique_function< void()> Compile)
Registers the module compilation, unless this instance is about to be destroyed.
Abstract interface for callback invocations by the ASTReader.
@ ARR_Missing
The client can handle an AST file that cannot load because it is missing.
@ ARR_OutOfDate
The client can handle an AST file that cannot load because it is out-of-date relative to its input fi...
@ ARR_TreatModuleWithErrorsAsOutOfDate
If a module file is marked with errors treat it as out-of-date so the caller can rebuild it.
static bool readASTFileControlBlock(StringRef Filename, FileManager &FileMgr, const ModuleCache &ModCache, const PCHContainerReader &PCHContainerRdr, bool FindModuleFileExtensions, ASTReaderListener &Listener, bool ValidateDiagnosticOptions, unsigned ClientLoadCapabilities=ARR_ConfigurationMismatch|ARR_OutOfDate)
Read the control block for the named AST file.
@ Success
The control block was read successfully.
@ OutOfDate
The AST file is out-of-date relative to its input files, and needs to be regenerated.
@ Missing
The AST file was missing.
Configuration object for making the result of cloneForModuleCompile() thread-safe.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
void createDiagnostics(DiagnosticConsumer *Client=nullptr, bool ShouldOwnClient=true)
Create the diagnostics engine using the invocation's diagnostic options and replace any existing one ...
const PCHContainerReader & getPCHContainerReader() const
Return the appropriate PCHContainerReader depending on the current CodeGenOptions.
DiagnosticsEngine & getDiagnostics() const
Get the current diagnostics engine.
void createFileManager()
Create the file manager and replace any existing one with it.
FileManager & getFileManager() const
Return the current file manager to the caller.
ModuleCache & getModuleCache() const
void addDependencyCollector(std::shared_ptr< DependencyCollector > Listener)
Preprocessor & getPreprocessor() const
Return the current preprocessor.
void createVirtualFileSystem(IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS=llvm::vfs::getRealFileSystem(), DiagnosticConsumer *DC=nullptr)
Create a virtual file system instance based on the invocation.
FrontendOptions & getFrontendOpts()
HeaderSearchOptions & getHeaderSearchOpts()
void createSourceManager()
Create the source manager and replace any existing one with it.
CompilerInvocation & getInvocation()
PreprocessorOptions & getPreprocessorOpts()
bool ExecuteAction(FrontendAction &Act)
ExecuteAction - Execute the provided action against the compiler's CompilerInvocation object.
LangOptions & getLangOpts()
void setDependencyDirectivesGetter(std::unique_ptr< DependencyDirectivesGetter > Getter)
Helper class for holding the data necessary to invoke the compiler.
PreprocessorOptions & getPreprocessorOpts()
static bool CreateFromArgs(CompilerInvocation &Res, ArrayRef< const char * > CommandLineArgs, DiagnosticsEngine &Diags, const char *Argv0=nullptr)
Create a compiler invocation from a list of input options.
DependencyOutputOptions & getDependencyOutputOpts()
FrontendOptions & getFrontendOpts()
Functor that returns the dependency directives for a given file.
Abstract interface, implemented by clients of the front-end, which formats and prints fully processed...
Options for controlling the compiler diagnostics engine.
std::vector< std::string > Warnings
The list of -W... options used to alter the diagnostic mappings, with the prefixes removed.
std::string DiagnosticSerializationFile
The file to serialize diagnostics to (non-appending).
Concrete class used by the front-end to report problems and issues.
DiagnosticBuilder Report(SourceLocation Loc, unsigned DiagID)
Issue the message to the client.
bool hasErrorOccurred() const
void setIgnoreAllWarnings(bool Val)
When set to true, any unmapped warnings are ignored.
Implements support for file system lookup, file system caching, and directory search management.
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.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
The module cache used for compiling modules implicitly.
virtual std::time_t getModuleTimestamp(StringRef ModuleFilename)=0
Returns the timestamp denoting the last time inputs of the module file were validated.
virtual std::unique_ptr< llvm::AdvisoryLock > getLock(StringRef ModuleFilename)=0
Returns lock for the given module file. The lock is initially unlocked.
Identifies a module file to be loaded.
static ModuleFileName makeExplicit(std::string Name)
Creates a file name for an explicit module.
StringRef str() const
Returns the plain module file name.
void setBuildingModule(bool BuildingModuleFlag)
Flag indicating whether this instance is building a module.
Describes a module or submodule.
Module * getTopLevelModule()
Retrieve the top-level module for this (sub)module, which may be this module.
This interface provides a way to observe the actions of the preprocessor as it does its thing.
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
std::string ImplicitPCHInclude
The implicit PCH included at the start of the translation unit, or empty.
bool SingleModuleParseMode
When enabled, preprocessor is in a mode for parsing a single module only.
std::vector< std::pair< std::string, bool > > Macros
void addPPCallbacks(std::unique_ptr< PPCallbacks > C)
Preprocessor-based frontend action that also loads PCH files.
Encodes a location in the source.
The base class of the type hierarchy.
Dependency scanner callbacks that are used during scanning to influence the behaviour of the scan - f...
virtual void initializeScanInvocation(CompilerInvocation &ScanInvocation)
Initializes the scan invocation.
bool runInvocation(std::string Executable, std::unique_ptr< CompilerInvocation > Invocation, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, std::shared_ptr< PCHContainerOperations > PCHContainerOps, DiagnosticConsumer *DiagConsumer)
The dependency scanning service contains shared configuration and state that is used by the individua...
const DependencyScanningServiceOptions & getOpts() const
A virtual file system optimized for the dependency discovery.
void setVFS(llvm::StringSet<> &&VFS)
Update the VFSMap to the one discovered from serializing the AST file.
bool isInStableDir() const
Read-only access to whether the module is made up of dependencies in stable directories.
void addDependent(StringRef ModuleFile)
Add a direct dependent module file, so it can be updated if the current module is from stable directo...
void setInStableDir(bool V=false)
Update whether the prebuilt module resolves entirely in a stable directories.
SmallVector< StringRef > getInitialStableDirs(const CompilerInstance &ScanInstance)
bool areOptionsInStableDir(const ArrayRef< StringRef > Directories, const HeaderSearchOptions &HSOpts)
Determine if options collected from a module's compilation can safely be considered as stable.
@ VFS
Remove unused -ivfsoverlay arguments.
@ Macros
Canonicalize -D and -U options.
std::shared_ptr< CompilerInvocation > createScanCompilerInvocation(const CompilerInvocation &Invocation, const DependencyScanningService &Service, DependencyActionController &Controller)
Creates a CompilerInvocation suitable for the dependency scanner.
void initializeScanCompilerInstance(CompilerInstance &ScanInstance, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, DiagnosticConsumer *DiagConsumer, DependencyScanningService &Service, IntrusiveRefCntPtr< DependencyScanningWorkerFilesystem > DepFS)
llvm::StringMap< PrebuiltModuleASTAttrs > PrebuiltModulesAttrsMap
Attributes loaded from AST files of prebuilt modules collected prior to ModuleDepCollector creation.
std::unique_ptr< CompilerInvocation > createCompilerInvocation(ArrayRef< std::string > CommandLine, DiagnosticsEngine &Diags)
void canonicalizeDefines(PreprocessorOptions &PPOpts)
Canonicalizes command-line macro defines (e.g. removing "-DX -UX").
std::unique_ptr< DependencyOutputOptions > createDependencyOutputOptions(const CompilerInvocation &Invocation)
Creates dependency output options to be reported to the dependency consumer, deducing missing informa...
std::optional< PrebuiltModulesAttrsMap > computePrebuiltModulesASTMap(CompilerInstance &ScanInstance, SmallVector< StringRef > &StableDirs)
std::shared_ptr< ModuleCache > makeInProcessModuleCache(ModuleCacheEntries &Entries)
std::unique_ptr< DiagnosticOptions > createDiagOptions(ArrayRef< std::string > CommandLine)
bool isPathInStableDir(const ArrayRef< StringRef > Directories, const StringRef Input)
Determine if Input can be resolved within a stable directory.
std::shared_ptr< ModuleDepCollector > initializeScanInstanceDependencyCollector(CompilerInstance &ScanInstance, std::unique_ptr< DependencyOutputOptions > DepOutputOpts, DependencyScanningService &Service, CompilerInvocation &Inv, DependencyActionController &Controller, PrebuiltModulesAttrsMap PrebuiltModulesASTMap, SmallVector< StringRef > &StableDirs)
Create the dependency collector that will collect the produced dependencies.
@ DependencyDirectivesScan
This mode is used to compute the dependencies by running the preprocessor with special kind of lexing...
@ GeneratePCH
Generate pre-compiled header.
ModuleKind
Specifies the kind of module that has been loaded.
@ MK_ExplicitModule
File is an explicitly-loaded module.
@ MK_ImplicitModule
File is an implicitly-loaded module.
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< DiagnosticOptions > CreateAndPopulateDiagOpts(ArrayRef< const char * > Argv)
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
@ Result
The result type of a method or function.
IntrusiveRefCntPtr< llvm::vfs::FileSystem > createVFSFromCompilerInvocation(const CompilerInvocation &CI, DiagnosticsEngine &Diags)
int __ovld __cnfn any(char)
Returns 1 if the most significant bit in any component of x is set; otherwise returns 0.
DependencyActionController & Controller
AsyncModuleCompile(CompilerInstance &CI, DependencyScanningService &Service, DependencyActionController &Controller, AsyncModuleCompiles &Compiles)
void moduleLoadSkipped(Module *M) override
Callback invoked whenever a module load was skipped due to enabled single-module-parse-mode.
AsyncModuleCompiles & Compiles
DependencyScanningService & Service
AsyncModuleCompiles & Compiles
DependencyActionController & Controller
bool BeginSourceFileAction(CompilerInstance &CI) override
Callback at the start of processing a single input.
SingleModuleWithAsyncModuleCompiles(DependencyScanningService &Service, DependencyActionController &Controller, AsyncModuleCompiles &Compiles)
DependencyScanningService & Service
Runs the preprocessor on a TU with single-module-parse-mode and compiles modules asynchronously witho...
bool BeginSourceFileAction(CompilerInstance &CI) override
Callback at the start of processing a single input.
SingleTUWithAsyncModuleCompiles(DependencyScanningService &Service, DependencyActionController &Controller, AsyncModuleCompiles &Compiles)
AsyncModuleCompiles & Compiles
DependencyScanningService & Service
DependencyActionController & Controller
ScanningMode Mode
Whether to use optimized dependency directive scan or full preprocessing.
bool EmitWarnings
Whether the scanner should emit warnings.
std::time_t BuildSessionTimestamp
The build session timestamp for validate-once-per-build-session logic.
ScanningOptimizations OptimizeArgs
How to optimize resulting explicit module command lines.
IntrusiveRefCntPtr< DiagnosticsEngine > DiagEngine
DiagnosticsEngineWithDiagOpts(ArrayRef< std::string > CommandLine, IntrusiveRefCntPtr< llvm::vfs::FileSystem > FS, DiagnosticConsumer &DC)
std::unique_ptr< DiagnosticOptions > DiagOpts