clang API Documentation

Public Member Functions | Public Attributes | Protected Member Functions
clang::CodeGenAction Class Reference

#include <CodeGenAction.h>

Inheritance diagram for clang::CodeGenAction:
Inheritance graph
[legend]
Collaboration diagram for clang::CodeGenAction:
Collaboration graph
[legend]

List of all members.

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

BackendConsumerBEConsumer

Protected Member Functions

 CodeGenAction (unsigned _Act, llvm::LLVMContext *_VMContext=0)
virtual bool hasIRSupport () const
 hasIRSupport - Does this action support use with IR files?
virtual ASTConsumerCreateASTConsumer (CompilerInstance &CI, StringRef InFile)
virtual void ExecuteAction ()
virtual void EndSourceFileAction ()

Detailed Description

Definition at line 24 of file CodeGenAction.h.


Constructor & Destructor Documentation

CodeGenAction::CodeGenAction ( unsigned  _Act,
llvm::LLVMContext *  _VMContext = 0 
) [protected]

Create a new code generation action. If the optional

  • _VMContext parameter is supplied, the action uses it without taking ownership, otherwise it creates a fresh LLVM context and takes ownership.

Definition at line 268 of file CodeGenAction.cpp.

CodeGenAction::~CodeGenAction ( )

Definition at line 273 of file CodeGenAction.cpp.


Member Function Documentation

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

See also:
BeginSourceAction(), which will fail if the AST consumer cannot be created. This will not be called if the action has indicated that it only uses the preprocessor.
Parameters:
CI- The current compiler instance, provided as a convenience,
See also:
getCompilerInstance().
Parameters:
InFile- The current input file, provided as a convenience,
See also:
getCurrentFile().
Returns:
The new AST consumer, or 0 on failure.

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]
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.


Member Data Documentation

Definition at line 62 of file CodeGenAction.h.

Referenced by CreateASTConsumer(), and EndSourceFileAction().


The documentation for this class was generated from the following files: