ModuleBuilder.h revision 193326
1//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9// 10// This file defines the ModuleBuilder interface. 11// 12//===----------------------------------------------------------------------===// 13 14#ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H 15#define LLVM_CLANG_CODEGEN_MODULEBUILDER_H 16 17#include "clang/AST/ASTConsumer.h" 18#include <string> 19 20namespace llvm { 21 class Module; 22} 23 24namespace clang { 25 class Diagnostic; 26 class LangOptions; 27 class CompileOptions; 28 29 class CodeGenerator : public ASTConsumer { 30 public: 31 virtual llvm::Module* GetModule() = 0; 32 virtual llvm::Module* ReleaseModule() = 0; 33 }; 34 35 CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags, 36 const std::string &ModuleName, 37 const CompileOptions &CO); 38} 39 40#endif 41