diff options
author | Lang Hames <lhames@gmail.com> | 2019-04-30 21:27:56 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2019-04-30 21:27:56 +0000 |
commit | 88816bdd2f1ad148f18dad77884073fb350680f3 (patch) | |
tree | bccccf6c4e64eeba7e93d0a56cc48210e7c6bf0d | |
parent | 998b97f6f1fef4082c3c8c4a5b9137753b93698f (diff) | |
download | bcm5719-llvm-88816bdd2f1ad148f18dad77884073fb350680f3.tar.gz bcm5719-llvm-88816bdd2f1ad148f18dad77884073fb350680f3.zip |
[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.
llvm-svn: 359613
-rw-r--r-- | llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h | 5 | ||||
-rw-r--r-- | llvm/lib/ExecutionEngine/JITLink/MachO.cpp | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h b/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h index 15a65667813..28a825b39c7 100644 --- a/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h +++ b/llvm/include/llvm/ExecutionEngine/Orc/CompileUtils.h @@ -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()); diff --git a/llvm/lib/ExecutionEngine/JITLink/MachO.cpp b/llvm/lib/ExecutionEngine/JITLink/MachO.cpp index 8755eeccebb..15995b8ce98 100644 --- a/llvm/lib/ExecutionEngine/JITLink/MachO.cpp +++ b/llvm/lib/ExecutionEngine/JITLink/MachO.cpp @@ -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) { |