diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-05 18:50:11 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-05 18:50:11 +0000 |
commit | 815c78fd9ab8bd5dfe8e8a91b8c6a413e2b8c889 (patch) | |
tree | 547c2e5fd353b83e909ad60e9292bb3af8037ace /include/clang/CodeGen/ModuleBuilder.h | |
parent | a11440b68a02d54cd9c4b54160b0e339e0f30754 (diff) |
Refactored driver logic for CodeGen into LLVMCodeGenWriter. This ASTConsumer layers on top of LLVMCodeGen (another existing ASTConsumer) to emit bitcode files to disk. This layering takes this logic out of clang.cpp and puts it directly into the ASTConsumer interface. The benefit is that now --emit-llvm works with both serialized ASTs and regular source files.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54364 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/CodeGen/ModuleBuilder.h')
-rw-r--r-- | include/clang/CodeGen/ModuleBuilder.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h index b6ec1cf142..0f9b39341b 100644 --- a/include/clang/CodeGen/ModuleBuilder.h +++ b/include/clang/CodeGen/ModuleBuilder.h @@ -14,6 +14,9 @@ #ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H #define LLVM_CLANG_CODEGEN_MODULEBUILDER_H +#include "clang/AST/ASTConsumer.h" +#include <string> + namespace llvm { class Module; } @@ -21,11 +24,16 @@ namespace llvm { namespace clang { class Diagnostic; struct LangOptions; - class ASTConsumer; - ASTConsumer *CreateLLVMCodeGen(Diagnostic &Diags, const LangOptions &Features, - llvm::Module *&DestModule, - bool GenerateDebugInfo); + class CodeGenerator : public ASTConsumer { + public: + virtual llvm::Module* ReleaseModule() = 0; + }; + + CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags, + const LangOptions &Features, + const std::string& ModuleName, + bool GenerateDebugInfo); } #endif |