9#ifndef LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H
10#define LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H
23#include "llvm/ADT/IntrusiveRefCntPtr.h"
24#include "llvm/ADT/ArrayRef.h"
48class DiagnosticsEngine;
49class HeaderSearchOptions;
50class PreprocessorOptions;
55std::unique_ptr<DiagnosticOptions>
67 bool DefaultDiagColor =
true);
210 const char *Argv0 =
nullptr);
253 const char *Argv0 =
nullptr);
274 static bool ParseLangArgs(
LangOptions &Opts, llvm::opt::ArgList &Args,
276 std::vector<std::string> &Includes,
280 static void GenerateLangArgs(
const LangOptions &Opts,
286 static bool ParseCodeGenArgs(
CodeGenOptions &Opts, llvm::opt::ArgList &Args,
288 const llvm::Triple &T,
289 const std::string &OutputFile,
296 const std::string &OutputFile,
static CompilationDatabasePluginRegistry::Add< FixedCompilationDatabasePlugin > X("fixed-compilation-database", "Reads plain-text flags file")
Defines the clang::FileSystemOptions interface.
Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.
Defines the clang::LangOptions interface.
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
The base class of CompilerInvocation with reference semantics.
PreprocessorOptions & getPreprocessorOpts()
AnalyzerOptionsRef AnalyzerOpts
Options controlling the static analyzer.
TargetOptions & getTargetOpts()
~CompilerInvocationRefBase()
CompilerInvocationRefBase & operator=(CompilerInvocationRefBase X)
const PreprocessorOptions & getPreprocessorOpts() const
DiagnosticOptions & getDiagnosticOpts() const
CompilerInvocationRefBase(CompilerInvocationRefBase &&X)
CompilerInvocationRefBase & operator=(CompilerInvocationRefBase &&X)
IntrusiveRefCntPtr< DiagnosticOptions > DiagnosticOpts
Options controlling the diagnostic engine.
AnalyzerOptionsRef getAnalyzerOpts() const
const HeaderSearchOptions & getHeaderSearchOpts() const
std::shared_ptr< PreprocessorOptions > PreprocessorOpts
Options controlling the preprocessor (aside from #include handling).
LangOptions * getLangOpts()
std::shared_ptr< LangOptions > LangOpts
Options controlling the language variant.
HeaderSearchOptions & getHeaderSearchOpts()
std::shared_ptr< PreprocessorOptions > getPreprocessorOptsPtr()
std::shared_ptr< TargetOptions > TargetOpts
Options controlling the target.
std::shared_ptr< HeaderSearchOptions > HeaderSearchOpts
Options controlling the #include directive.
CompilerInvocationRefBase()
std::shared_ptr< HeaderSearchOptions > getHeaderSearchOptsPtr() const
const LangOptions * getLangOpts() const
const TargetOptions & getTargetOpts() const
The base class of CompilerInvocation with value semantics.
FileSystemOptions FileSystemOpts
Options controlling file system operations.
const MigratorOptions & getMigratorOpts() const
const FileSystemOptions & getFileSystemOpts() const
const FrontendOptions & getFrontendOpts() const
CodeGenOptions & getCodeGenOpts()
FileSystemOptions & getFileSystemOpts()
DependencyOutputOptions & getDependencyOutputOpts()
MigratorOptions & getMigratorOpts()
CodeGenOptions CodeGenOpts
Options controlling IRgen and the backend.
const PreprocessorOutputOptions & getPreprocessorOutputOpts() const
FrontendOptions & getFrontendOpts()
PreprocessorOutputOptions PreprocessorOutputOpts
Options controlling preprocessed output.
PreprocessorOutputOptions & getPreprocessorOutputOpts()
FrontendOptions FrontendOpts
Options controlling the frontend itself.
const CodeGenOptions & getCodeGenOpts() const
const DependencyOutputOptions & getDependencyOutputOpts() const
MigratorOptions MigratorOpts
DependencyOutputOptions DependencyOutputOpts
Options controlling dependency output.
Helper class for holding the data necessary to invoke the compiler.
void clearImplicitModuleBuildOptions()
Disable implicit modules and canonicalize options that are only used by implicit modules.
static std::string GetResourcesPath(const char *Argv0, void *MainAddr)
Get the directory where the compiler headers reside, relative to the compiler binary (found by the pa...
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.
static bool checkCC1RoundTrip(ArrayRef< const char * > Args, DiagnosticsEngine &Diags, const char *Argv0=nullptr)
Check that Args can be parsed and re-serialized without change, emiting diagnostics for any differenc...
void resetNonModularOptions()
Reset all of the options that are not considered when building a module.
void generateCC1CommandLine(llvm::SmallVectorImpl< const char * > &Args, StringAllocator SA) const
Generate cc1-compatible command line arguments from this instance.
std::string getModuleHash() const
Retrieve a module hash string that is suitable for uniquely identifying the conditions under which th...
std::vector< std::string > getCC1CommandLine() const
Generate cc1-compatible command line arguments from this instance, wrapping the result as a std::vect...
llvm::function_ref< const char *(const llvm::Twine &)> StringAllocator
DependencyOutputOptions - Options for controlling the compiler dependency file generation.
Options for controlling the compiler diagnostics engine.
Concrete class used by the front-end to report problems and issues.
Keeps track of options that affect how file operations are performed.
FrontendOptions - Options for controlling the behavior of the frontend.
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
PreprocessorOutputOptions - Options for controlling the C preprocessor output (e.g....
Options for controlling the target.
IntrusiveRefCntPtr< llvm::vfs::FileSystem > createVFSFromOverlayFiles(ArrayRef< std::string > VFSOverlayFiles, DiagnosticsEngine &Diags, IntrusiveRefCntPtr< llvm::vfs::FileSystem > BaseFS)
std::unique_ptr< DiagnosticOptions > CreateAndPopulateDiagOpts(ArrayRef< const char * > Argv)
IntrusiveRefCntPtr< llvm::vfs::FileSystem > createVFSFromCompilerInvocation(const CompilerInvocation &CI, DiagnosticsEngine &Diags)
bool ParseDiagnosticArgs(DiagnosticOptions &Opts, llvm::opt::ArgList &Args, DiagnosticsEngine *Diags=nullptr, bool DefaultDiagColor=true)
Fill out Opts based on the options given in Args.
YAML serialization mapping.