clang API Documentation
Public Member Functions | |
BackendConsumer (BackendAction action, DiagnosticsEngine &_Diags, const CodeGenOptions &compopts, const TargetOptions &targetopts, const LangOptions &langopts, bool TimePasses, const std::string &infile, llvm::Module *LinkModule, raw_ostream *OS, LLVMContext &C, CoverageSourceInfo *CoverageInfo=nullptr) | |
std::unique_ptr< llvm::Module > | takeModule () |
llvm::Module * | takeLinkModule () |
void | HandleCXXStaticMemberVarInstantiation (VarDecl *VD) override |
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this. | |
void | Initialize (ASTContext &Ctx) override |
bool | HandleTopLevelDecl (DeclGroupRef D) override |
void | HandleInlineMethodDefinition (CXXMethodDecl *D) override |
This callback is invoked each time an inline method definition is completed. | |
void | HandleTranslationUnit (ASTContext &C) override |
void | HandleTagDeclDefinition (TagDecl *D) override |
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 |
void | HandleVTable (CXXRecordDecl *RD, bool DefinitionRequired) override |
Callback involved at the end of a translation unit to notify the consumer that a vtable for the given C++ class is required. | |
void | HandleLinkerOptionPragma (llvm::StringRef Opts) override |
Handle a pragma that appends to Linker Options. Currently this only exists to support Microsoft's #pragma comment(linker, "/foo"). | |
void | HandleDetectMismatch (llvm::StringRef Name, llvm::StringRef Value) override |
Handle a pragma that emits a mismatch identifier and value to the object file for the linker to work with. Currently, this only exists to support Microsoft's #pragma detect_mismatch. | |
void | HandleDependentLibrary (llvm::StringRef Opts) override |
Handle a dependent library created by a pragma in the source. Currently this only exists to support Microsoft's #pragma comment(lib, "/foo"). | |
void | linkerDiagnosticHandler (const llvm::DiagnosticInfo &DI) |
void | InlineAsmDiagHandler2 (const llvm::SMDiagnostic &, SourceLocation LocCookie) |
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. | |
bool | StackSizeDiagHandler (const llvm::DiagnosticInfoStackSize &D) |
Specialized handler for StackSize diagnostic. | |
void | EmitOptimizationMessage (const llvm::DiagnosticInfoOptimizationBase &D, unsigned DiagID) |
Specialized handlers for optimization remarks. Note that these handlers only accept remarks and they always handle them. | |
void | OptimizationRemarkHandler (const llvm::DiagnosticInfoOptimizationRemark &D) |
void | OptimizationRemarkHandler (const llvm::DiagnosticInfoOptimizationRemarkMissed &D) |
void | OptimizationRemarkHandler (const llvm::DiagnosticInfoOptimizationRemarkAnalysis &D) |
void | OptimizationFailureHandler (const llvm::DiagnosticInfoOptimizationFailure &D) |
Static Public Member Functions | |
static void | InlineAsmDiagHandler (const llvm::SMDiagnostic &SM, void *Context, unsigned LocCookie) |
static void | DiagnosticHandler (const llvm::DiagnosticInfo &DI, void *Context) |
Definition at line 42 of file CodeGenAction.cpp.
clang::BackendConsumer::BackendConsumer | ( | BackendAction | action, |
DiagnosticsEngine & | _Diags, | ||
const CodeGenOptions & | compopts, | ||
const TargetOptions & | targetopts, | ||
const LangOptions & | langopts, | ||
bool | TimePasses, | ||
const std::string & | infile, | ||
llvm::Module * | LinkModule, | ||
raw_ostream * | OS, | ||
LLVMContext & | C, | ||
CoverageSourceInfo * | CoverageInfo = nullptr |
||
) | [inline] |
Definition at line 59 of file CodeGenAction.cpp.
void clang::BackendConsumer::CompleteTentativeDefinition | ( | VarDecl * | D | ) | [inline, override, virtual] |
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 195 of file CodeGenAction.cpp.
static void clang::BackendConsumer::DiagnosticHandler | ( | const llvm::DiagnosticInfo & | DI, |
void * | Context | ||
) | [inline, static] |
Definition at line 224 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 516 of file CodeGenAction.cpp.
References ComputeDiagID, and ComputeDiagRemarkID.
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 423 of file CodeGenAction.cpp.
References Column, Context, clang::FileManager::getFile(), clang::ASTContext::getSourceManager(), clang::SourceLocation::isInvalid(), Line, and SourceMgr.
void clang::BackendConsumer::HandleCXXStaticMemberVarInstantiation | ( | VarDecl * | D | ) | [inline, override, virtual] |
HandleCXXStaticMemberVarInstantiation - Tell the consumer that this.
Reimplemented from clang::ASTConsumer.
Definition at line 78 of file CodeGenAction.cpp.
void clang::BackendConsumer::HandleDependentLibrary | ( | llvm::StringRef | Lib | ) | [inline, override, virtual] |
Handle a dependent library created by a pragma in the source. Currently this only exists to support Microsoft's #pragma comment(lib, "/foo").
Reimplemented from clang::ASTConsumer.
Definition at line 212 of file CodeGenAction.cpp.
void clang::BackendConsumer::HandleDetectMismatch | ( | llvm::StringRef | Name, |
llvm::StringRef | Value | ||
) | [inline, override, virtual] |
Handle a pragma that emits a mismatch identifier and value to the object file for the linker to work with. Currently, this only exists to support Microsoft's #pragma detect_mismatch.
Reimplemented from clang::ASTConsumer.
Definition at line 207 of file CodeGenAction.cpp.
void clang::BackendConsumer::HandleInlineMethodDefinition | ( | CXXMethodDecl * | D | ) | [inline, override, virtual] |
This callback is invoked each time an inline method definition is completed.
Reimplemented from clang::ASTConsumer.
Definition at line 112 of file CodeGenAction.cpp.
References Context, and clang::ASTContext::getSourceManager().
void clang::BackendConsumer::HandleLinkerOptionPragma | ( | llvm::StringRef | Opts | ) | [inline, override, virtual] |
Handle a pragma that appends to Linker Options. Currently this only exists to support Microsoft's #pragma comment(linker, "/foo").
Reimplemented from clang::ASTConsumer.
Definition at line 203 of file CodeGenAction.cpp.
void clang::BackendConsumer::HandleTagDeclDefinition | ( | TagDecl * | D | ) | [inline, override, virtual] |
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 184 of file CodeGenAction.cpp.
References Context, and clang::ASTContext::getSourceManager().
void clang::BackendConsumer::HandleTagDeclRequiredDefinition | ( | const TagDecl * | D | ) | [inline, override, virtual] |
This callback is invoked the first time each TagDecl is required to be complete.
Reimplemented from clang::ASTConsumer.
Definition at line 191 of file CodeGenAction.cpp.
bool clang::BackendConsumer::HandleTopLevelDecl | ( | DeclGroupRef | D | ) | [inline, override, virtual] |
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 96 of file CodeGenAction.cpp.
References clang::DeclGroupRef::begin(), Context, and clang::ASTContext::getSourceManager().
void clang::BackendConsumer::HandleTranslationUnit | ( | ASTContext & | Ctx | ) | [inline, override, virtual] |
HandleTranslationUnit - This method is called when the ASTs for entire translation unit have been parsed.
Reimplemented from clang::ASTConsumer.
Definition at line 125 of file CodeGenAction.cpp.
References Action, clang::EmitBackendOutput(), clang::TargetInfo::getTargetDescription(), and clang::ASTContext::getTargetInfo().
void clang::BackendConsumer::HandleVTable | ( | CXXRecordDecl * | RD, |
bool | DefinitionRequired | ||
) | [inline, override, virtual] |
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. |
DefinitionRequired | Whether a definition of this vtable is required in this translation unit; otherwise, it is only needed if it was actually used. |
Reimplemented from clang::ASTConsumer.
Definition at line 199 of file CodeGenAction.cpp.
void clang::BackendConsumer::Initialize | ( | ASTContext & | Context | ) | [inline, override, virtual] |
Initialize - This is called to initialize the consumer, providing the ASTContext.
Reimplemented from clang::ASTConsumer.
Definition at line 82 of file CodeGenAction.cpp.
References Context.
static void clang::BackendConsumer::InlineAsmDiagHandler | ( | const llvm::SMDiagnostic & | SM, |
void * | Context, | ||
unsigned | LocCookie | ||
) | [inline, static] |
Definition at line 216 of file CodeGenAction.cpp.
References clang::SourceLocation::getFromRawEncoding().
bool BackendConsumer::InlineAsmDiagHandler | ( | const llvm::DiagnosticInfoInlineAsm & | D | ) |
Specialized handler for InlineAsm diagnostic.
Definition at line 382 of file CodeGenAction.cpp.
References ComputeDiagID, clang::SourceLocation::getFromRawEncoding(), and clang::SourceLocation::isValid().
void BackendConsumer::InlineAsmDiagHandler2 | ( | const llvm::SMDiagnostic & | D, |
SourceLocation | LocCookie | ||
) |
InlineAsmDiagHandler2 - This function is invoked when the backend hits an error parsing inline asm. The SMDiagnostic indicates the error relative to the temporary memory buffer that the inline asm parser has set up.
Definition at line 292 of file CodeGenAction.cpp.
References Column, Context, ConvertBackendLocation(), clang::SourceLocation::getLocWithOffset(), clang::ASTContext::getSourceManager(), and clang::SourceLocation::isValid().
void BackendConsumer::linkerDiagnosticHandler | ( | const llvm::DiagnosticInfo & | DI | ) |
Definition at line 499 of file CodeGenAction.cpp.
void BackendConsumer::OptimizationFailureHandler | ( | const llvm::DiagnosticInfoOptimizationFailure & | D | ) |
Definition at line 494 of file CodeGenAction.cpp.
void BackendConsumer::OptimizationRemarkHandler | ( | const llvm::DiagnosticInfoOptimizationRemark & | D | ) |
Definition at line 463 of file CodeGenAction.cpp.
void BackendConsumer::OptimizationRemarkHandler | ( | const llvm::DiagnosticInfoOptimizationRemarkMissed & | D | ) |
Definition at line 472 of file CodeGenAction.cpp.
void BackendConsumer::OptimizationRemarkHandler | ( | const llvm::DiagnosticInfoOptimizationRemarkAnalysis & | D | ) |
Definition at line 483 of file CodeGenAction.cpp.
bool BackendConsumer::StackSizeDiagHandler | ( | const llvm::DiagnosticInfoStackSize & | D | ) |
Specialized handler for StackSize diagnostic.
Definition at line 407 of file CodeGenAction.cpp.
References clang::Decl::castToDeclContext().
llvm::Module* clang::BackendConsumer::takeLinkModule | ( | ) | [inline] |
Definition at line 76 of file CodeGenAction.cpp.
Referenced by clang::CodeGenAction::EndSourceFileAction().
std::unique_ptr<llvm::Module> clang::BackendConsumer::takeModule | ( | ) | [inline] |
Definition at line 75 of file CodeGenAction.cpp.
Referenced by clang::CodeGenAction::EndSourceFileAction().