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)
362std::unique_ptr<DiagnosticOptions>
364 std::vector<const char *> CLI;
365 for (
const std::string &Arg : CommandLine)
366 CLI.push_back(Arg.c_str());
368 sanitizeDiagOpts(*DiagOpts);
375 std::vector<const char *> CCommandLine(CommandLine.size(),
nullptr);
376 llvm::transform(CommandLine, CCommandLine.begin(),
377 [](
const std::string &Str) { return Str.c_str(); });
384std::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>>
437 StringRef WorkingDirectory,
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>>
464 StringRef WorkingDirectory, StringRef ModuleName) {
466 BaseFS->setCurrentWorkingDirectory(WorkingDirectory);
472 llvm::makeIntrusiveRefCnt<llvm::vfs::OverlayFileSystem>(BaseFS);
473 auto InMemoryFS = llvm::makeIntrusiveRefCnt<llvm::vfs::InMemoryFileSystem>();
474 InMemoryFS->setCurrentWorkingDirectory(WorkingDirectory);
477 llvm::sys::fs::createUniquePath(ModuleName +
"-%%%%%%%%.input", FakeInputPath,
479 InMemoryFS->addFile(FakeInputPath, 0, llvm::MemoryBuffer::getMemBuffer(
""));
481 OverlayFS->pushOverlay(InMemoryOverlay);
483 std::vector<std::string> ModifiedCommandLine(CommandLine);
484 ModifiedCommandLine.emplace_back(FakeInputPath);
486 return std::make_pair(OverlayFS, ModifiedCommandLine);
528 DepFS->resetBypassedPathPrefix();
533 if (!ModulesCachePath.empty())
534 DepFS->setBypassedPathPrefix(ModulesCachePath);
537 std::make_unique<ScanningDependencyDirectivesGetter>(
568 if (!Sysroot.empty() && (llvm::sys::path::root_directory(Sysroot) != Sysroot))
573std::optional<PrebuiltModulesAttrsMap>
583 if (visitPrebuiltModule(
586 PrebuiltModulesASTMap, ScanInstance.
getDiagnostics(), StableDirs))
589 return PrebuiltModulesASTMap;
592std::unique_ptr<DependencyOutputOptions>
598 auto Opts = std::make_unique<DependencyOutputOptions>();
602 if (Opts->Targets.empty())
605 Opts->IncludeSystemHeaders =
true;
612 std::unique_ptr<DependencyOutputOptions> DepOutputOpts,
618 std::shared_ptr<ModuleDepCollector> MDC;
622 std::make_shared<DependencyConsumerForwarder>(
623 std::move(DepOutputOpts), WorkingDirectory, Consumer));
627 MDC = std::make_shared<ModuleDepCollector>(
628 Service, std::move(DepOutputOpts), ScanInstance, Consumer, Controller,
629 Inv, std::move(PrebuiltModulesASTMap), StableDirs);
639 std::unique_ptr<CompilerInvocation> Invocation,
641 std::shared_ptr<PCHContainerOperations> PCHContainerOps,
647 canonicalizeDefines(Invocation->getPreprocessorOpts());
657 setLastCC1Arguments(std::move(OriginalInvocation));
665 ScanInstanceStorage.emplace(std::move(Invocation), std::move(PCHContainerOps),
669 assert(!DiagConsumerFinished &&
"attempt to reuse finished consumer");
675 auto MaybePrebuiltModulesASTMap =
677 if (!MaybePrebuiltModulesASTMap)
683 ScanInstance, std::move(DepOutputOpts), WorkingDirectory, Consumer,
684 Service, OriginalInvocation, Controller, *MaybePrebuiltModulesASTMap,
687 std::unique_ptr<FrontendAction> Action;
690 Action = std::make_unique<PreprocessOnlyAction>();
692 Action = std::make_unique<ReadPCHAndPreprocessAction>();
700 DiagConsumerFinished =
true;
703 setLastCC1Arguments(std::move(OriginalInvocation));
713 std::make_unique<TextDiagnosticsPrinterWithOutput>(CommandLine);
714 DiagConsumer = &DiagPrinterWithOS->DiagPrinter;
718 Worker.BaseFS, CommandLine, CWD,
"ScanningByName");
720 DiagEngineWithCmdAndOpts = std::make_unique<DignosticsEngineWithDiagOpts>(
721 CommandLine, OverlayFS, *DiagConsumer);
724 CommandLine, *DiagEngineWithCmdAndOpts->DiagEngine, OverlayFS, Alloc);
729 assert(Compilation->getJobs().size() &&
730 "Must have a job list of non-zero size");
732 const auto &CommandArgs =
Command.getArguments();
733 assert(!CommandArgs.empty() &&
"Cannot have a command with 0 args");
734 assert(StringRef(CommandArgs[0]) ==
"-cc1" &&
"Requires a cc1 job.");
735 OriginalInvocation = std::make_unique<CompilerInvocation>();
738 *DiagEngineWithCmdAndOpts->DiagEngine,
740 DiagEngineWithCmdAndOpts->DiagEngine->Report(
741 diag::err_fe_expected_compiler_job)
742 << llvm::join(CommandLine,
" ");
747 canonicalizeDefines(OriginalInvocation->getPreprocessorOpts());
752 CIPtr = std::make_unique<CompilerInstance>(
753 std::make_shared<CompilerInvocation>(*OriginalInvocation),
754 Worker.PCHContainerOps, ModCache.get());
758 CI, OverlayFS, DiagEngineWithCmdAndOpts->DiagEngine->getClient(),
759 Worker.Service, Worker.DepFS))
763 auto MaybePrebuiltModulesASTMap =
765 if (!MaybePrebuiltModulesASTMap)
768 PrebuiltModuleASTMap = std::move(*MaybePrebuiltModulesASTMap);
784 assert(CIPtr &&
"CIPtr must be initialized before calling this method");
789 auto CleanUp = llvm::make_scope_exit([&]() {
798 CI, std::make_unique<DependencyOutputOptions>(*OutputOpts), CWD, Consumer,
803 *OriginalInvocation, Controller, PrebuiltModuleASTMap, StableDirs);
808 std::unique_ptr<FrontendAction> Action =
809 std::make_unique<PreprocessOnlyAction>();
811 bool ActionBeginSucceeded = Action->BeginSourceFile(CI, *InputFile);
812 assert(ActionBeginSucceeded &&
"Action BeginSourceFile must succeed");
813 (void)ActionBeginSucceeded;
818 FileID MainFileID =
SM.getMainFileID();
826 assert(!PPFailed &&
"Preprocess must be able to enter the main file.");
828 CB = MDC->getPPCallbacks();
833 MDC->attachToPreprocessor(PP);
834 CB = MDC->getPPCallbacks();
840 FileType, PrevFID, IDLocation);
846 Path.emplace_back(IDLocation,
ModuleID);
849 assert(CB &&
"Must have PPCallbacks after module loading");
860 MDC->applyDiscoveredDependencies(ModuleInvocation);
868 DiagConsumer->finish();
873 assert(DiagPrinterWithOS &&
"Must use the default DiagnosticConsumer.");
874 return Success ? llvm::Error::success()
875 : llvm::make_error<llvm::StringError>(
876 DiagPrinterWithOS->DiagnosticsOS.str(),
877 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.