2009-06-02 13:58:47 -04:00
|
|
|
//===--- CodeGen/ModuleBuilder.h - Build LLVM from ASTs ---------*- C++ -*-===//
|
|
|
|
|
//
|
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
|
//
|
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
//
|
|
|
|
|
// This file defines the ModuleBuilder interface.
|
|
|
|
|
//
|
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
|
|
#ifndef LLVM_CLANG_CODEGEN_MODULEBUILDER_H
|
|
|
|
|
#define LLVM_CLANG_CODEGEN_MODULEBUILDER_H
|
|
|
|
|
|
|
|
|
|
#include "clang/AST/ASTConsumer.h"
|
|
|
|
|
#include <string>
|
|
|
|
|
|
|
|
|
|
namespace llvm {
|
2009-07-04 09:58:54 -04:00
|
|
|
class LLVMContext;
|
2009-06-02 13:58:47 -04:00
|
|
|
class Module;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
|
class Diagnostic;
|
|
|
|
|
class LangOptions;
|
2009-11-18 09:59:57 -05:00
|
|
|
class CodeGenOptions;
|
2009-10-14 14:03:49 -04:00
|
|
|
|
2009-06-02 13:58:47 -04:00
|
|
|
class CodeGenerator : public ASTConsumer {
|
|
|
|
|
public:
|
|
|
|
|
virtual llvm::Module* GetModule() = 0;
|
2009-10-14 14:03:49 -04:00
|
|
|
virtual llvm::Module* ReleaseModule() = 0;
|
2009-06-02 13:58:47 -04:00
|
|
|
};
|
2009-10-14 14:03:49 -04:00
|
|
|
|
2009-06-02 13:58:47 -04:00
|
|
|
CodeGenerator *CreateLLVMCodeGen(Diagnostic &Diags,
|
|
|
|
|
const std::string &ModuleName,
|
2009-11-18 09:59:57 -05:00
|
|
|
const CodeGenOptions &CGO,
|
2009-07-04 09:58:54 -04:00
|
|
|
llvm::LLVMContext& C);
|
2009-06-02 13:58:47 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|