Skip to content

Commit d4a857b

Browse files
committed
Update for LLVM api change.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240406 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 83ba396 commit d4a857b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

lib/CodeGen/BackendUtil.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,10 @@ void EmitAssemblyHelper::EmitAssembly(BackendAction Action,
604604
if (!TM)
605605
TM.reset(CreateTargetMachine(UsesCodeGen));
606606

607-
if (UsesCodeGen && !TM) return;
607+
if (UsesCodeGen && !TM)
608+
return;
609+
if (TM)
610+
TheModule->setDataLayout(*TM->getDataLayout());
608611
CreatePasses();
609612

610613
switch (Action) {

tools/libclang/CIndex.cpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -3827,12 +3827,11 @@ CXString clang_Cursor_getMangling(CXCursor C) {
38273827
// Now apply backend mangling.
38283828
std::unique_ptr<llvm::DataLayout> DL(
38293829
new llvm::DataLayout(Ctx.getTargetInfo().getTargetDescription()));
3830-
llvm::Mangler BackendMangler(DL.get());
38313830

38323831
std::string FinalBuf;
38333832
llvm::raw_string_ostream FinalBufOS(FinalBuf);
3834-
BackendMangler.getNameWithPrefix(FinalBufOS,
3835-
llvm::Twine(FrontendBufOS.str()));
3833+
llvm::Mangler::getNameWithPrefix(FinalBufOS, llvm::Twine(FrontendBufOS.str()),
3834+
*DL);
38363835

38373836
return cxstring::createDup(FinalBufOS.str());
38383837
}

0 commit comments

Comments
 (0)