[Orc] Rename JITCompileCallbackManagerBase to JITCompileCallbackManager.
[oota-llvm.git] / unittests / ExecutionEngine / Orc / CompileOnDemandLayerTest.cpp
index bfed9bb..4a30cfc 100644 (file)
@@ -16,14 +16,14 @@ using namespace llvm::orc;
 
 namespace {
 
 
 namespace {
 
-class DummyCallbackManager : public orc::JITCompileCallbackManagerBase {
+class DummyCallbackManager : public orc::JITCompileCallbackManager {
 public:
   DummyCallbackManager()
 public:
   DummyCallbackManager()
-      : JITCompileCallbackManagerBase(0, 0), NextStubAddress(0),
+      : JITCompileCallbackManager(0), NextStubAddress(0),
         UniversalCompile([]() { return 0; }) {
   }
 
         UniversalCompile([]() { return 0; }) {
   }
 
-  CompileCallbackInfo getCompileCallback(LLVMContext &Context) override {
+  CompileCallbackInfo getCompileCallback() override {
     return CompileCallbackInfo(++NextStubAddress, UniversalCompile);
   }
 public:
     return CompileCallbackInfo(++NextStubAddress, UniversalCompile);
   }
 public:
@@ -33,6 +33,11 @@ public:
 
 class DummyStubsManager : public orc::IndirectStubsManagerBase {
 public:
 
 class DummyStubsManager : public orc::IndirectStubsManagerBase {
 public:
+  std::error_code createStub(StringRef StubName, TargetAddress InitAddr,
+                             JITSymbolFlags Flags) override {
+    llvm_unreachable("Not implemented");
+  }
+
   std::error_code createStubs(const StubInitsMap &StubInits) override {
     llvm_unreachable("Not implemented");
   }
   std::error_code createStubs(const StubInitsMap &StubInits) override {
     llvm_unreachable("Not implemented");
   }
@@ -64,15 +69,11 @@ TEST(CompileOnDemandLayerTest, FindSymbol) {
 
   typedef decltype(MockBaseLayer) MockBaseLayerT;
   DummyCallbackManager CallbackMgr;
 
   typedef decltype(MockBaseLayer) MockBaseLayerT;
   DummyCallbackManager CallbackMgr;
-  auto StubsMgrBuilder =
-    []() {
-      return llvm::make_unique<DummyStubsManager>();
-    };
-
-  llvm::orc::CompileOnDemandLayer<MockBaseLayerT>
-    COD(MockBaseLayer,
-        [](Function &F) { std::set<Function*> S; S.insert(&F); return S; },
-        CallbackMgr, StubsMgrBuilder, true);
+
+  llvm::orc::CompileOnDemandLayer<MockBaseLayerT> COD(
+      MockBaseLayer, [](Function &F) { return std::set<Function *>{&F}; },
+      CallbackMgr, [] { return llvm::make_unique<DummyStubsManager>(); }, true);
+
   auto Sym = COD.findSymbol("foo", true);
 
   EXPECT_TRUE(!!Sym)
   auto Sym = COD.findSymbol("foo", true);
 
   EXPECT_TRUE(!!Sym)