clang 17.0.0git
|
Public Member Functions | |
BackendConsumer (BackendAction Action, DiagnosticsEngine &Diags, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, const HeaderSearchOptions &HeaderSearchOpts, const PreprocessorOptions &PPOpts, const CodeGenOptions &CodeGenOpts, const TargetOptions &TargetOpts, const LangOptions &LangOpts, const std::string &InFile, SmallVector< LinkModule, 4 > LinkModules, std::unique_ptr< raw_pwrite_stream > OS, LLVMContext &C, CoverageSourceInfo *CoverageInfo=nullptr) | |
BackendConsumer (BackendAction Action, DiagnosticsEngine &Diags, IntrusiveRefCntPtr< llvm::vfs::FileSystem > VFS, const HeaderSearchOptions &HeaderSearchOpts, const PreprocessorOptions &PPOpts, const CodeGenOptions &CodeGenOpts, const TargetOptions &TargetOpts, const LangOptions &LangOpts, llvm::Module *Module, SmallVector< LinkModule, 4 > LinkModules, LLVMContext &C, CoverageSourceInfo *CoverageInfo=nullptr) | |
llvm::Module * | getModule () const |
std::unique_ptr< llvm::Module > | takeModule () |
CodeGenerator * | getCodeGenerator () |
void | HandleCXXStaticMemberVarInstantiation (VarDecl *VD) override |
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this. | |
void | Initialize (ASTContext &Ctx) override |
Initialize - This is called to initialize the consumer, providing the ASTContext. | |
bool | HandleTopLevelDecl (DeclGroupRef D) override |
HandleTopLevelDecl - Handle the specified top-level declaration. | |
void | HandleInlineFunctionDefinition (FunctionDecl *D) override |
This callback is invoked each time an inline (method or friend) function definition in a class is completed. | |
void | HandleInterestingDecl (DeclGroupRef D) override |
HandleInterestingDecl - Handle the specified interesting declaration. | |
bool | LinkInModules () |
void | HandleTranslationUnit (ASTContext &C) override |
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed. | |
void | HandleTagDeclDefinition (TagDecl *D) override |
HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g. | |
void | HandleTagDeclRequiredDefinition (const TagDecl *D) override |
This callback is invoked the first time each TagDecl is required to be complete. | |
void | CompleteTentativeDefinition (VarDecl *D) override |
CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed. | |
void | CompleteExternalDeclaration (VarDecl *D) override |
CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed. | |
void | AssignInheritanceModel (CXXRecordDecl *RD) override |
Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl. | |
void | HandleVTable (CXXRecordDecl *RD) override |
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required. | |
const FullSourceLoc | getBestLocationFromDebugLoc (const llvm::DiagnosticInfoWithLocationBase &D, bool &BadDebugInfo, StringRef &Filename, unsigned &Line, unsigned &Column) const |
Get the best possible source location to represent a diagnostic that may have associated debug info. | |
std::optional< FullSourceLoc > | getFunctionSourceLocation (const Function &F) const |
void | DiagnosticHandlerImpl (const llvm::DiagnosticInfo &DI) |
This function is invoked when the backend needs to report something to the user. | |
bool | InlineAsmDiagHandler (const llvm::DiagnosticInfoInlineAsm &D) |
Specialized handler for InlineAsm diagnostic. | |
void | SrcMgrDiagHandler (const llvm::DiagnosticInfoSrcMgr &D) |
Specialized handler for diagnostics reported using SMDiagnostic. | |
bool | StackSizeDiagHandler (const llvm::DiagnosticInfoStackSize &D) |
Specialized handler for StackSize diagnostic. | |
bool | ResourceLimitDiagHandler (const llvm::DiagnosticInfoResourceLimit &D) |
Specialized handler for ResourceLimit diagnostic. | |
void | UnsupportedDiagHandler (const llvm::DiagnosticInfoUnsupported &D) |
Specialized handler for unsupported backend feature diagnostic. | |
void | EmitOptimizationMessage (const llvm::DiagnosticInfoOptimizationBase &D, unsigned DiagID) |
Specialized handlers for optimization remarks. | |
void | OptimizationRemarkHandler (const llvm::DiagnosticInfoOptimizationBase &D) |
void | OptimizationRemarkHandler (const llvm::OptimizationRemarkAnalysisFPCommute &D) |
void | OptimizationRemarkHandler (const llvm::OptimizationRemarkAnalysisAliasing &D) |
void | OptimizationFailureHandler (const llvm::DiagnosticInfoOptimizationFailure &D) |
void | DontCallDiagHandler (const DiagnosticInfoDontCall &D) |
void | MisExpectDiagHandler (const llvm::DiagnosticInfoMisExpect &D) |
Specialized handler for misexpect warnings. | |
![]() | |
ASTConsumer ()=default | |
virtual | ~ASTConsumer () |
virtual void | Initialize (ASTContext &Context) |
Initialize - This is called to initialize the consumer, providing the ASTContext. | |
virtual bool | HandleTopLevelDecl (DeclGroupRef D) |
HandleTopLevelDecl - Handle the specified top-level declaration. | |
virtual void | HandleInlineFunctionDefinition (FunctionDecl *D) |
This callback is invoked each time an inline (method or friend) function definition in a class is completed. | |
virtual void | HandleInterestingDecl (DeclGroupRef D) |
HandleInterestingDecl - Handle the specified interesting declaration. | |
virtual void | HandleTranslationUnit (ASTContext &Ctx) |
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed. | |
virtual void | HandleTagDeclDefinition (TagDecl *D) |
HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g. | |
virtual void | HandleTagDeclRequiredDefinition (const TagDecl *D) |
This callback is invoked the first time each TagDecl is required to be complete. | |
virtual void | HandleCXXImplicitFunctionInstantiation (FunctionDecl *D) |
Invoked when a function is implicitly instantiated. | |
virtual void | HandleTopLevelDeclInObjCContainer (DeclGroupRef D) |
Handle the specified top-level declaration that occurred inside and ObjC container. | |
virtual void | HandleImplicitImportDecl (ImportDecl *D) |
Handle an ImportDecl that was implicitly created due to an inclusion directive. | |
virtual void | CompleteTentativeDefinition (VarDecl *D) |
CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed. | |
virtual void | CompleteExternalDeclaration (VarDecl *D) |
CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed. | |
virtual void | AssignInheritanceModel (CXXRecordDecl *RD) |
Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl. | |
virtual void | HandleCXXStaticMemberVarInstantiation (VarDecl *D) |
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this. | |
virtual void | HandleVTable (CXXRecordDecl *RD) |
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required. | |
virtual ASTMutationListener * | GetASTMutationListener () |
If the consumer is interested in entities getting modified after their initial creation, it should return a pointer to an ASTMutationListener here. | |
virtual ASTDeserializationListener * | GetASTDeserializationListener () |
If the consumer is interested in entities being deserialized from AST files, it should return a pointer to a ASTDeserializationListener here. | |
virtual void | PrintStats () |
PrintStats - If desired, print any statistics. | |
virtual bool | shouldSkipFunctionBody (Decl *D) |
This callback is called for each function if the Parser was initialized with SkipFunctionBodies set to true . | |
Definition at line 106 of file CodeGenAction.cpp.
|
inline |
Definition at line 150 of file CodeGenAction.cpp.
|
inline |
Definition at line 176 of file CodeGenAction.cpp.
|
inlineoverridevirtual |
Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl.
Reimplemented from clang::ASTConsumer.
Definition at line 415 of file CodeGenAction.cpp.
|
inlineoverridevirtual |
CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed.
Reimplemented from clang::ASTConsumer.
Definition at line 411 of file CodeGenAction.cpp.
|
inlineoverridevirtual |
CompleteTentativeDefinition - Callback invoked at the end of a translation unit to notify the consumer that the given tentative definition should be completed.
The variable declaration itself will be a tentative definition. If it had an incomplete array type, its type will have already been changed to an array of size 1. However, the declaration remains a tentative definition and has not been modified by the introduction of an implicit zero initializer.
Reimplemented from clang::ASTConsumer.
Definition at line 407 of file CodeGenAction.cpp.
void BackendConsumer::DiagnosticHandlerImpl | ( | const llvm::DiagnosticInfo & | DI | ) |
This function is invoked when the backend needs to report something to the user.
Definition at line 883 of file CodeGenAction.cpp.
References clang::StreamingDiagnostic::AddString(), ComputeDiagID, ComputeDiagRemarkID, DontCallDiagHandler(), InlineAsmDiagHandler(), MisExpectDiagHandler(), OptimizationFailureHandler(), OptimizationRemarkHandler(), clang::DiagnosticsEngine::Report(), ResourceLimitDiagHandler(), SrcMgrDiagHandler(), StackSizeDiagHandler(), and UnsupportedDiagHandler().
Referenced by clang::ClangDiagnosticHandler::handleDiagnostics().
void BackendConsumer::DontCallDiagHandler | ( | const DiagnosticInfoDontCall & | D | ) |
Definition at line 847 of file CodeGenAction.cpp.
References clang::SourceLocation::getFromRawEncoding(), clang::SourceLocation::isValid(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().
void BackendConsumer::EmitOptimizationMessage | ( | const llvm::DiagnosticInfoOptimizationBase & | D, |
unsigned | DiagID | ||
) |
Specialized handlers for optimization remarks.
Note that these handlers only accept remarks and they always handle them.
Definition at line 747 of file CodeGenAction.cpp.
References Filename, getBestLocationFromDebugLoc(), and clang::DiagnosticsEngine::Report().
Referenced by OptimizationFailureHandler(), and OptimizationRemarkHandler().
const FullSourceLoc BackendConsumer::getBestLocationFromDebugLoc | ( | const llvm::DiagnosticInfoWithLocationBase & | D, |
bool & | BadDebugInfo, | ||
StringRef & | Filename, | ||
unsigned & | Line, | ||
unsigned & | Column | ||
) | const |
Get the best possible source location to represent a diagnostic that may have associated debug info.
Definition at line 658 of file CodeGenAction.cpp.
References Filename, clang::FileManager::getFile(), clang::SourceManager::getFileManager(), getFunctionSourceLocation(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), clang::DiagnosticsEngine::Report(), and clang::SourceManager::translateFileLineCol().
Referenced by EmitOptimizationMessage(), MisExpectDiagHandler(), and UnsupportedDiagHandler().
|
inline |
Definition at line 202 of file CodeGenAction.cpp.
Referenced by clang::CodeGenAction::CreateASTConsumer(), and clang::CodeGenAction::getCodeGenerator().
std::optional< FullSourceLoc > BackendConsumer::getFunctionSourceLocation | ( | const Function & | F | ) | const |
Definition at line 701 of file CodeGenAction.cpp.
Referenced by getBestLocationFromDebugLoc(), ResourceLimitDiagHandler(), and StackSizeDiagHandler().
|
inline |
Definition at line 197 of file CodeGenAction.cpp.
Referenced by LinkInModules().
|
inlineoverridevirtual |
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.
Reimplemented from clang::ASTConsumer.
Definition at line 204 of file CodeGenAction.cpp.
|
inlineoverridevirtual |
This callback is invoked each time an inline (method or friend) function definition in a class is completed.
Reimplemented from clang::ASTConsumer.
Definition at line 245 of file CodeGenAction.cpp.
References clang::ASTContext::getSourceManager().
|
inlineoverridevirtual |
HandleInterestingDecl - Handle the specified interesting declaration.
This is called by the AST reader when deserializing things that might interest the consumer. The default implementation forwards to HandleTopLevelDecl.
Reimplemented from clang::ASTConsumer.
Definition at line 258 of file CodeGenAction.cpp.
References HandleTopLevelDecl().
|
inlineoverridevirtual |
HandleTagDeclDefinition - This callback is invoked each time a TagDecl (e.g.
struct, union, enum, class) is completed. This allows the client to hack on the type, which can occur at any point in the file (because these can be defined in declspecs).
Reimplemented from clang::ASTConsumer.
Definition at line 396 of file CodeGenAction.cpp.
References clang::ASTContext::getSourceManager().
|
inlineoverridevirtual |
This callback is invoked the first time each TagDecl is required to be complete.
Reimplemented from clang::ASTConsumer.
Definition at line 403 of file CodeGenAction.cpp.
|
inlineoverridevirtual |
HandleTopLevelDecl - Handle the specified top-level declaration.
This is called by the parser to process every top-level Decl*.
Reimplemented from clang::ASTConsumer.
Definition at line 222 of file CodeGenAction.cpp.
References clang::DeclGroupRef::begin(), and clang::ASTContext::getSourceManager().
Referenced by HandleInterestingDecl().
|
inlineoverridevirtual |
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
Reimplemented from clang::ASTConsumer.
Definition at line 301 of file CodeGenAction.cpp.
References clang::C, clang::CodeGenOptions::DiagnosticsHotnessThreshold, clang::CodeGenOptions::DiagnosticsMisExpectTolerance, clang::EmbedBitcode(), clang::EmitBackendOutput(), clang::CodeGenOptions::OptRecordFile, clang::CodeGenOptions::OptRecordFormat, clang::CodeGenOptions::OptRecordPasses, clang::CodeGenOptions::ProfileNone, and clang::reportOptRecordError().
|
inlineoverridevirtual |
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.
RD | The class whose vtable was used. |
Reimplemented from clang::ASTConsumer.
Definition at line 419 of file CodeGenAction.cpp.
|
inlineoverridevirtual |
Initialize - This is called to initialize the consumer, providing the ASTContext.
Reimplemented from clang::ASTConsumer.
Definition at line 208 of file CodeGenAction.cpp.
bool BackendConsumer::InlineAsmDiagHandler | ( | const llvm::DiagnosticInfoInlineAsm & | D | ) |
Specialized handler for InlineAsm diagnostic.
Definition at line 602 of file CodeGenAction.cpp.
References clang::StreamingDiagnostic::AddString(), ComputeDiagID, clang::SourceLocation::getFromRawEncoding(), clang::SourceLocation::isValid(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().
|
inline |
Definition at line 265 of file CodeGenAction.cpp.
References getModule().
void BackendConsumer::MisExpectDiagHandler | ( | const llvm::DiagnosticInfoMisExpect & | D | ) |
Specialized handler for misexpect warnings.
Note that misexpect remarks are emitted through ORE
Definition at line 862 of file CodeGenAction.cpp.
References Filename, getBestLocationFromDebugLoc(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().
void BackendConsumer::OptimizationFailureHandler | ( | const llvm::DiagnosticInfoOptimizationFailure & | D | ) |
Definition at line 842 of file CodeGenAction.cpp.
References EmitOptimizationMessage().
Referenced by DiagnosticHandlerImpl().
void BackendConsumer::OptimizationRemarkHandler | ( | const llvm::DiagnosticInfoOptimizationBase & | D | ) |
Definition at line 786 of file CodeGenAction.cpp.
References EmitOptimizationMessage(), clang::CodeGenOptions::OptimizationRemark, clang::CodeGenOptions::OptimizationRemarkAnalysis, clang::CodeGenOptions::OptimizationRemarkMissed, and clang::CodeGenOptions::OptRemark::patternMatches().
Referenced by DiagnosticHandlerImpl().
void BackendConsumer::OptimizationRemarkHandler | ( | const llvm::OptimizationRemarkAnalysisAliasing & | D | ) |
Definition at line 830 of file CodeGenAction.cpp.
References EmitOptimizationMessage(), clang::CodeGenOptions::OptimizationRemarkAnalysis, and clang::CodeGenOptions::OptRemark::patternMatches().
void BackendConsumer::OptimizationRemarkHandler | ( | const llvm::OptimizationRemarkAnalysisFPCommute & | D | ) |
Definition at line 818 of file CodeGenAction.cpp.
References EmitOptimizationMessage(), clang::CodeGenOptions::OptimizationRemarkAnalysis, and clang::CodeGenOptions::OptRemark::patternMatches().
bool BackendConsumer::ResourceLimitDiagHandler | ( | const llvm::DiagnosticInfoResourceLimit & | D | ) |
Specialized handler for ResourceLimit diagnostic.
Definition at line 644 of file CodeGenAction.cpp.
References ComputeDiagID, getFunctionSourceLocation(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().
void BackendConsumer::SrcMgrDiagHandler | ( | const llvm::DiagnosticInfoSrcMgr & | D | ) |
Specialized handler for diagnostics reported using SMDiagnostic.
Definition at line 543 of file CodeGenAction.cpp.
References clang::StreamingDiagnostic::AddString(), ComputeDiagID, ConvertBackendLocation(), clang::SourceLocation::getFromRawEncoding(), clang::SourceLocation::getLocWithOffset(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isValid(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().
bool BackendConsumer::StackSizeDiagHandler | ( | const llvm::DiagnosticInfoStackSize & | D | ) |
Specialized handler for StackSize diagnostic.
Definition at line 627 of file CodeGenAction.cpp.
References getFunctionSourceLocation(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().
|
inline |
Definition at line 198 of file CodeGenAction.cpp.
Referenced by clang::CodeGenAction::EndSourceFileAction().
void BackendConsumer::UnsupportedDiagHandler | ( | const llvm::DiagnosticInfoUnsupported & | D | ) |
Specialized handler for unsupported backend feature diagnostic.
Definition at line 710 of file CodeGenAction.cpp.
References Filename, getBestLocationFromDebugLoc(), and clang::DiagnosticsEngine::Report().
Referenced by DiagnosticHandlerImpl().