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 5065 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 161 of file CompilerInvocation.h.
References generateCC1CommandLine().
Referenced by clang::CompilerInvocation::checkCC1RoundTrip(), clang::CompilerInvocation::CreateFromArgs(), generateCC1CommandLine(), getCC1CommandLine(), and getModuleContextHash().
|
inline |
Definition at line 136 of file CompilerInvocation.h.
References AnalyzerOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 138 of file CompilerInvocation.h.
References APINotesOpts.
Referenced by generateCC1CommandLine().
std::vector< std::string > CompilerInvocationBase::getCC1CommandLine | ( | ) | const |
Generate cc1-compatible command line arguments from this instance, wrapping the result as a std::vector<std::string>.
This is a (less-efficient) wrapper over generateCC1CommandLine().
Definition at line 5089 of file CompilerInvocation.cpp.
References generateCC1CommandLine().
|
inline |
Definition at line 139 of file CompilerInvocation.h.
References CodeGenOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 142 of file CompilerInvocation.h.
References DependencyOutputOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 133 of file CompilerInvocation.h.
References DiagnosticOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 140 of file CompilerInvocation.h.
References FSOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 141 of file CompilerInvocation.h.
References FrontendOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 134 of file CompilerInvocation.h.
References HSOpts.
Referenced by generateCC1CommandLine().
|
inline |
Const getters.
Definition at line 131 of file CompilerInvocation.h.
References LangOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 137 of file CompilerInvocation.h.
References MigratorOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 135 of file CompilerInvocation.h.
References PPOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 145 of file CompilerInvocation.h.
References PreprocessorOutputOpts.
Referenced by generateCC1CommandLine().
|
inline |
Definition at line 132 of file CompilerInvocation.h.
References TargetOpts.
Referenced by generateCC1CommandLine().
|
protecteddefault |
|
protecteddelete |
|
protected |
Definition at line 175 of file CompilerInvocation.cpp.
References AnalyzerOpts, APINotesOpts, CodeGenOpts, DependencyOutputOpts, DiagnosticOpts, FrontendOpts, FSOpts, HSOpts, LangOpts, MigratorOpts, PPOpts, PreprocessorOutputOpts, TargetOpts, and X.
Referenced by clang::CowCompilerInvocation::CowCompilerInvocation(), and clang::CowCompilerInvocation::operator=().
|
protected |
Options controlling the static analyzer.
Definition at line 92 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getAnalyzerOpts(), getAnalyzerOpts(), clang::CowCompilerInvocation::getMutAnalyzerOpts(), and shallow_copy_assign().
|
protected |
Options controlling API notes.
Definition at line 97 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getAPINotesOpts(), getAPINotesOpts(), clang::CompilerInvocation::getModuleHash(), clang::CowCompilerInvocation::getMutAPINotesOpts(), and shallow_copy_assign().
|
protected |
Options controlling IRgen and the backend.
Definition at line 100 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getCodeGenOpts(), getCodeGenOpts(), clang::CowCompilerInvocation::getMutCodeGenOpts(), and shallow_copy_assign().
|
protected |
Options controlling dependency output.
Definition at line 109 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getDependencyOutputOpts(), getDependencyOutputOpts(), clang::CowCompilerInvocation::getMutDependencyOutputOpts(), and shallow_copy_assign().
|
protected |
Options controlling the diagnostic engine.
Definition at line 83 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), getDiagnosticOpts(), clang::CowCompilerInvocation::getMutDiagnosticOpts(), and shallow_copy_assign().
|
protected |
Options controlling the frontend itself.
Definition at line 106 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getFrontendOpts(), getFrontendOpts(), clang::CowCompilerInvocation::getMutFrontendOpts(), and shallow_copy_assign().
|
protected |
Options controlling file system operations.
Definition at line 103 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getFileSystemOpts(), getFileSystemOpts(), clang::CowCompilerInvocation::getMutFileSystemOpts(), and shallow_copy_assign().
|
protected |
Options controlling the #include directive.
Definition at line 86 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getHeaderSearchOpts(), getHeaderSearchOpts(), clang::CompilerInvocation::getHeaderSearchOptsPtr(), clang::CowCompilerInvocation::getMutHeaderSearchOpts(), and shallow_copy_assign().
|
protected |
Options controlling the language variant.
Definition at line 77 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), getLangOpts(), clang::CowCompilerInvocation::getMutLangOpts(), and shallow_copy_assign().
|
protected |
Definition at line 94 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CompilerInvocation::getMigratorOpts(), getMigratorOpts(), clang::CowCompilerInvocation::getMutMigratorOpts(), and shallow_copy_assign().
|
protected |
Options controlling the preprocessor (aside from #include handling).
Definition at line 89 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CowCompilerInvocation::getMutPreprocessorOpts(), clang::CompilerInvocation::getPreprocessorOpts(), getPreprocessorOpts(), clang::CompilerInvocation::getPreprocessorOptsPtr(), and shallow_copy_assign().
|
protected |
Options controlling preprocessed output.
Definition at line 112 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CowCompilerInvocation::getMutPreprocessorOutputOpts(), clang::CompilerInvocation::getPreprocessorOutputOpts(), getPreprocessorOutputOpts(), and shallow_copy_assign().
|
protected |
Options controlling the target.
Definition at line 80 of file CompilerInvocation.h.
Referenced by deep_copy_assign(), clang::CowCompilerInvocation::getMutTargetOpts(), getTargetOpts(), and shallow_copy_assign().