]> granicus.if.org Git - llvm/commitdiff
[Orc] Rename ObjectLinkingLayer -> RTDyldObjectLinkingLayer.
authorLang Hames <lhames@gmail.com>
Mon, 20 Feb 2017 05:45:14 +0000 (05:45 +0000)
committerLang Hames <lhames@gmail.com>
Mon, 20 Feb 2017 05:45:14 +0000 (05:45 +0000)
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

include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h [moved from include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h with 96% similarity]
lib/ExecutionEngine/Orc/OrcCBindingsStack.h
lib/ExecutionEngine/Orc/OrcMCJITReplacement.h
tools/lli/OrcLazyJIT.h
unittests/ExecutionEngine/Orc/CMakeLists.txt
unittests/ExecutionEngine/Orc/ObjectTransformLayerTest.cpp
unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp [moved from unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp with 92% similarity]

similarity index 96%
rename from include/llvm/ExecutionEngine/Orc/ObjectLinkingLayer.h
rename to include/llvm/ExecutionEngine/Orc/RTDyldObjectLinkingLayer.h
index 0588d2228598143cce18eab7c7bd4a56e3ce681a..babcc7f26aab5e4268b0b5cac4b5da8c58ddb080 100644 (file)
@@ -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 <typename ObjSetT, typename LoadResult>
-  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 <typename NotifyLoadedFtor = DoNothingOnNotifyLoaded>
-class ObjectLinkingLayer : public ObjectLinkingLayerBase {
+class RTDyldObjectLinkingLayer : public RTDyldObjectLinkingLayerBase {
 public:
   /// @brief Functor for receiving finalization notifications.
   typedef std::function<void(ObjSetHandleT)> 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
index a74fae775ac4f72d379d501a3d0722021862446e..a79dd844bf4f7f85d57ac683b866a1fc41aff38d 100644 (file)
@@ -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<ObjLayerT> CompileLayerT;
   typedef orc::CompileOnDemandLayer<CompileLayerT, CompileCallbackMgr>
       CODLayerT;
index af70960a1f9273a21dc44df599eccc54188308bc..a5100a56bcf1cb0bd3f7990d0b4831bc939eebe1 100644 (file)
@@ -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 <typename ObjListT>
-    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<NotifyObjectLoadedT> ObjectLayerT;
+  typedef RTDyldObjectLinkingLayer<NotifyObjectLoadedT> ObjectLayerT;
   typedef IRCompileLayer<ObjectLayerT> CompileLayerT;
   typedef LazyEmittingLayer<CompileLayerT> LazyEmitLayerT;
 
index 05319c345484feaec63b85e85dc386806afa40a2..56e7d36d05fb47e9a33bef869f53fe7f87f85058 100644 (file)
@@ -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<ObjLayerT> CompileLayerT;
   typedef std::function<std::unique_ptr<Module>(std::unique_ptr<Module>)>
     TransformFtor;
index 80c344e040a935e71dea834cbbe34cb0807fc2e8..009210fb442ad31834a6d1216fd93cc76d0c5808 100644 (file)
@@ -14,7 +14,7 @@ add_llvm_unittest(OrcJITTests
   IndirectionUtilsTest.cpp
   GlobalMappingLayerTest.cpp
   LazyEmittingLayerTest.cpp
-  ObjectLinkingLayerTest.cpp
+  RTDyldObjectLinkingLayerTest.cpp
   ObjectTransformLayerTest.cpp
   OrcCAPITest.cpp
   OrcTestCommon.cpp
index 63b85dc82ca84afed076514c41b8b1dd51d78c63..96214a368dce0ddf8b2068ee6f9517680e0f8d91 100644 (file)
@@ -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<llvm::object::OwningBinary<llvm::object::ObjectFile>>
           Obj) { return Obj; };
similarity index 92%
rename from unittests/ExecutionEngine/Orc/ObjectLinkingLayerTest.cpp
rename to unittests/ExecutionEngine/Orc/RTDyldObjectLinkingLayerTest.cpp
index 44b44f6041590d0e349c5b113d0fb776a7aa0324..f4cec0cc9309e502e24afe475a625f65fcbcedf0 100644 (file)
@@ -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<Module>("", 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: