15#include "llvm/ADT/ScopeExit.h"
16#include "llvm/TargetParser/Host.h"
26 DependencyConsumerForwarder(std::unique_ptr<DependencyOutputOptions> Opts,
27 StringRef WorkingDirectory, DependencyConsumer &C)
28 : DependencyFileGenerator(*Opts), WorkingDirectory(WorkingDirectory),
29 Opts(std::move(Opts)), C(C) {}
31 void finishedMainFile(DiagnosticsEngine &Diags)
override {
32 C.handleDependencyOutputOpts(*Opts);
33 llvm::SmallString<256> CanonPath;
34 for (
const auto &
File : getDependencies()) {
36 llvm::sys::path::remove_dots(CanonPath,
true);
37 llvm::sys::path::make_absolute(WorkingDirectory, CanonPath);
38 C.handleFileDependency(CanonPath);
43 StringRef WorkingDirectory;
44 std::unique_ptr<DependencyOutputOptions> Opts;
45 DependencyConsumer &C;
52 if (LangOpts.Modules) {
55 Diags->
Report(diag::warn_pch_vfsoverlay_mismatch);
57 if (VFSOverlays.empty()) {
58 Diags->
Report(diag::note_pch_vfsoverlay_empty) <<
Type;
60 std::string Files = llvm::join(VFSOverlays,
"\n");
61 Diags->
Report(diag::note_pch_vfsoverlay_files) <<
Type << Files;
79 PrebuiltModuleListener(PrebuiltModuleFilesT &PrebuiltModuleFiles,
80 llvm::SmallVector<std::string> &NewModuleFiles,
82 const HeaderSearchOptions &HSOpts,
83 const LangOptions &LangOpts, DiagnosticsEngine &Diags,
84 const ArrayRef<StringRef> StableDirs)
85 : PrebuiltModuleFiles(PrebuiltModuleFiles),
86 NewModuleFiles(NewModuleFiles),
87 PrebuiltModulesASTMap(PrebuiltModulesASTMap), ExistingHSOpts(HSOpts),
88 ExistingLangOpts(LangOpts), Diags(Diags), StableDirs(StableDirs) {}
90 bool needsImportVisitation()
const override {
return true; }
91 bool needsInputFileVisitation()
override {
return true; }
92 bool needsSystemInputFileVisitation()
override {
return true; }
96 void visitImport(StringRef ModuleName, StringRef Filename)
override {
97 if (PrebuiltModuleFiles.insert({ModuleName.str(), Filename.str()}).second)
98 NewModuleFiles.push_back(Filename.str());
100 auto PrebuiltMapEntry = PrebuiltModulesASTMap.try_emplace(Filename);
101 PrebuiltModuleASTAttrs &PrebuiltModule = PrebuiltMapEntry.first->second;
102 if (PrebuiltMapEntry.second)
105 if (
auto It = PrebuiltModulesASTMap.find(CurrentFile);
106 It != PrebuiltModulesASTMap.end() && CurrentFile != Filename)
113 bool visitInputFileAsRequested(StringRef FilenameAsRequested,
114 StringRef Filename,
bool isSystem,
116 bool isExplicitModule)
override {
117 if (StableDirs.empty())
119 auto PrebuiltEntryIt = PrebuiltModulesASTMap.find(CurrentFile);
120 if ((PrebuiltEntryIt == PrebuiltModulesASTMap.end()) ||
121 (!PrebuiltEntryIt->second.isInStableDir()))
124 PrebuiltEntryIt->second.setInStableDir(
126 return PrebuiltEntryIt->second.isInStableDir();
130 void visitModuleFile(StringRef Filename,
134 auto PrebuiltEntryIt = PrebuiltModulesASTMap.find(CurrentFile);
135 if ((PrebuiltEntryIt != PrebuiltModulesASTMap.end()) &&
136 !PrebuiltEntryIt->second.isInStableDir())
137 PrebuiltEntryIt->second.updateDependentsNotInStableDirs(
138 PrebuiltModulesASTMap);
139 CurrentFile = Filename;
144 bool ReadHeaderSearchOptions(
const HeaderSearchOptions &HSOpts,
145 StringRef ModuleFilename,
146 StringRef SpecificModuleCachePath,
147 bool Complain)
override {
149 auto PrebuiltMapEntry = PrebuiltModulesASTMap.try_emplace(CurrentFile);
150 PrebuiltModuleASTAttrs &PrebuiltModule = PrebuiltMapEntry.first->second;
151 if (PrebuiltMapEntry.second)
161 bool ReadHeaderSearchPaths(
const HeaderSearchOptions &HSOpts,
162 bool Complain)
override {
164 auto PrebuiltMapEntry = PrebuiltModulesASTMap.try_emplace(CurrentFile);
165 PrebuiltModuleASTAttrs &PrebuiltModule = PrebuiltMapEntry.first->second;
166 if (PrebuiltMapEntry.second)
172 return checkHeaderSearchPaths(
173 HSOpts, ExistingHSOpts, Complain ? &Diags :
nullptr, ExistingLangOpts);
177 PrebuiltModuleFilesT &PrebuiltModuleFiles;
178 llvm::SmallVector<std::string> &NewModuleFiles;
180 const HeaderSearchOptions &ExistingHSOpts;
181 const LangOptions &ExistingLangOpts;
182 DiagnosticsEngine &Diags;
183 std::string CurrentFile;
184 const ArrayRef<StringRef> StableDirs;
189static bool visitPrebuiltModule(StringRef PrebuiltModuleFilename,
191 PrebuiltModuleFilesT &ModuleFiles,
198 PrebuiltModuleListener Listener(ModuleFiles, Worklist, PrebuiltModulesASTMap,
202 Listener.visitModuleFile(PrebuiltModuleFilename,
211 while (!Worklist.empty()) {
224static std::string makeObjFileName(StringRef
FileName) {
226 llvm::sys::path::replace_extension(ObjFileName,
"o");
227 return std::string(ObjFileName);
232deduceDepTarget(
const std::string &OutputFile,
234 if (OutputFile !=
"-")
237 if (InputFiles.empty() || !InputFiles.front().isFile())
238 return "clang-scan-deps\\ dependency";
240 return makeObjFileName(InputFiles.front().getFile());
253static std::optional<StringRef> getSimpleMacroName(StringRef
Macro) {
254 StringRef Name =
Macro.split(
"=").first.ltrim(
" \t");
257 auto FinishName = [&]() -> std::optional<StringRef> {
258 StringRef SimpleName = Name.slice(0, I);
259 if (SimpleName.empty())
264 for (; I != Name.size(); ++I) {
273 if (llvm::isAlnum(Name[I]))
282 using MacroOpt = std::pair<StringRef, std::size_t>;
283 std::vector<MacroOpt> SimpleNames;
284 SimpleNames.reserve(PPOpts.
Macros.size());
285 std::size_t Index = 0;
286 for (
const auto &M : PPOpts.
Macros) {
287 auto SName = getSimpleMacroName(M.first);
291 SimpleNames.emplace_back(*SName, Index);
295 llvm::stable_sort(SimpleNames, llvm::less_first());
297 auto NewEnd = std::unique(
298 SimpleNames.rbegin(), SimpleNames.rend(),
299 [](
const MacroOpt &A,
const MacroOpt &B) { return A.first == B.first; });
300 SimpleNames.erase(SimpleNames.begin(), NewEnd.base());
303 decltype(PPOpts.
Macros) NewMacros;
304 NewMacros.reserve(SimpleNames.size());
305 for (std::size_t I = 0, E = SimpleNames.size(); I != E; ++I) {
306 std::size_t OriginalIndex = SimpleNames[I].second;
308 NewMacros.push_back(std::move(PPOpts.
Macros[OriginalIndex]));
310 std::swap(PPOpts.
Macros, NewMacros);
314 DependencyScanningWorkerFilesystem *DepFS;
317 ScanningDependencyDirectivesGetter(FileManager &FileMgr) : DepFS(
nullptr) {
319 auto *
DFS = llvm::dyn_cast<DependencyScanningWorkerFilesystem>(&FS);
321 assert(!DepFS &&
"Found multiple scanning VFSs");
325 assert(DepFS &&
"Did not find scanning VFS");
328 std::unique_ptr<DependencyDirectivesGetter>
329 cloneFor(FileManager &FileMgr)
override {
330 return std::make_unique<ScanningDependencyDirectivesGetter>(FileMgr);
333 std::optional<ArrayRef<dependency_directives_scan::Directive>>
334 operator()(FileEntryRef
File)
override {
335 return DepFS->getDirectiveTokens(
File.getName());
342 DiagOpts.ShowCarets =
false;
353 return llvm::StringSwitch<bool>(Warning)
354 .Cases({
"pch-vfs-diff",
"error=pch-vfs-diff"},
false)
355 .StartsWith(
"no-error=",
false)
361std::unique_ptr<DiagnosticOptions>
363 std::vector<const char *> CLI;
364 for (
const std::string &Arg : CommandLine)
365 CLI.push_back(Arg.c_str());
367 sanitizeDiagOpts(*DiagOpts);
374 std::vector<const char *> CCommandLine(CommandLine.size(),
nullptr);
375 llvm::transform(CommandLine, CCommandLine.begin(),
376 [](
const std::string &Str) { return Str.c_str(); });
383std::pair<std::unique_ptr<driver::Driver>, std::unique_ptr<driver::Compilation>>
387 llvm::BumpPtrAllocator &Alloc) {
389 Argv.reserve(ArgStrs.size());
390 for (
const std::string &Arg : ArgStrs)
391 Argv.push_back(Arg.c_str());
393 std::unique_ptr<driver::Driver> Driver = std::make_unique<driver::Driver>(
394 Argv[0], llvm::sys::getDefaultTargetTriple(), Diags,
395 "clang LLVM compiler", FS);
396 Driver->setTitle(
"clang_based_tool");
403 Diags.
Report(diag::err_drv_expand_response_file)
404 << llvm::toString(std::move(E));
405 return std::make_pair(
nullptr,
nullptr);
408 std::unique_ptr<driver::Compilation> Compilation(
409 Driver->BuildCompilation(Argv));
411 return std::make_pair(
nullptr,
nullptr);
413 if (Compilation->containsError())
414 return std::make_pair(
nullptr,
nullptr);
416 return std::make_pair(std::move(Driver), std::move(Compilation));
419std::unique_ptr<CompilerInvocation>
422 llvm::opt::ArgStringList Argv;
423 for (
const std::string &Str :
ArrayRef(CommandLine).drop_front())
424 Argv.push_back(Str.c_str());
426 auto Invocation = std::make_unique<CompilerInvocation>();
434std::pair<IntrusiveRefCntPtr<llvm::vfs::FileSystem>, std::vector<std::string>>
438 llvm::MemoryBufferRef TUBuffer) {
440 BaseFS->setCurrentWorkingDirectory(WorkingDirectory);
444 llvm::makeIntrusiveRefCnt<llvm::vfs::OverlayFileSystem>(BaseFS);
445 auto InMemoryFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
446 InMemoryFS->setCurrentWorkingDirectory(WorkingDirectory);
447 auto InputPath = TUBuffer.getBufferIdentifier();
449 InputPath, 0, llvm::MemoryBuffer::getMemBufferCopy(TUBuffer.getBuffer()));
452 OverlayFS->pushOverlay(InMemoryOverlay);
453 ModifiedFS = OverlayFS;
454 std::vector<std::string> ModifiedCommandLine(CommandLine);
455 ModifiedCommandLine.emplace_back(InputPath);
457 return std::make_pair(ModifiedFS, ModifiedCommandLine);
460std::pair<IntrusiveRefCntPtr<llvm::vfs::OverlayFileSystem>,
461 std::vector<std::string>>
465 StringRef ModuleName) {
467 BaseFS->setCurrentWorkingDirectory(WorkingDirectory);
473 llvm::makeIntrusiveRefCnt<llvm::vfs::OverlayFileSystem>(BaseFS);
474 auto InMemoryFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
475 InMemoryFS->setCurrentWorkingDirectory(WorkingDirectory);
478 llvm::sys::fs::createUniquePath(ModuleName +
"-%%%%%%%%.input", FakeInputPath,
480 InMemoryFS->addFile(FakeInputPath, 0, llvm::MemoryBuffer::getMemBuffer(
""));
482 OverlayFS->pushOverlay(InMemoryOverlay);
484 std::vector<std::string> ModifiedCommandLine(CommandLine);
485 ModifiedCommandLine.emplace_back(FakeInputPath);
487 return std::make_pair(OverlayFS, ModifiedCommandLine);
529 DepFS->resetBypassedPathPrefix();
534 if (!ModulesCachePath.empty())
535 DepFS->setBypassedPathPrefix(ModulesCachePath);
538 std::make_unique<ScanningDependencyDirectivesGetter>(
569 if (!Sysroot.empty() && (llvm::sys::path::root_directory(Sysroot) != Sysroot))
574std::optional<PrebuiltModulesAttrsMap>
584 if (visitPrebuiltModule(
587 PrebuiltModulesASTMap, ScanInstance.
getDiagnostics(), StableDirs))
590 return PrebuiltModulesASTMap;
593std::unique_ptr<DependencyOutputOptions>
600 auto Opts = std::make_unique<DependencyOutputOptions>();
604 if (Opts->Targets.empty())
607 Opts->IncludeSystemHeaders =
true;
612std::shared_ptr<ModuleDepCollector>
615 std::unique_ptr<DependencyOutputOptions> DepOutputOpts,
621 std::shared_ptr<ModuleDepCollector> MDC;
625 std::make_shared<DependencyConsumerForwarder>(
626 std::move(DepOutputOpts), WorkingDirectory, Consumer));
630 MDC = std::make_shared<ModuleDepCollector>(
631 Service, std::move(DepOutputOpts), ScanInstance, Consumer, Controller,
632 Inv, std::move(PrebuiltModulesASTMap), StableDirs);
641 std::unique_ptr<CompilerInvocation> Invocation,
643 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
649 canonicalizeDefines(Invocation->getPreprocessorOpts());
659 setLastCC1Arguments(std::move(OriginalInvocation));
667 ScanInstanceStorage.emplace(std::move(Invocation), std::move(PCHContainerOps),
671 assert(!DiagConsumerFinished &&
"attempt to reuse finished consumer");
677 auto MaybePrebuiltModulesASTMap =
679 if (!MaybePrebuiltModulesASTMap)
685 ScanInstance, std::move(DepOutputOpts), WorkingDirectory, Consumer,
686 Service, OriginalInvocation, Controller, *MaybePrebuiltModulesASTMap,
689 std::unique_ptr<FrontendAction> Action;
692 Action = std::make_unique<PreprocessOnlyAction>();
694 Action = std::make_unique<ReadPCHAndPreprocessAction>();
702 DiagConsumerFinished =
true;
705 setLastCC1Arguments(std::move(OriginalInvocation));
715 std::make_unique<TextDiagnosticsPrinterWithOutput>(CommandLine);
716 DiagConsumer = &DiagPrinterWithOS->DiagPrinter;
720 Worker.BaseFS, CommandLine, CWD,
"ScanningByName");
722 DiagEngineWithCmdAndOpts = std::make_unique<DignosticsEngineWithDiagOpts>(
723 CommandLine, OverlayFS, *DiagConsumer);
726 CommandLine, *DiagEngineWithCmdAndOpts->DiagEngine, OverlayFS, Alloc);
731 assert(Compilation->getJobs().size() &&
732 "Must have a job list of non-zero size");
734 const auto &CommandArgs =
Command.getArguments();
735 assert(!CommandArgs.empty() &&
"Cannot have a command with 0 args");
736 assert(StringRef(CommandArgs[0]) ==
"-cc1" &&
"Requires a cc1 job.");
737 OriginalInvocation = std::make_unique<CompilerInvocation>();
740 *DiagEngineWithCmdAndOpts->DiagEngine,
742 DiagEngineWithCmdAndOpts->DiagEngine->Report(
743 diag::err_fe_expected_compiler_job)
744 << llvm::join(CommandLine,
" ");
749 canonicalizeDefines(OriginalInvocation->getPreprocessorOpts());
754 CIPtr = std::make_unique<CompilerInstance>(
755 std::make_shared<CompilerInvocation>(*OriginalInvocation),
756 Worker.PCHContainerOps, ModCache.get());
760 CI, OverlayFS, DiagEngineWithCmdAndOpts->DiagEngine->getClient(),
761 Worker.Service, Worker.DepFS))
765 auto MaybePrebuiltModulesASTMap =
767 if (!MaybePrebuiltModulesASTMap)
770 PrebuiltModuleASTMap = std::move(*MaybePrebuiltModulesASTMap);
786 assert(CIPtr &&
"CIPtr must be initialized before calling this method");
791 auto CleanUp = llvm::make_scope_exit([&]() {
800 CI, std::make_unique<DependencyOutputOptions>(*OutputOpts), CWD, Consumer,
805 *OriginalInvocation, Controller, PrebuiltModuleASTMap, StableDirs);
810 std::unique_ptr<FrontendAction> Action =
811 std::make_unique<PreprocessOnlyAction>();
813 bool ActionBeginSucceeded = Action->BeginSourceFile(CI, *InputFile);
814 assert(ActionBeginSucceeded &&
"Action BeginSourceFile must succeed");
815 (void)ActionBeginSucceeded;
820 FileID MainFileID =
SM.getMainFileID();
828 assert(!PPFailed &&
"Preprocess must be able to enter the main file.");
830 CB = MDC->getPPCallbacks();
835 MDC->attachToPreprocessor(PP);
836 CB = MDC->getPPCallbacks();
842 FileType, PrevFID, IDLocation);
848 Path.emplace_back(IDLocation,
ModuleID);
851 assert(CB &&
"Must have PPCallbacks after module loading");
862 MDC->applyDiscoveredDependencies(ModuleInvocation);
870 DiagConsumer->finish();
875 assert(DiagPrinterWithOS &&
"Must use the default DiagnosticConsumer.");
876 return Success ? llvm::Error::success()
877 : llvm::make_error<llvm::StringError>(
878 DiagPrinterWithOS->DiagnosticsOS.str(),
879 llvm::inconvertibleErrorCode());
Abstract interface for callback invocations by the ASTReader.
@ ARR_OutOfDate
The client can handle an AST file that cannot load because it is out-of-date relative to its input fi...
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.
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
void clearDependencyCollectors()
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.
ModuleLoadResult loadModule(SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective) override
Attempt to load the given module.
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()
bool hasDiagnostics() const
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.
DiagnosticOptions & getDiagnosticOpts()
LangOptions & getLangOpts()
void setDependencyDirectivesGetter(std::unique_ptr< DependencyDirectivesGetter > Getter)
std::vector< std::string > getCC1CommandLine() const
Generate cc1-compatible command line arguments from this instance, wrapping the result as a std::vect...
Helper class for holding the data necessary to invoke the compiler.
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()
Functor that returns the dependency directives for a given file.
Builds a dependency file when attached to a Preprocessor (for includes) and ASTReader (for module imp...
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
An opaque identifier used by SourceManager which refers to a source file (MemoryBuffer) along with it...
llvm::vfs::FileSystem & getVirtualFileSystem() const
unsigned ModulesShareFileManager
Whether to share the FileManager when building modules.
std::string OutputFile
The output file, if any.
unsigned GenReducedBMI
Whether to generate reduced BMI for C++20 named modules.
std::string ModuleOutputPath
Output Path for module output file.
unsigned GenerateGlobalModuleIndex
Whether we can generate the global module index if needed.
unsigned DisableFree
Disable memory freeing on exit.
SmallVector< FrontendInputFile, 0 > Inputs
The input files and their types.
unsigned UseGlobalModuleIndex
Whether we can use the global module index if available.
One of these records is kept for each identifier that is lexed.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
void setBuildingModule(bool BuildingModuleFlag)
Flag indicating whether this instance is building a module.
@ Hidden
All of the names in this module are hidden.
This interface provides a way to observe the actions of the preprocessor as it does its thing.
virtual void EndOfMainFile()
Callback invoked when the end of the main file is reached.
virtual void LexedFileChanged(FileID FID, LexedFileChangeReason Reason, SrcMgr::CharacteristicKind FileType, FileID PrevFID, SourceLocation Loc)
Callback invoked whenever the Lexer moves to a different file for lexing.
virtual void moduleImport(SourceLocation ImportLoc, ModuleIdPath Path, const Module *Imported)
Callback invoked whenever there was an explicit module-import syntax.
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
bool ModulesCheckRelocated
Perform extra checks when loading PCM files for mutable file systems.
std::string ImplicitPCHInclude
The implicit PCH included at the start of the translation unit, or empty.
bool AllowPCHWithDifferentModulesCachePath
When true, a PCH with modules cache path different to the current compilation will not be rejected.
std::vector< std::pair< std::string, bool > > Macros
Engages in a tight little dance with the lexer to efficiently preprocess tokens.
bool EnterSourceFile(FileID FID, ConstSearchDirIterator Dir, SourceLocation Loc, bool IsFirstIncludeOfFile=true)
Add a source file to the top of the include stack and start lexing tokens from it instead of the curr...
IdentifierInfo * getIdentifierInfo(StringRef Name) const
Return information about the specified preprocessor identifier token.
SourceManager & getSourceManager() const
Encodes a location in the source.
SourceLocation getLocWithOffset(IntTy Offset) const
Return a source location with the specified offset from this SourceLocation.
This class handles loading and caching of source files into memory.
The base class of the type hierarchy.
Command - An executable path/name and argument vector to execute.
bool initialize(DiagnosticConsumer *DC)
llvm::Error handleReturnStatus(bool Success)
bool computeDependencies(StringRef ModuleName, DependencyConsumer &Consumer, DependencyActionController &Controller)
CharacteristicKind
Indicates whether a file or directory holds normal user code, system code, or system code which is im...
llvm::StringRef getDriverMode(StringRef ProgName, ArrayRef< const char * > Args)
Returns the driver mode option's value, i.e.
llvm::Error expandResponseFiles(SmallVectorImpl< const char * > &Args, bool ClangCLMode, llvm::BumpPtrAllocator &Alloc, llvm::vfs::FileSystem *FS=nullptr)
Expand response files from a clang driver or cc1 invocation.
bool IsClangCL(StringRef DriverMode)
Checks whether the value produced by getDriverMode is for CL mode.
ModuleKind
Specifies the kind of module that has been loaded.
@ MK_ExplicitModule
File is an explicitly-loaded module.
The JSON file list parser is used to communicate input to InstallAPI.
std::unique_ptr< DiagnosticOptions > CreateAndPopulateDiagOpts(ArrayRef< const char * > Argv)
@ Success
Annotation was successful.
nullptr
This class represents a compute construct, representing a 'Kind' of ‘parallel’, 'serial',...
@ Result
The result type of a method or function.
void normalizeModuleCachePath(FileManager &FileMgr, StringRef Path, SmallVectorImpl< char > &NormalizedPath)
int __ovld __cnfn any(char)
Returns 1 if the most significant bit in any component of x is set; otherwise returns 0.