|
clang 23.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... | |
| struct | ShallowConstructor |
| Tag for the shallow-copy constructor below. 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 |
| const ssaf::SSAFOptions & | getSSAFOpts () 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. | |
| std::shared_ptr< 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). | |
| std::shared_ptr< AnalyzerOptions > | 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. | |
| std::shared_ptr< ssaf::SSAFOptions > | SSAFOpts |
| Options controlling the Scalable Static Analysis Framework (SSAF). | |
| 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 85 of file CompilerInvocation.h.
| using clang::CompilerInvocationBase::ArgumentConsumer = llvm::function_ref<void(const Twine &)> |
Definition at line 189 of file CompilerInvocation.h.
| using clang::CompilerInvocationBase::StringAllocator = llvm::function_ref<const char *(const Twine &)> |
Command line generation.
Definition at line 170 of file CompilerInvocation.h.
|
protected |
Definition at line 124 of file CompilerInvocation.cpp.
References AnalyzerOpts, APINotesOpts, CodeGenOpts, DependencyOutputOpts, DiagnosticOpts, FrontendOpts, FSOpts, HSOpts, LangOpts, MigratorOpts, PPOpts, PreprocessorOutputOpts, SSAFOpts, and TargetOpts.
Referenced by clang::CompilerInvocation::CompilerInvocation(), clang::CompilerInvocation::CompilerInvocation(), clang::CompilerInvocation::CompilerInvocation(), CompilerInvocationBase(), CompilerInvocationBase(), clang::CowCompilerInvocation::CowCompilerInvocation(), clang::CowCompilerInvocation::CowCompilerInvocation(), clang::CowCompilerInvocation::CowCompilerInvocation(), clang::CowCompilerInvocation::CowCompilerInvocation(), deep_copy_assign(), operator=(), operator=(), and shallow_copy_assign().
|
inlineprotected |
Definition at line 136 of file CompilerInvocation.h.
|
protecteddelete |
References CompilerInvocationBase(), and X.
|
protecteddefault |
References CompilerInvocationBase(), and X.
|
protecteddefault |
|
protected |
Definition at line 141 of file CompilerInvocation.cpp.
References AnalyzerOpts, APINotesOpts, CodeGenOpts, CompilerInvocationBase(), DependencyOutputOpts, DiagnosticOpts, FrontendOpts, FSOpts, HSOpts, LangOpts, make_shared_copy(), MigratorOpts, PPOpts, PreprocessorOutputOpts, SSAFOpts, TargetOpts, and X.
Referenced by clang::CompilerInvocation::CompilerInvocation(), clang::CompilerInvocation::CompilerInvocation(), clang::CowCompilerInvocation::CowCompilerInvocation(), clang::CompilerInvocation::operator=(), 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 5458 of file CompilerInvocation.cpp.
References GenerateAnalyzerArgs(), GenerateAPINotesArgs(), GenerateDependencyOutputArgs(), GenerateFileSystemArgs(), GenerateFrontendArgs(), GenerateHeaderSearchArgs(), GenerateMigratorArgs(), GeneratePointerAuthArgs(), GeneratePreprocessorArgs(), GeneratePreprocessorOutputArgs(), GenerateSSAFArgs(), GenerateTargetArgs(), getAnalyzerOpts(), getAPINotesOpts(), getCodeGenOpts(), getDependencyOutputOpts(), getDiagnosticOpts(), getFileSystemOpts(), getFrontendOpts(), getHeaderSearchOpts(), getLangOpts(), getMigratorOpts(), getPreprocessorOpts(), getPreprocessorOutputOpts(), getSSAFOpts(), and getTargetOpts().
|
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 179 of file CompilerInvocation.h.
References generateCC1CommandLine().
Referenced by clang::CompilerInvocation::checkCC1RoundTrip(), clang::CompilerInvocation::CreateFromArgs(), generateCC1CommandLine(), getCC1CommandLine(), and getModuleContextHash().
|
inline |
Definition at line 153 of file CompilerInvocation.h.
References AnalyzerOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 155 of file CompilerInvocation.h.
References APINotesOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
| 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 5483 of file CompilerInvocation.cpp.
References generateCC1CommandLine().
Referenced by clang::tooling::CompilerInstanceWithContext::computeDependencies().
|
inline |
Definition at line 156 of file CompilerInvocation.h.
References CodeGenOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 159 of file CompilerInvocation.h.
References DependencyOutputOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 150 of file CompilerInvocation.h.
References DiagnosticOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 157 of file CompilerInvocation.h.
References FSOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 158 of file CompilerInvocation.h.
References FrontendOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 151 of file CompilerInvocation.h.
References HSOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Const getters.
Definition at line 148 of file CompilerInvocation.h.
References LangOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 154 of file CompilerInvocation.h.
References MigratorOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 152 of file CompilerInvocation.h.
References PPOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 162 of file CompilerInvocation.h.
References PreprocessorOutputOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 165 of file CompilerInvocation.h.
References SSAFOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
inline |
Definition at line 149 of file CompilerInvocation.h.
References TargetOpts.
Referenced by generateCC1CommandLine(), and clang::CompilerInvocation::~CompilerInvocation().
|
protecteddefault |
References CompilerInvocationBase(), and X.
|
protecteddelete |
References CompilerInvocationBase(), and X.
Referenced by clang::CompilerInvocation::operator=().
|
protected |
Definition at line 162 of file CompilerInvocation.cpp.
References AnalyzerOpts, APINotesOpts, CodeGenOpts, CompilerInvocationBase(), DependencyOutputOpts, DiagnosticOpts, FrontendOpts, FSOpts, HSOpts, LangOpts, MigratorOpts, PPOpts, PreprocessorOutputOpts, SSAFOpts, TargetOpts, and X.
Referenced by clang::CowCompilerInvocation::CowCompilerInvocation(), clang::CowCompilerInvocation::CowCompilerInvocation(), and clang::CowCompilerInvocation::operator=().
|
protected |
Options controlling the static analyzer.
Definition at line 103 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getAnalyzerOpts(), getAnalyzerOpts(), clang::CowCompilerInvocation::getMutAnalyzerOpts(), and shallow_copy_assign().
|
protected |
Options controlling API notes.
Definition at line 108 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), clang::CompilerInvocation::computeContextHash(), deep_copy_assign(), clang::CompilerInvocation::getAPINotesOpts(), getAPINotesOpts(), clang::CowCompilerInvocation::getMutAPINotesOpts(), and shallow_copy_assign().
|
protected |
Options controlling IRgen and the backend.
Definition at line 111 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getCodeGenOpts(), getCodeGenOpts(), clang::CowCompilerInvocation::getMutCodeGenOpts(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Options controlling dependency output.
Definition at line 120 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getDependencyOutputOpts(), getDependencyOutputOpts(), clang::CowCompilerInvocation::getMutDependencyOutputOpts(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Options controlling the diagnostic engine.
Definition at line 94 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getDiagnosticOpts(), getDiagnosticOpts(), clang::CowCompilerInvocation::getMutDiagnosticOpts(), and shallow_copy_assign().
|
protected |
Options controlling the frontend itself.
Definition at line 117 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getFrontendOpts(), getFrontendOpts(), clang::CowCompilerInvocation::getMutFrontendOpts(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Options controlling file system operations.
Definition at line 114 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getFileSystemOpts(), getFileSystemOpts(), clang::CowCompilerInvocation::getMutFileSystemOpts(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Options controlling the #include directive.
Definition at line 97 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getHeaderSearchOpts(), getHeaderSearchOpts(), clang::CowCompilerInvocation::getMutHeaderSearchOpts(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Options controlling the language variant.
Definition at line 88 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CompilerInvocation::getLangOpts(), getLangOpts(), clang::CowCompilerInvocation::getMutLangOpts(), clang::CompilerInvocation::setDefaultPointerAuthOptions(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Definition at line 105 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), 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 100 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CowCompilerInvocation::getMutPreprocessorOpts(), clang::CompilerInvocation::getPreprocessorOpts(), getPreprocessorOpts(), shallow_copy_assign(), and clang::CowCompilerInvocation::visitMutPaths().
|
protected |
Options controlling preprocessed output.
Definition at line 123 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CowCompilerInvocation::getMutPreprocessorOutputOpts(), clang::CompilerInvocation::getPreprocessorOutputOpts(), getPreprocessorOutputOpts(), and shallow_copy_assign().
|
protected |
Options controlling the Scalable Static Analysis Framework (SSAF).
Definition at line 126 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CowCompilerInvocation::getMutSSAFOpts(), clang::CompilerInvocation::getSSAFOpts(), getSSAFOpts(), and shallow_copy_assign().
|
protected |
Options controlling the target.
Definition at line 91 of file CompilerInvocation.h.
Referenced by CompilerInvocationBase(), deep_copy_assign(), clang::CowCompilerInvocation::getMutTargetOpts(), clang::CompilerInvocation::getTargetOpts(), getTargetOpts(), and shallow_copy_assign().