mirror of
https://github.com/ldc-developers/ldc.git
synced 2025-05-06 02:45:25 +03:00
Attempt at getting LLVM to provide a proper target data layout. Should assert now if things are borked.
Added untested support for Thumb target.
This commit is contained in:
parent
29dfacde9a
commit
6b9e85df48
4 changed files with 28 additions and 9 deletions
|
@ -104,6 +104,7 @@ void Module::genobjfile(int multiobj, char** envp)
|
|||
// set target stuff
|
||||
|
||||
ir.module->setTargetTriple(global.params.targetTriple);
|
||||
ir.module->setDataLayout(global.params.dataLayout);
|
||||
|
||||
// get the target machine
|
||||
const llvm::TargetMachineRegistry::entry* MArch;
|
||||
|
@ -131,7 +132,13 @@ void Module::genobjfile(int multiobj, char** envp)
|
|||
llvm::TargetMachine &Target = *target.get();
|
||||
|
||||
gTargetData = Target.getTargetData();
|
||||
ir.module->setDataLayout(gTargetData->getStringRepresentation());
|
||||
|
||||
// set final data layout
|
||||
std::string datalayout = gTargetData->getStringRepresentation();
|
||||
ir.module->setDataLayout(datalayout);
|
||||
if (Logger::enabled())
|
||||
Logger::cout() << "Final data layout: " << datalayout << '\n';
|
||||
assert(memcmp(global.params.dataLayout, datalayout.c_str(), 9) == 0); // "E-p:xx:xx"
|
||||
|
||||
// debug info
|
||||
if (global.params.symdebug) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue