1193326Sed//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===// 2193326Sed// 3193326Sed// The LLVM Compiler Infrastructure 4193326Sed// 5193326Sed// This file is distributed under the University of Illinois Open Source 6193326Sed// License. See LICENSE.TXT for details. 7193326Sed// 8193326Sed//===----------------------------------------------------------------------===// 9193326Sed// 10193326Sed// This file defines the ModuleBuilder interface. 11193326Sed// 12193326Sed//===----------------------------------------------------------------------===// 13193326Sed 14193326Sed#ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H 15193326Sed#define LLVM_CLANG_CODEGEN_MODULEBUILDER_H 16193326Sed 17193326Sed#include "clang/AST/ASTConsumer.h" 18193326Sed#include <string> 19193326Sed 20193326Sednamespace llvm { 21195341Sed class LLVMContext; 22193326Sed class Module; 23193326Sed} 24193326Sed 25193326Sednamespace clang { 26226633Sdim class DiagnosticsEngine; 27193326Sed class LangOptions; 28199482Srdivacky class CodeGenOptions; 29249423Sdim class TargetOptions; 30198092Srdivacky 31193326Sed class CodeGenerator : public ASTConsumer { 32234353Sdim virtual void anchor(); 33193326Sed public: 34193326Sed virtual llvm::Module* GetModule() = 0; 35198092Srdivacky virtual llvm::Module* ReleaseModule() = 0; 36193326Sed }; 37198092Srdivacky 38210299Sed /// CreateLLVMCodeGen - Create a CodeGenerator instance. 39210299Sed /// It is the responsibility of the caller to call delete on 40210299Sed /// the allocated CodeGenerator instance. 41226633Sdim CodeGenerator *CreateLLVMCodeGen(DiagnosticsEngine &Diags, 42193326Sed const std::string &ModuleName, 43199482Srdivacky const CodeGenOptions &CGO, 44249423Sdim const TargetOptions &TO, 45195341Sed llvm::LLVMContext& C); 46193326Sed} 47193326Sed 48193326Sed#endif 49