Update for LLVMContext+Module change.

llvm-svn: 74615
This commit is contained in:
Owen Anderson
2009-07-01 17:00:06 +00:00
parent 6773d388aa
commit d9dd77ff6c
5 changed files with 26 additions and 14 deletions

View File

@@ -19,6 +19,7 @@
#include "clang/AST/Expr.h"
#include "clang/Basic/Diagnostic.h"
#include "clang/Basic/TargetInfo.h"
#include "llvm/LLVMContext.h"
#include "llvm/Module.h"
#include "llvm/Target/TargetData.h"
#include "llvm/Support/Compiler.h"
@@ -37,8 +38,8 @@ namespace {
llvm::OwningPtr<CodeGen::CodeGenModule> Builder;
public:
CodeGeneratorImpl(Diagnostic &diags, const std::string& ModuleName,
const CompileOptions &CO)
: Diags(diags), CompileOpts(CO), M(new llvm::Module(ModuleName)) {}
const CompileOptions &CO, llvm::LLVMContext* C)
: Diags(diags), CompileOpts(CO), M(new llvm::Module(ModuleName, C)) {}
virtual ~CodeGeneratorImpl() {}
@@ -95,6 +96,7 @@ namespace {
CodeGenerator *clang::CreateLLVMCodeGen(Diagnostic &Diags,
const std::string& ModuleName,
const CompileOptions &CO) {
return new CodeGeneratorImpl(Diags, ModuleName, CO);
const CompileOptions &CO,
llvm::LLVMContext* C) {
return new CodeGeneratorImpl(Diags, ModuleName, CO, C);
}