Go to the documentation of this file.
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"
48 class DiagnosticsEngine;
49 class HeaderSearchOptions;
50 class PreprocessorOptions;
55 std::unique_ptr<DiagnosticOptions>
66 DiagnosticsEngine *Diags =
nullptr,
67 bool DefaultDiagColor =
true);
210 const char *Argv0 =
nullptr);
249 static bool ParseLangArgs(
LangOptions &Opts, llvm::opt::ArgList &Args,
251 std::vector<std::string> &Includes,
255 static void GenerateLangArgs(
const LangOptions &Opts,
261 static bool ParseCodeGenArgs(
CodeGenOptions &Opts, llvm::opt::ArgList &Args,
263 const llvm::Triple &T,
285 #endif // LLVM_CLANG_FRONTEND_COMPILERINVOCATION_H
FileSystemOptions FileSystemOpts
Options controlling file system operations.
DependencyOutputOptions - Options for controlling the compiler dependency file generation.
TargetOptions & getTargetOpts()
YAML serialization mapping.
CodeGenOptions & getCodeGenOpts()
PreprocessorOptions - This class is used for passing the various options used in preprocessor initial...
std::shared_ptr< TargetOptions > TargetOpts
Options controlling the target.
bool ParseDiagnosticArgs(DiagnosticOptions &Opts, llvm::opt::ArgList &Args, DiagnosticsEngine *Diags=nullptr, bool DefaultDiagColor=true)
Fill out Opts based on the options given in Args.
CompilerInvocationRefBase()
Concrete class used by the front-end to report problems and issues.
HeaderSearchOptions & getHeaderSearchOpts()
const FileSystemOptions & getFileSystemOpts() const
std::shared_ptr< LangOptions > LangOpts
Options controlling the language variant.
CodeGenOptions CodeGenOpts
Options controlling IRgen and the backend.
Keeps track of options that affect how file operations are performed.
std::shared_ptr< PreprocessorOptions > getPreprocessorOptsPtr()
The base class of CompilerInvocation with reference semantics.
const PreprocessorOutputOptions & getPreprocessorOutputOpts() const
std::shared_ptr< PreprocessorOptions > PreprocessorOpts
Options controlling the preprocessor (aside from #include handling).
FrontendOptions & getFrontendOpts()
PreprocessorOutputOptions - Options for controlling the C preprocessor output (e.g....
std::shared_ptr< HeaderSearchOptions > HeaderSearchOpts
Options controlling the #include directive.
FrontendOptions - Options for controlling the behavior of the frontend.
DependencyOutputOptions DependencyOutputOpts
Options controlling dependency output.
AnalyzerOptionsRef AnalyzerOpts
Options controlling the static analyzer.
std::shared_ptr< HeaderSearchOptions > getHeaderSearchOptsPtr() const
LangOptions * getLangOpts()
void generateCC1CommandLine(llvm::SmallVectorImpl< const char * > &Args, StringAllocator SA) const
Generate a cc1-compatible command line arguments from this instance.
~CompilerInvocationRefBase()
AnalyzerOptionsRef getAnalyzerOpts() const
CodeGenOptions - Track various options which control how the code is optimized and passed to the back...
PreprocessorOptions & getPreprocessorOpts()
PreprocessorOutputOptions PreprocessorOutputOpts
Options controlling preprocessed output.
const TargetOptions & getTargetOpts() const
std::string getModuleHash() const
Retrieve a module hash string that is suitable for uniquely identifying the conditions under which th...
DependencyOutputOptions & getDependencyOutputOpts()
IntrusiveRefCntPtr< llvm::vfs::FileSystem > createVFSFromCompilerInvocation(const CompilerInvocation &CI, DiagnosticsEngine &Diags)
Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...
const CodeGenOptions & getCodeGenOpts() const
FrontendOptions FrontendOpts
Options controlling the frontend itself.
const FrontendOptions & getFrontendOpts() const
const HeaderSearchOptions & getHeaderSearchOpts() const
The base class of CompilerInvocation with value semantics.
const DependencyOutputOptions & getDependencyOutputOpts() const
Helper class for holding the data necessary to invoke the compiler.
IntrusiveRefCntPtr< DiagnosticOptions > DiagnosticOpts
Options controlling the diagnostic engine.
std::unique_ptr< DiagnosticOptions > CreateAndPopulateDiagOpts(ArrayRef< const char * > Argv)
const LangOptions * getLangOpts() const
Options for controlling the target.
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...
const MigratorOptions & getMigratorOpts() const
MigratorOptions MigratorOpts
llvm::function_ref< const char *(const llvm::Twine &)> StringAllocator
FileSystemOptions & getFileSystemOpts()
CompilerInvocationRefBase & operator=(CompilerInvocationRefBase X)
const PreprocessorOptions & getPreprocessorOpts() const
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.
Options for controlling the compiler diagnostics engine.
PreprocessorOutputOptions & getPreprocessorOutputOpts()
DiagnosticOptions & getDiagnosticOpts() const
MigratorOptions & getMigratorOpts()