[llvm] r359613 - [ORC][JITLink] Name in-memory compiled objects after their source modules.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 30 14:27:56 PDT 2019


Author: lhames
Date: Tue Apr 30 14:27:56 2019
New Revision: 359613

URL: http://llvm.org/viewvc/llvm-project?rev=359613&view=rev
Log:
[ORC][JITLink] Name in-memory compiled objects after their source modules.

In-memory compiled object buffer identifiers will now be derived from the
identifiers of their source IR modules. This makes it easier to connect
in-memory objects with their source modules in debugging output.

Modified:
    llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h
    llvm/trunk/lib/ExecutionEngine/JITLink/MachO.cpp

Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h?rev=359613&r1=359612&r2=359613&view=diff
==============================================================================
--- llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h (original)
+++ llvm/trunk/include/llvm/ExecutionEngine/Orc/CompileUtils.h Tue Apr 30 14:27:56 2019
@@ -67,8 +67,9 @@ public:
       PM.run(M);
     }
 
-    auto ObjBuffer =
-        llvm::make_unique<SmallVectorMemoryBuffer>(std::move(ObjBufferSV));
+    auto ObjBuffer = llvm::make_unique<SmallVectorMemoryBuffer>(
+        std::move(ObjBufferSV),
+        "<in memory object compiled from " + M.getModuleIdentifier() + ">");
     auto Obj =
         object::ObjectFile::createObjectFile(ObjBuffer->getMemBufferRef());
 

Modified: llvm/trunk/lib/ExecutionEngine/JITLink/MachO.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/ExecutionEngine/JITLink/MachO.cpp?rev=359613&r1=359612&r2=359613&view=diff
==============================================================================
--- llvm/trunk/lib/ExecutionEngine/JITLink/MachO.cpp (original)
+++ llvm/trunk/lib/ExecutionEngine/JITLink/MachO.cpp Tue Apr 30 14:27:56 2019
@@ -41,7 +41,8 @@ void jitLink_MachO(std::unique_ptr<JITLi
   memcpy(&Magic, Data.data(), sizeof(uint32_t));
   LLVM_DEBUG({
     dbgs() << "jitLink_MachO: magic = " << format("0x%08" PRIx32, Magic)
-           << "\n";
+           << ", identifier = \""
+           << Ctx->getObjectBuffer().getBufferIdentifier() << "\"\n";
   });
 
   if (Magic == MachO::MH_MAGIC || Magic == MachO::MH_CIGAM) {




More information about the llvm-commits mailing list