class BackendConsumer
Declaration
class BackendConsumer : public ASTConsumer { /* full declaration omitted */ };
Description
ASTConsumer - This is an abstract interface that should be implemented by clients that read ASTs. This abstraction layer allows the client to be independent of the AST producer (e.g. parser vs AST dump file reader, etc).
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:105
Inherits from: ASTConsumer
Member Variables
- private clang::DiagnosticsEngine& Diags
- private clang::BackendAction Action
- private const clang::HeaderSearchOptions& HeaderSearchOpts
- private const clang::CodeGenOptions& CodeGenOpts
- private const clang::TargetOptions& TargetOpts
- private const clang::LangOptions& LangOpts
- private std::unique_ptr<raw_pwrite_stream> AsmOutStream
- private clang::ASTContext* Context
- private llvm::Timer LLVMIRGeneration
- private unsigned int LLVMIRGenerationRefCount
- private bool IRGenFinished = false
- True if we've finished generating IR. This prevents us from generating additional LLVM IR after emitting output in HandleTranslationUnit. This can happen when Clang plugins trigger additional AST deserialization.
- private bool TimerIsEnabled = false
- private std::unique_ptr<CodeGenerator> Gen
- private SmallVector<clang::BackendConsumer::LinkModule, 4> LinkModules
- private std::vector< std::pair<llvm::hash_code, FullSourceLoc>> ManglingFullSourceLocs
- private llvm::Module* CurLinkModule = nullptr
Method Overview
- public void AssignInheritanceModel(clang::CXXRecordDecl * RD)
- public BackendConsumer(clang::BackendAction Action, clang::DiagnosticsEngine & Diags, IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS, const clang::HeaderSearchOptions & HeaderSearchOpts, const clang::PreprocessorOptions & PPOpts, const clang::CodeGenOptions & CodeGenOpts, const clang::TargetOptions & TargetOpts, const clang::LangOptions & LangOpts, const std::string & InFile, SmallVector<clang::BackendConsumer::LinkModule, 4> LinkModules, std::unique_ptr<raw_pwrite_stream> OS, llvm::LLVMContext & C, clang::CoverageSourceInfo * CoverageInfo = nullptr)
- public BackendConsumer(clang::BackendAction Action, clang::DiagnosticsEngine & Diags, IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS, const clang::HeaderSearchOptions & HeaderSearchOpts, const clang::PreprocessorOptions & PPOpts, const clang::CodeGenOptions & CodeGenOpts, const clang::TargetOptions & TargetOpts, const clang::LangOptions & LangOpts, llvm::Module * Module, SmallVector<clang::BackendConsumer::LinkModule, 4> LinkModules, llvm::LLVMContext & C, clang::CoverageSourceInfo * CoverageInfo = nullptr)
- public void CompleteExternalDeclaration(clang::VarDecl * D)
- public void CompleteTentativeDefinition(clang::VarDecl * D)
- public void DiagnosticHandlerImpl(const llvm::DiagnosticInfo & DI)
- public void DontCallDiagHandler(const llvm::DiagnosticInfoDontCall & D)
- public void EmitOptimizationMessage(const llvm::DiagnosticInfoOptimizationBase & D, unsigned int DiagID)
- public void HandleCXXStaticMemberVarInstantiation(clang::VarDecl * VD)
- public void HandleInlineFunctionDefinition(clang::FunctionDecl * D)
- public void HandleInterestingDecl(clang::DeclGroupRef D)
- public void HandleTagDeclDefinition(clang::TagDecl * D)
- public void HandleTagDeclRequiredDefinition(const clang::TagDecl * D)
- public bool HandleTopLevelDecl(clang::DeclGroupRef D)
- public void HandleTranslationUnit(clang::ASTContext & C)
- public void HandleVTable(clang::CXXRecordDecl * RD)
- public void Initialize(clang::ASTContext & Ctx)
- public bool InlineAsmDiagHandler(const llvm::DiagnosticInfoInlineAsm & D)
- public bool LinkInModules()
- public void MisExpectDiagHandler(const llvm::DiagnosticInfoMisExpect & D)
- public void OptimizationFailureHandler(const llvm::DiagnosticInfoOptimizationFailure & D)
- public void OptimizationRemarkHandler(const llvm::DiagnosticInfoOptimizationBase & D)
- public void OptimizationRemarkHandler(const llvm::OptimizationRemarkAnalysisFPCommute & D)
- public void OptimizationRemarkHandler(const llvm::OptimizationRemarkAnalysisAliasing & D)
- public void SrcMgrDiagHandler(const llvm::DiagnosticInfoSrcMgr & D)
- public bool StackSizeDiagHandler(const llvm::DiagnosticInfoStackSize & D)
- public void UnsupportedDiagHandler(const llvm::DiagnosticInfoUnsupported & D)
- private virtual void anchor()
- public const clang::FullSourceLoc getBestLocationFromDebugLoc(const llvm::DiagnosticInfoWithLocationBase & D, bool & BadDebugInfo, llvm::StringRef & Filename, unsigned int & Line, unsigned int & Column) const
- public clang::CodeGenerator * getCodeGenerator()
- public Optional<clang::FullSourceLoc> getFunctionSourceLocation(const llvm::Function & F) const
- public llvm::Module * getModule() const
- public std::unique_ptr<llvm::Module> takeModule()
Inherited from ASTConsumer:
- public AssignInheritanceModel
- public CompleteExternalDeclaration
- public CompleteTentativeDefinition
- public GetASTDeserializationListener
- public GetASTMutationListener
- public HandleCXXImplicitFunctionInstantiation
- public HandleCXXStaticMemberVarInstantiation
- public HandleImplicitImportDecl
- public HandleInlineFunctionDefinition
- public HandleInterestingDecl
- public HandleTagDeclDefinition
- public HandleTagDeclRequiredDefinition
- public HandleTopLevelDecl
- public HandleTopLevelDeclInObjCContainer
- public HandleTranslationUnit
- public HandleVTable
- public Initialize
- public PrintStats
- public shouldSkipFunctionBody
Methods
¶void AssignInheritanceModel(
clang::CXXRecordDecl* RD)
void AssignInheritanceModel(
clang::CXXRecordDecl* RD)
Description
Callback invoked when an MSInheritanceAttr has been attached to a CXXRecordDecl.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:410
Parameters
¶BackendConsumer(
clang::BackendAction Action,
clang::DiagnosticsEngine& Diags,
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
const clang::HeaderSearchOptions&
HeaderSearchOpts,
const clang::PreprocessorOptions& PPOpts,
const clang::CodeGenOptions& CodeGenOpts,
const clang::TargetOptions& TargetOpts,
const clang::LangOptions& LangOpts,
const std::string& InFile,
SmallVector<
clang::BackendConsumer::LinkModule,
4> LinkModules,
std::unique_ptr<raw_pwrite_stream> OS,
llvm::LLVMContext& C,
clang::CoverageSourceInfo* CoverageInfo =
nullptr)
BackendConsumer(
clang::BackendAction Action,
clang::DiagnosticsEngine& Diags,
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
const clang::HeaderSearchOptions&
HeaderSearchOpts,
const clang::PreprocessorOptions& PPOpts,
const clang::CodeGenOptions& CodeGenOpts,
const clang::TargetOptions& TargetOpts,
const clang::LangOptions& LangOpts,
const std::string& InFile,
SmallVector<
clang::BackendConsumer::LinkModule,
4> LinkModules,
std::unique_ptr<raw_pwrite_stream> OS,
llvm::LLVMContext& C,
clang::CoverageSourceInfo* CoverageInfo =
nullptr)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:148
Parameters
- clang::BackendAction Action
- clang::DiagnosticsEngine& Diags
- IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS
- const clang::HeaderSearchOptions& HeaderSearchOpts
- const clang::PreprocessorOptions& PPOpts
- const clang::CodeGenOptions& CodeGenOpts
- const clang::TargetOptions& TargetOpts
- const clang::LangOptions& LangOpts
- const std::string& InFile
- SmallVector<clang::BackendConsumer::LinkModule, 4> LinkModules
- std::unique_ptr<raw_pwrite_stream> OS
- llvm::LLVMContext& C
- clang::CoverageSourceInfo* CoverageInfo = nullptr
¶BackendConsumer(
clang::BackendAction Action,
clang::DiagnosticsEngine& Diags,
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
const clang::HeaderSearchOptions&
HeaderSearchOpts,
const clang::PreprocessorOptions& PPOpts,
const clang::CodeGenOptions& CodeGenOpts,
const clang::TargetOptions& TargetOpts,
const clang::LangOptions& LangOpts,
llvm::Module* Module,
SmallVector<
clang::BackendConsumer::LinkModule,
4> LinkModules,
llvm::LLVMContext& C,
clang::CoverageSourceInfo* CoverageInfo =
nullptr)
BackendConsumer(
clang::BackendAction Action,
clang::DiagnosticsEngine& Diags,
IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS,
const clang::HeaderSearchOptions&
HeaderSearchOpts,
const clang::PreprocessorOptions& PPOpts,
const clang::CodeGenOptions& CodeGenOpts,
const clang::TargetOptions& TargetOpts,
const clang::LangOptions& LangOpts,
llvm::Module* Module,
SmallVector<
clang::BackendConsumer::LinkModule,
4> LinkModules,
llvm::LLVMContext& C,
clang::CoverageSourceInfo* CoverageInfo =
nullptr)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:174
Parameters
- clang::BackendAction Action
- clang::DiagnosticsEngine& Diags
- IntrusiveRefCntPtr<llvm::vfs::FileSystem> FS
- const clang::HeaderSearchOptions& HeaderSearchOpts
- const clang::PreprocessorOptions& PPOpts
- const clang::CodeGenOptions& CodeGenOpts
- const clang::TargetOptions& TargetOpts
- const clang::LangOptions& LangOpts
- llvm::Module* Module
- SmallVector<clang::BackendConsumer::LinkModule, 4> LinkModules
- llvm::LLVMContext& C
- clang::CoverageSourceInfo* CoverageInfo = nullptr
¶void CompleteExternalDeclaration(
clang::VarDecl* D)
void CompleteExternalDeclaration(
clang::VarDecl* D)
Description
CompleteExternalDeclaration - Callback invoked at the end of a translation unit to notify the consumer that the given external declaration should be completed.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:406
Parameters
¶void CompleteTentativeDefinition(
clang::VarDecl* D)
void CompleteTentativeDefinition(
clang::VarDecl* D)
Description
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.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:402
Parameters
¶void DiagnosticHandlerImpl(
const llvm::DiagnosticInfo& DI)
void DiagnosticHandlerImpl(
const llvm::DiagnosticInfo& DI)
Description
This function is invoked when the backend needs to report something to the user.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:427
Parameters
- const llvm::DiagnosticInfo& DI
¶void DontCallDiagHandler(
const llvm::DiagnosticInfoDontCall& D)
void DontCallDiagHandler(
const llvm::DiagnosticInfoDontCall& D)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:453
Parameters
- const llvm::DiagnosticInfoDontCall& D
¶void EmitOptimizationMessage(
const llvm::DiagnosticInfoOptimizationBase& D,
unsigned int DiagID)
void EmitOptimizationMessage(
const llvm::DiagnosticInfoOptimizationBase& D,
unsigned int DiagID)
Description
Specialized handlers for optimization remarks. Note that these handlers only accept remarks and they always handle them.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:443
Parameters
- const llvm::DiagnosticInfoOptimizationBase& D
- unsigned int DiagID
¶void HandleCXXStaticMemberVarInstantiation(
clang::VarDecl* VD)
void HandleCXXStaticMemberVarInstantiation(
clang::VarDecl* VD)
Description
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:202
Parameters
- clang::VarDecl* VD
¶void HandleInlineFunctionDefinition(
clang::FunctionDecl* D)
void HandleInlineFunctionDefinition(
clang::FunctionDecl* D)
Description
This callback is invoked each time an inline (method or friend) function definition in a class is completed.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:243
Parameters
¶void HandleInterestingDecl(clang::DeclGroupRef D)
void HandleInterestingDecl(clang::DeclGroupRef D)
Description
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.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:256
Parameters
¶void HandleTagDeclDefinition(clang::TagDecl* D)
void HandleTagDeclDefinition(clang::TagDecl* D)
Description
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).
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:391
Parameters
¶void HandleTagDeclRequiredDefinition(
const clang::TagDecl* D)
void HandleTagDeclRequiredDefinition(
const clang::TagDecl* D)
Description
This callback is invoked the first time each TagDecl is required to be complete.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:398
Parameters
- const clang::TagDecl* D
¶bool HandleTopLevelDecl(clang::DeclGroupRef D)
bool HandleTopLevelDecl(clang::DeclGroupRef D)
Description
HandleTopLevelDecl - Handle the specified top-level declaration. This is called by the parser to process every top-level Decl*.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:220
Parameters
Returns
true to continue parsing, or false to abort parsing.
¶void HandleTranslationUnit(clang::ASTContext& C)
void HandleTranslationUnit(clang::ASTContext& C)
Description
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:296
Parameters
¶void HandleVTable(clang::CXXRecordDecl* RD)
void HandleVTable(clang::CXXRecordDecl* RD)
Description
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:414
Parameters
- clang::CXXRecordDecl* RD
- The class whose vtable was used.
¶void Initialize(clang::ASTContext& Ctx)
void Initialize(clang::ASTContext& Ctx)
Description
Initialize - This is called to initialize the consumer, providing the ASTContext.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:206
Parameters
- clang::ASTContext& Ctx
¶bool InlineAsmDiagHandler(
const llvm::DiagnosticInfoInlineAsm& D)
bool InlineAsmDiagHandler(
const llvm::DiagnosticInfoInlineAsm& D)
Description
Specialized handler for InlineAsm diagnostic.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:431
Parameters
- const llvm::DiagnosticInfoInlineAsm& D
Returns
True if the diagnostic has been successfully reported, false otherwise.
¶bool LinkInModules()
bool LinkInModules()
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:263
¶void MisExpectDiagHandler(
const llvm::DiagnosticInfoMisExpect& D)
void MisExpectDiagHandler(
const llvm::DiagnosticInfoMisExpect& D)
Description
Specialized handler for misexpect warnings. Note that misexpect remarks are emitted through ORE
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:456
Parameters
- const llvm::DiagnosticInfoMisExpect& D
¶void OptimizationFailureHandler(
const llvm::DiagnosticInfoOptimizationFailure&
D)
void OptimizationFailureHandler(
const llvm::DiagnosticInfoOptimizationFailure&
D)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:451
Parameters
¶void OptimizationRemarkHandler(
const llvm::DiagnosticInfoOptimizationBase& D)
void OptimizationRemarkHandler(
const llvm::DiagnosticInfoOptimizationBase& D)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:446
Parameters
- const llvm::DiagnosticInfoOptimizationBase& D
¶void OptimizationRemarkHandler(
const llvm::
OptimizationRemarkAnalysisFPCommute& D)
void OptimizationRemarkHandler(
const llvm::
OptimizationRemarkAnalysisFPCommute& D)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:447
Parameters
¶void OptimizationRemarkHandler(
const llvm::
OptimizationRemarkAnalysisAliasing& D)
void OptimizationRemarkHandler(
const llvm::
OptimizationRemarkAnalysisAliasing& D)
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:449
Parameters
¶void SrcMgrDiagHandler(
const llvm::DiagnosticInfoSrcMgr& D)
void SrcMgrDiagHandler(
const llvm::DiagnosticInfoSrcMgr& D)
Description
Specialized handler for diagnostics reported using SMDiagnostic.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:433
Parameters
- const llvm::DiagnosticInfoSrcMgr& D
¶bool StackSizeDiagHandler(
const llvm::DiagnosticInfoStackSize& D)
bool StackSizeDiagHandler(
const llvm::DiagnosticInfoStackSize& D)
Description
Specialized handler for StackSize diagnostic.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:437
Parameters
- const llvm::DiagnosticInfoStackSize& D
Returns
True if the diagnostic has been successfully reported, false otherwise.
¶void UnsupportedDiagHandler(
const llvm::DiagnosticInfoUnsupported& D)
void UnsupportedDiagHandler(
const llvm::DiagnosticInfoUnsupported& D)
Description
Specialized handler for unsupported backend feature diagnostic.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:439
Parameters
- const llvm::DiagnosticInfoUnsupported& D
¶virtual void anchor()
virtual void anchor()
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:108
¶const clang::FullSourceLoc
getBestLocationFromDebugLoc(
const llvm::DiagnosticInfoWithLocationBase& D,
bool& BadDebugInfo,
llvm::StringRef& Filename,
unsigned int& Line,
unsigned int& Column) const
const clang::FullSourceLoc
getBestLocationFromDebugLoc(
const llvm::DiagnosticInfoWithLocationBase& D,
bool& BadDebugInfo,
llvm::StringRef& Filename,
unsigned int& Line,
unsigned int& Column) const
Description
Get the best possible source location to represent a diagnostic that may have associated debug info.
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:421
Parameters
- const llvm::DiagnosticInfoWithLocationBase& D
- bool& BadDebugInfo
- llvm::StringRef& Filename
- unsigned int& Line
- unsigned int& Column
¶clang::CodeGenerator* getCodeGenerator()
clang::CodeGenerator* getCodeGenerator()
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:200
¶Optional<clang::FullSourceLoc>
getFunctionSourceLocation(
const llvm::Function& F) const
Optional<clang::FullSourceLoc>
getFunctionSourceLocation(
const llvm::Function& F) const
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:425
Parameters
- const llvm::Function& F
¶llvm::Module* getModule() const
llvm::Module* getModule() const
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:195
¶std::unique_ptr<llvm::Module> takeModule()
std::unique_ptr<llvm::Module> takeModule()
Declared at: clang/lib/CodeGen/CodeGenAction.cpp:196