Take advantage of Triple and TargetData.

A lot of system specific knowledge is already present in LLVM. This is used to populate several fields in global.params instead of hard coded values in main(). Ensures that the frontend and LLVM have always the same values.
This commit is contained in:
kai
2012-09-16 19:50:21 +02:00
parent 98f9742db5
commit 940d6e907f
7 changed files with 84 additions and 94 deletions

View File

@@ -242,7 +242,7 @@ llvm::Module* Module::genLLVMModule(llvm::LLVMContext& context, Ir* sir)
sir->setState(&ir);
// set target triple
ir.module->setTargetTriple(global.params.targetTriple);
ir.module->setTargetTriple(global.params.targetTriple.str());
// set final data layout
ir.module->setDataLayout(gTargetData->getStringRepresentation());