]> granicus.if.org Git - llvm/commitdiff
[ORC][JITLink] Name in-memory compiled objects after their source modules.
authorLang Hames <lhames@gmail.com>
Tue, 30 Apr 2019 21:27:56 +0000 (21:27 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 30 Apr 2019 21:27:56 +0000 (21:27 +0000)
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@359613 91177308-0d34-0410-b5e6-96231b3b80d8

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

index 15a656678135d0cdd05e6064a7dd8c2a13ee8f5f..28a825b39c7a153dc792dd2e2f32f51a41f88203 100644 (file)
@@ -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());
 
index 8755eeccebb9a35f11e4f0d09b4b9567fa974f8b..15995b8ce98fc3e242a0fe321717551ac4016b3c 100644 (file)
@@ -41,7 +41,8 @@ void jitLink_MachO(std::unique_ptr<JITLinkContext> Ctx) {
   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) {