diff options
author | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2011-02-20 13:06:31 +0000 |
commit | 39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df (patch) | |
tree | a9243275843fbeaa590afc07ee888e006b8d54ea /include/clang/CodeGen/CodeGenAction.h | |
parent | 69b4eca4a4255ba43baa5c1d9bbdec3ec17f479e (diff) | |
download | FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.zip FreeBSD-src-39fcc9a984e2820e4ea0fa2ac4abd17d9f3a31df.tar.gz |
Vendor import of clang trunk r126079:
http://llvm.org/svn/llvm-project/cfe/trunk@126079
Diffstat (limited to 'include/clang/CodeGen/CodeGenAction.h')
-rw-r--r-- | include/clang/CodeGen/CodeGenAction.h | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/include/clang/CodeGen/CodeGenAction.h b/include/clang/CodeGen/CodeGenAction.h index cecfcda..052c660 100644 --- a/include/clang/CodeGen/CodeGenAction.h +++ b/include/clang/CodeGen/CodeGenAction.h @@ -14,18 +14,25 @@ #include "llvm/ADT/OwningPtr.h" namespace llvm { + class LLVMContext; class Module; } namespace clang { +class BackendConsumer; class CodeGenAction : public ASTFrontendAction { private: unsigned Act; llvm::OwningPtr<llvm::Module> TheModule; + llvm::LLVMContext *VMContext; + bool OwnsVMContext; protected: - CodeGenAction(unsigned _Act); + /// Create a new code generation action. If the optional \arg _VMContext + /// parameter is supplied, the action uses it without taking ownership, + /// otherwise it creates a fresh LLVM context and takes ownership. + CodeGenAction(unsigned _Act, llvm::LLVMContext *_VMContext = 0); virtual bool hasIRSupport() const; @@ -42,36 +49,41 @@ public: /// takeModule - Take the generated LLVM module, for use after the action has /// been run. The result may be null on failure. llvm::Module *takeModule(); + + /// Take the LLVM context used by this action. + llvm::LLVMContext *takeLLVMContext(); + + BackendConsumer *BEConsumer; }; class EmitAssemblyAction : public CodeGenAction { public: - EmitAssemblyAction(); + EmitAssemblyAction(llvm::LLVMContext *_VMContext = 0); }; class EmitBCAction : public CodeGenAction { public: - EmitBCAction(); + EmitBCAction(llvm::LLVMContext *_VMContext = 0); }; class EmitLLVMAction : public CodeGenAction { public: - EmitLLVMAction(); + EmitLLVMAction(llvm::LLVMContext *_VMContext = 0); }; class EmitLLVMOnlyAction : public CodeGenAction { public: - EmitLLVMOnlyAction(); + EmitLLVMOnlyAction(llvm::LLVMContext *_VMContext = 0); }; class EmitCodeGenOnlyAction : public CodeGenAction { public: - EmitCodeGenOnlyAction(); + EmitCodeGenOnlyAction(llvm::LLVMContext *_VMContext = 0); }; class EmitObjAction : public CodeGenAction { public: - EmitObjAction(); + EmitObjAction(llvm::LLVMContext *_VMContext = 0); }; } |