Add GetModule accessor to ModuleBuilder
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57924 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/CodeGen/ModuleBuilder.h b/include/clang/CodeGen/ModuleBuilder.h
index 0f9b393..4642e4e 100644
--- a/include/clang/CodeGen/ModuleBuilder.h
+++ b/include/clang/CodeGen/ModuleBuilder.h
@@ -26,8 +26,9 @@
struct LangOptions;
class CodeGenerator : public ASTConsumer {
- public:
- virtual llvm::Module* ReleaseModule() = 0;
+ public:
+ virtual llvm::Module* GetModule() = 0;
+ virtual llvm::Module* ReleaseModule() = 0;
};
CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
diff --git a/lib/CodeGen/ModuleBuilder.cpp b/lib/CodeGen/ModuleBuilder.cpp
index dafc0f5..be6e171 100644
--- a/lib/CodeGen/ModuleBuilder.cpp
+++ b/lib/CodeGen/ModuleBuilder.cpp
@@ -48,6 +48,10 @@
virtual ~CodeGeneratorImpl() {}
+ virtual llvm::Module* GetModule() {
+ return M.get();
+ }
+
virtual llvm::Module* ReleaseModule() {
return M.take();
}