Create a TargetMachine whenever we create a CodeGenAction. The codegen of

some builtins will rely on target knowledge.

llvm-svn: 97693
This commit is contained in:
John McCall
2010-03-04 00:23:29 +00:00
parent e14c4087a3
commit 6abe39c61e
5 changed files with 94 additions and 62 deletions

View File

@@ -40,11 +40,12 @@ using namespace CodeGen;
CodeGenModule::CodeGenModule(ASTContext &C, const CodeGenOptions &CGO,
llvm::Module &M, const llvm::TargetData &TD,
Diagnostic &diags)
llvm::Module &M, const llvm::TargetMachine &TM,
const llvm::TargetData &TD, Diagnostic &diags)
: BlockModule(C, M, TD, Types, *this), Context(C),
Features(C.getLangOptions()), CodeGenOpts(CGO), TheModule(M),
TheTargetData(TD), TheTargetCodeGenInfo(0), Diags(diags),
TheTargetMachine(TM), TheTargetData(TD), TheTargetCodeGenInfo(0),
Diags(diags),
Types(C, M, TD, getTargetCodeGenInfo().getABIInfo()),
MangleCtx(C), VtableInfo(*this), Runtime(0),
MemCpyFn(0), MemMoveFn(0), MemSetFn(0), CFConstantStringClassRef(0),