r240406 - Update for LLVM api change.

Rafael Espindola rafael.espindola at gmail.com
Tue Jun 23 06:59:36 PDT 2015


Author: rafael
Date: Tue Jun 23 08:59:36 2015
New Revision: 240406

URL: http://llvm.org/viewvc/llvm-project?rev=240406&view=rev
Log:
Update for LLVM api change.

Modified:
    cfe/trunk/lib/CodeGen/BackendUtil.cpp
    cfe/trunk/tools/libclang/CIndex.cpp

Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=240406&r1=240405&r2=240406&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Tue Jun 23 08:59:36 2015
@@ -604,7 +604,10 @@ void EmitAssemblyHelper::EmitAssembly(Ba
   if (!TM)
     TM.reset(CreateTargetMachine(UsesCodeGen));
 
-  if (UsesCodeGen && !TM) return;
+  if (UsesCodeGen && !TM)
+    return;
+  if (TM)
+    TheModule->setDataLayout(*TM->getDataLayout());
   CreatePasses();
 
   switch (Action) {

Modified: cfe/trunk/tools/libclang/CIndex.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/libclang/CIndex.cpp?rev=240406&r1=240405&r2=240406&view=diff
==============================================================================
--- cfe/trunk/tools/libclang/CIndex.cpp (original)
+++ cfe/trunk/tools/libclang/CIndex.cpp Tue Jun 23 08:59:36 2015
@@ -3827,12 +3827,11 @@ CXString clang_Cursor_getMangling(CXCurs
   // 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());
 }





More information about the cfe-commits mailing list