clang API Documentation
#include <CodeGenAction.h>


Public Member Functions | |
| ~CodeGenAction () | |
| void | setLinkModule (llvm::Module *Mod) |
| llvm::Module * | takeModule () |
| llvm::LLVMContext * | takeLLVMContext () |
| Take the LLVM context used by this action. | |
Public Attributes | |
| BackendConsumer * | BEConsumer |
Protected Member Functions | |
| CodeGenAction (unsigned _Act, llvm::LLVMContext *_VMContext=0) | |
| virtual bool | hasIRSupport () const |
| hasIRSupport - Does this action support use with IR files? | |
| virtual ASTConsumer * | CreateASTConsumer (CompilerInstance &CI, StringRef InFile) |
| virtual void | ExecuteAction () |
| virtual void | EndSourceFileAction () |
Definition at line 24 of file CodeGenAction.h.
| CodeGenAction::CodeGenAction | ( | unsigned | _Act, |
| llvm::LLVMContext * | _VMContext = 0 |
||
| ) | [protected] |
Create a new code generation action. If the optional
Definition at line 268 of file CodeGenAction.cpp.
| CodeGenAction::~CodeGenAction | ( | ) |
Definition at line 273 of file CodeGenAction.cpp.
| ASTConsumer * CodeGenAction::CreateASTConsumer | ( | CompilerInstance & | CI, |
| StringRef | InFile | ||
| ) | [protected, virtual] |
CreateASTConsumer - Create the AST consumer object for this action, if supported.
This routine is called as part of
| CI | - The current compiler instance, provided as a convenience, |
| InFile | - The current input file, provided as a convenience, |
Implements clang::FrontendAction.
Definition at line 323 of file CodeGenAction.cpp.
References clang::Backend_EmitNothing, BEConsumer, clang::FileManager::getBufferForFile(), clang::CompilerInstance::getCodeGenOpts(), clang::CompilerInstance::getDiagnostics(), clang::CompilerInstance::getFileManager(), clang::CompilerInstance::getFrontendOpts(), clang::CompilerInstance::getLangOpts(), GetOutputStream(), clang::CompilerInstance::getTargetOpts(), clang::CodeGenOptions::LinkBitcodeFile, clang::DiagnosticsEngine::Report(), and clang::FrontendOptions::ShowTimers.
| void CodeGenAction::EndSourceFileAction | ( | ) | [protected, virtual] |
EndSourceFileAction - Callback at the end of processing a single input; this is guaranteed to only be called following a successful call to BeginSourceFileAction (and BeginSourceFile).
Reimplemented from clang::FrontendAction.
Definition at line 281 of file CodeGenAction.cpp.
References BEConsumer, clang::FrontendAction::getCompilerInstance(), clang::BackendConsumer::takeLinkModule(), and clang::BackendConsumer::takeModule().
| void CodeGenAction::ExecuteAction | ( | ) | [protected, virtual] |
ExecuteAction - Implement the ExecuteAction interface by running Sema on the already initialized AST consumer.
This will also take care of instantiating a code completion consumer if the user requested it and the action supports it.
Reimplemented from clang::ASTFrontendAction.
Definition at line 363 of file CodeGenAction.cpp.
References clang::Backend_EmitNothing, clang::EmitBackendOutput(), clang::DiagnosticsEngine::Error, clang::SourceManager::getBuffer(), clang::CompilerInstance::getCodeGenOpts(), clang::FrontendAction::getCompilerInstance(), clang::FrontendAction::getCurrentFile(), clang::FrontendAction::getCurrentFileKind(), clang::DiagnosticsEngine::getCustomDiagID(), clang::CompilerInstance::getDiagnostics(), clang::SourceManager::getFileEntryForID(), clang::CompilerInstance::getLangOpts(), clang::SourceManager::getMainFileID(), GetOutputStream(), clang::CompilerInstance::getSourceManager(), clang::CompilerInstance::getTargetOpts(), clang::IK_LLVM_IR, clang::DiagnosticsEngine::Report(), and clang::SourceManager::translateFileLineCol().
| bool CodeGenAction::hasIRSupport | ( | ) | const [protected, virtual] |
hasIRSupport - Does this action support use with IR files?
Reimplemented from clang::FrontendAction.
Definition at line 279 of file CodeGenAction.cpp.
| void clang::CodeGenAction::setLinkModule | ( | llvm::Module * | Mod | ) | [inline] |
setLinkModule - Set the link module to be used by this action. If a link module is not provided, and CodeGenOptions::LinkBitcodeFile is non-empty, the action will load it from the specified file.
Definition at line 53 of file CodeGenAction.h.
| llvm::LLVMContext * CodeGenAction::takeLLVMContext | ( | ) |
Take the LLVM context used by this action.
Definition at line 298 of file CodeGenAction.cpp.
| llvm::Module * CodeGenAction::takeModule | ( | ) |
takeModule - Take the generated LLVM module, for use after the action has been run. The result may be null on failure.
Definition at line 294 of file CodeGenAction.cpp.
Definition at line 62 of file CodeGenAction.h.
Referenced by CreateASTConsumer(), and EndSourceFileAction().