Update for LLVM api change.

llvm-svn: 240406
This commit is contained in:
Rafael Espindola 2015-06-23 13:59:36 +00:00
parent c233f74e6e
commit b633d20d36
2 changed files with 6 additions and 4 deletions

View File

@ -604,7 +604,10 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
if (!TM)
TM.reset(CreateTargetMachine(UsesCodeGen));
if (UsesCodeGen && !TM) return;
if (UsesCodeGen && !TM)
return;
if (TM)
TheModule->setDataLayout(*TM->getDataLayout());
CreatePasses();
switch (Action) {

View File

@ -3827,12 +3827,11 @@ CXString clang_Cursor_getMangling(CXCursor C) {
// 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());
}