if (!TM)
TM.reset(CreateTargetMachine(UsesCodeGen));
- if (UsesCodeGen && !TM) return;
+ if (UsesCodeGen && !TM)
+ return;
+ if (TM)
+ TheModule->setDataLayout(*TM->getDataLayout());
CreatePasses();
switch (Action) {
// Now apply backend mangling.
std::unique_ptr<llvm::DataLayout> DL(
new llvm::DataLayout(Ctx.getTargetInfo().getTargetDescription()));
- llvm::Mangler BackendMangler(DL.get());
std::string FinalBuf;
llvm::raw_string_ostream FinalBufOS(FinalBuf);
- BackendMangler.getNameWithPrefix(FinalBufOS,
- llvm::Twine(FrontendBufOS.str()));
+ llvm::Mangler::getNameWithPrefix(FinalBufOS, llvm::Twine(FrontendBufOS.str()),
+ *DL);
return cxstring::createDup(FinalBufOS.str());
}