clang 20.0.0git
|
The base class of CompilerInvocation. More...
#include "clang/Frontend/CompilerInvocation.h"
Classes | |
struct | EmptyConstructor |
Dummy tag type whose instance can be passed into the constructor to prevent creation of the reference-counted option objects. More... | |
Public Member Functions | |
const LangOptions & | getLangOpts () const |
Const getters. | |
const TargetOptions & | getTargetOpts () const |
const DiagnosticOptions & | getDiagnosticOpts () const |
const HeaderSearchOptions & | getHeaderSearchOpts () const |
const PreprocessorOptions & | getPreprocessorOpts () const |
const AnalyzerOptions & | getAnalyzerOpts () const |
const MigratorOptions & | getMigratorOpts () const |
const APINotesOptions & | getAPINotesOpts () const |
const CodeGenOptions & | getCodeGenOpts () const |
const FileSystemOptions & | getFileSystemOpts () const |
const FrontendOptions & | getFrontendOpts () const |
const DependencyOutputOptions & | getDependencyOutputOpts () const |
const PreprocessorOutputOptions & | getPreprocessorOutputOpts () const |
Protected Member Functions | |
CompilerInvocationBase () | |
CompilerInvocationBase (EmptyConstructor) | |
CompilerInvocationBase (const CompilerInvocationBase &X)=delete | |
CompilerInvocationBase (CompilerInvocationBase &&X)=default | |
CompilerInvocationBase & | operator= (const CompilerInvocationBase &X)=delete |
CompilerInvocationBase & | deep_copy_assign (const CompilerInvocationBase &X) |
CompilerInvocationBase & | shallow_copy_assign (const CompilerInvocationBase &X) |
CompilerInvocationBase & | operator= (CompilerInvocationBase &&X)=default |
~CompilerInvocationBase ()=default | |
Protected Attributes | |
std::shared_ptr< LangOptions > | LangOpts |
Options controlling the language variant. | |
std::shared_ptr< TargetOptions > | TargetOpts |
Options controlling the target. | |
IntrusiveRefCntPtr< DiagnosticOptions > | DiagnosticOpts |
Options controlling the diagnostic engine. | |
std::shared_ptr< HeaderSearchOptions > | HSOpts |
Options controlling the #include directive. | |
std::shared_ptr< PreprocessorOptions > | PPOpts |
Options controlling the preprocessor (aside from #include handling). | |
AnalyzerOptionsRef | AnalyzerOpts |
Options controlling the static analyzer. | |
std::shared_ptr< MigratorOptions > | MigratorOpts |
std::shared_ptr< APINotesOptions > | APINotesOpts |
Options controlling API notes. | |
std::shared_ptr< CodeGenOptions > | CodeGenOpts |
Options controlling IRgen and the backend. | |
std::shared_ptr< FileSystemOptions > | FSOpts |
Options controlling file system operations. | |
std::shared_ptr< FrontendOptions > | FrontendOpts |
Options controlling the frontend itself. | |
std::shared_ptr< DependencyOutputOptions > | DependencyOutputOpts |
Options controlling dependency output. | |
std::shared_ptr< PreprocessorOutputOptions > | PreprocessorOutputOpts |
Options controlling preprocessed output. | |
using | StringAllocator = llvm::function_ref< const char *(const Twine &)> |
Command line generation. | |
using | ArgumentConsumer = llvm::function_ref< void(const Twine &)> |
void | generateCC1CommandLine (llvm::SmallVectorImpl< const char * > &Args, StringAllocator SA) const |
Generate cc1-compatible command line arguments from this instance. | |
void | generateCC1CommandLine (ArgumentConsumer Consumer) const |
Generate cc1-compatible command line arguments from this instance. | |
std::vector< std::string > | getCC1CommandLine () const |
Generate cc1-compatible command line arguments from this instance, wrapping the result as a std::vector<std::string>. | |
The base class of CompilerInvocation.
It keeps individual option objects behind reference-counted pointers, which is useful for clients that want to keep select option objects alive (even after CompilerInvocation gets destroyed) without making a copy.
Definition at line 74 of file CompilerInvocation.h.
using clang::CompilerInvocationBase::ArgumentConsumer = llvm::function_ref<void(const Twine &)> |
Definition at line 171 of file CompilerInvocation.h.
using clang::CompilerInvocationBase::StringAllocator = llvm::function_ref<const char *(const Twine &)> |
Command line generation.
Definition at line 152 of file CompilerInvocation.h.
|
protected |
Definition at line 139 of file CompilerInvocation.cpp.
|
inlineprotected |
Definition at line 119 of file CompilerInvocation.h.
|
protecteddelete |
|
protecteddefault |
|
protecteddefault |
|
protected |
Definition at line 155 of file CompilerInvocation.cpp.
References AnalyzerOpts, APINotesOpts, CodeGenOpts, DependencyOutputOpts, DiagnosticOpts, FrontendOpts, FSOpts, HSOpts, LangOpts, MigratorOpts, PPOpts, PreprocessorOutputOpts, TargetOpts, and X.
Referenced by clang::CompilerInvocation::CompilerInvocation(), clang::CowCompilerInvocation::CowCompilerInvocation(), and clang::CompilerInvocation::operator=().
void CompilerInvocationBase::generateCC1CommandLine | ( | ArgumentConsumer | Consumer | ) | const |
Generate cc1-compatible command line arguments from this instance.
Consumer | - Callback that gets invoked for every single generated command line argument. |
Definition at line 5183 of file CompilerInvocation.cpp.
References GenerateAnalyzerArgs(), GenerateAPINotesArgs(), GenerateDependencyOutputArgs(), GenerateFileSystemArgs(), GenerateFrontendArgs(), GenerateHeaderSearchArgs(), GenerateMigratorArgs(), GeneratePointerAuthArgs(), GeneratePreprocessorArgs(), GeneratePreprocessorOutputArgs(), GenerateTargetArgs(), getAnalyzerOpts(), getAPINotesOpts(), getCodeGenOpts(), getDependencyOutputOpts(), getDiagnosticOpts(), getFileSystemOpts(), getFrontendOpts(), getHeaderSearchOpts(), getLangOpts(), getMigratorOpts(), getPreprocessorOpts(), getPreprocessorOutputOpts(), getTargetOpts(), and clang::T.
|
inline |
Generate cc1-compatible command line arguments from this instance.
[out] | Args | - The generated arguments. Note that the caller is responsible for inserting the path to the clang executable and "-cc1" if desired. |
SA | - A function that given a Twine can allocate storage for a given command line argument and return a pointer to the newly allocated string. The returned pointer is what gets appended to Args. |
Definition at line