From: Lang Hames Date: Mon, 20 Feb 2017 05:45:14 +0000 (+0000) Subject: [Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67191c1ced59d7790d8423d3a06b986baf0b9256;p=llvm [Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer. The current ObjectLinkingLayer (now RTDyldObjectLinkingLayer) links objects in-process using MCJIT's RuntimeDyld class. In the near future I hope to add new object linking layers (e.g. a remote linking layer that links objects in the JIT target process, rather than the client), so I'm renaming this class to be more descriptive. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@295636 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h b/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h similarity index 96% rename from include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h rename to include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h index 0588d222859..babcc7f26aa 100644 --- a/include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h +++ b/include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h @@ -1,4 +1,4 @@ -//===- ObjectLinkingLayer.h - Add object files to a JIT process -*- C++ -*-===// +//===-- RTDyldObjectLinkingLayer.h - RTDyld-based jit linking --*- C++ -*-===// // // The LLVM Compiler Infrastructure // @@ -7,12 +7,12 @@ // //===----------------------------------------------------------------------===// // -// Contains the definition for the object layer of the JIT. +// Contains the definition for an RTDyld-based, in-process object linking layer. // //===----------------------------------------------------------------------===// -#ifndef LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H -#define LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H +#ifndef LLVM_EXECUTIONENGINE_ORC_RTDYLDOBJECTLINKINGLAYER_H +#define LLVM_EXECUTIONENGINE_ORC_RTDYLDOBJECTLINKINGLAYER_H #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/StringMap.h" @@ -35,7 +35,7 @@ namespace llvm { namespace orc { -class ObjectLinkingLayerBase { +class RTDyldObjectLinkingLayerBase { protected: /// @brief Holds a set of objects to be allocated/linked as a unit in the JIT. /// @@ -87,7 +87,7 @@ public: class DoNothingOnNotifyLoaded { public: template - void operator()(ObjectLinkingLayerBase::ObjSetHandleT, const ObjSetT &, + void operator()(RTDyldObjectLinkingLayerBase::ObjSetHandleT, const ObjSetT &, const LoadResult &) {} }; @@ -98,7 +98,7 @@ public: /// symbols queried. All objects added to this layer can see each other's /// symbols. template -class ObjectLinkingLayer : public ObjectLinkingLayerBase { +class RTDyldObjectLinkingLayer : public RTDyldObjectLinkingLayerBase { public: /// @brief Functor for receiving finalization notifications. typedef std::function NotifyFinalizedFtor; @@ -227,7 +227,7 @@ public: /// @brief Construct an ObjectLinkingLayer with the given NotifyLoaded, /// and NotifyFinalized functors. - ObjectLinkingLayer( + RTDyldObjectLinkingLayer( NotifyLoadedFtor NotifyLoaded = NotifyLoadedFtor(), NotifyFinalizedFtor NotifyFinalized = NotifyFinalizedFtor()) : NotifyLoaded(std::move(NotifyLoaded)), @@ -359,4 +359,4 @@ private: } // end namespace orc } // end namespace llvm -#endif // LLVM_EXECUTIONENGINE_ORC_OBJECTLINKINGLAYER_H +#endif // LLVM_EXECUTIONENGINE_ORC_RTDYLDOBJECTLINKINGLAYER_H diff --git a/lib/ExecutionEngine/Orc/OrcCBindingsStack.h b/lib/ExecutionEngine/Orc/OrcCBindingsStack.h index a74fae775ac..a79dd844bf4 100644 --- a/lib/ExecutionEngine/Orc/OrcCBindingsStack.h +++ b/lib/ExecutionEngine/Orc/OrcCBindingsStack.h @@ -16,7 +16,7 @@ #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" -#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" +#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h" #include "llvm/IR/LLVMContext.h" #include "llvm/Support/Error.h" @@ -30,7 +30,7 @@ DEFINE_SIMPLE_CONVERSION_FUNCTIONS(TargetMachine, LLVMTargetMachineRef) class OrcCBindingsStack { public: typedef orc::JITCompileCallbackManager CompileCallbackMgr; - typedef orc::ObjectLinkingLayer<> ObjLayerT; + typedef orc::RTDyldObjectLinkingLayer<> ObjLayerT; typedef orc::IRCompileLayer CompileLayerT; typedef orc::CompileOnDemandLayer CODLayerT; diff --git a/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h b/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h index af70960a1f9..a5100a56bcf 100644 --- a/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h +++ b/lib/ExecutionEngine/Orc/OrcMCJITReplacement.h @@ -24,7 +24,7 @@ #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" #include "llvm/ExecutionEngine/Orc/LazyEmittingLayer.h" -#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" +#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h" #include "llvm/IR/Function.h" #include "llvm/IR/Mangler.h" #include "llvm/Object/Archive.h" @@ -315,7 +315,7 @@ private: NotifyObjectLoadedT(OrcMCJITReplacement &M) : M(M) {} template - void operator()(ObjectLinkingLayerBase::ObjSetHandleT H, + void operator()(RTDyldObjectLinkingLayerBase::ObjSetHandleT H, const ObjListT &Objects, const LoadedObjInfoListT &Infos) const { M.UnfinalizedSections[H] = std::move(M.SectionsAllocatedSinceLastLoad); @@ -344,7 +344,7 @@ private: public: NotifyFinalizedT(OrcMCJITReplacement &M) : M(M) {} - void operator()(ObjectLinkingLayerBase::ObjSetHandleT H) { + void operator()(RTDyldObjectLinkingLayerBase::ObjSetHandleT H) { M.UnfinalizedSections.erase(H); } @@ -361,7 +361,7 @@ private: return MangledName; } - typedef ObjectLinkingLayer ObjectLayerT; + typedef RTDyldObjectLinkingLayer ObjectLayerT; typedef IRCompileLayer CompileLayerT; typedef LazyEmittingLayer LazyEmitLayerT; diff --git a/tools/lli/OrcLazyJIT.h b/tools/lli/OrcLazyJIT.h index 05319c34548..56e7d36d05f 100644 --- a/tools/lli/OrcLazyJIT.h +++ b/tools/lli/OrcLazyJIT.h @@ -21,7 +21,7 @@ #include "llvm/ExecutionEngine/Orc/ExecutionUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" #include "llvm/ExecutionEngine/Orc/IRTransformLayer.h" -#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" +#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h" #include "llvm/ExecutionEngine/RTDyldMemoryManager.h" namespace llvm { @@ -30,7 +30,7 @@ class OrcLazyJIT { public: typedef orc::JITCompileCallbackManager CompileCallbackMgr; - typedef orc::ObjectLinkingLayer<> ObjLayerT; + typedef orc::RTDyldObjectLinkingLayer<> ObjLayerT; typedef orc::IRCompileLayer CompileLayerT; typedef std::function(std::unique_ptr)> TransformFtor; diff --git a/unittests/ExecutionEngine/Orc/CMakeLists.txt b/unittests/ExecutionEngine/Orc/CMakeLists.txt index 80c344e040a..009210fb442 100644 --- a/unittests/ExecutionEngine/Orc/CMakeLists.txt +++ b/unittests/ExecutionEngine/Orc/CMakeLists.txt @@ -14,7 +14,7 @@ add_llvm_unittest(OrcJITTests IndirectionUtilsTest.cpp GlobalMappingLayerTest.cpp LazyEmittingLayerTest.cpp - ObjectLinkingLayerTest.cpp + RTDyldObjectLinkingLayerTest.cpp ObjectTransformLayerTest.cpp OrcCAPITest.cpp OrcTestCommon.cpp diff --git a/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp b/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp index 63b85dc82ca..96214a368dc 100644 --- a/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp @@ -12,7 +12,7 @@ #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/IRCompileLayer.h" #include "llvm/ExecutionEngine/Orc/NullResolver.h" -#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" +#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h" #include "llvm/ExecutionEngine/Orc/ObjectTransformLayer.h" #include "llvm/Object/ObjectFile.h" #include "gtest/gtest.h" @@ -309,7 +309,7 @@ TEST(ObjectTransformLayerTest, Main) { }; // Construct the jit layers. - ObjectLinkingLayer<> BaseLayer; + RTDyldObjectLinkingLayer<> BaseLayer; auto IdentityTransform = []( std::unique_ptr> Obj) { return Obj; }; diff --git a/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp b/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp similarity index 92% rename from unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp rename to unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp index 44b44f60415..f4cec0cc930 100644 --- a/unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp +++ b/unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp @@ -1,4 +1,4 @@ -//===-- ObjectLinkingLayerTest.cpp - Unit tests for object linking layer --===// +//===- RTDyldObjectLinkingLayerTest.cpp - RTDyld linking layer unit tests -===// // // The LLVM Compiler Infrastructure // @@ -13,7 +13,7 @@ #include "llvm/ExecutionEngine/Orc/CompileUtils.h" #include "llvm/ExecutionEngine/Orc/LambdaResolver.h" #include "llvm/ExecutionEngine/Orc/NullResolver.h" -#include "llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h" +#include "llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h" #include "llvm/IR/Constants.h" #include "llvm/IR/LLVMContext.h" #include "gtest/gtest.h" @@ -23,8 +23,8 @@ using namespace llvm::orc; namespace { -class ObjectLinkingLayerExecutionTest : public testing::Test, - public OrcExecutionTest { +class RTDyldObjectLinkingLayerExecutionTest : public testing::Test, + public OrcExecutionTest { }; @@ -44,7 +44,7 @@ public: } }; -TEST(ObjectLinkingLayerTest, TestSetProcessAllSections) { +TEST(RTDyldObjectLinkingLayerTest, TestSetProcessAllSections) { class SectionMemoryManagerWrapper : public SectionMemoryManager { public: SectionMemoryManagerWrapper(bool &DebugSeen) : DebugSeen(DebugSeen) {} @@ -63,7 +63,7 @@ TEST(ObjectLinkingLayerTest, TestSetProcessAllSections) { bool DebugSeen; }; - ObjectLinkingLayer<> ObjLayer; + RTDyldObjectLinkingLayer<> ObjLayer; LLVMContext Context; auto M = llvm::make_unique("", Context); @@ -114,11 +114,11 @@ TEST(ObjectLinkingLayerTest, TestSetProcessAllSections) { } } -TEST_F(ObjectLinkingLayerExecutionTest, NoDuplicateFinalization) { +TEST_F(RTDyldObjectLinkingLayerExecutionTest, NoDuplicateFinalization) { if (!TM) return; - ObjectLinkingLayer<> ObjLayer; + RTDyldObjectLinkingLayer<> ObjLayer; SimpleCompiler Compile(*TM); // Create a pair of modules that will trigger recursive finalization: @@ -183,11 +183,11 @@ TEST_F(ObjectLinkingLayerExecutionTest, NoDuplicateFinalization) { << "Extra call to finalize"; } -TEST_F(ObjectLinkingLayerExecutionTest, NoPrematureAllocation) { +TEST_F(RTDyldObjectLinkingLayerExecutionTest, NoPrematureAllocation) { if (!TM) return; - ObjectLinkingLayer<> ObjLayer; + RTDyldObjectLinkingLayer<> ObjLayer; SimpleCompiler Compile(*TM); // Create a pair of unrelated modules: