[ORC] Errorize the ORC APIs.

This patch updates the ORC layers and utilities to return and propagate
llvm::Errors where appropriate. This is necessary to allow ORC to safely handle
error cases in cross-process and remote JITing.

llvm-svn: 307350
diff --git a/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp b/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp
index 1369338..844746f 100644
--- a/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp
+++ b/llvm/unittests/ExecutionEngine/Orc/CompileOnDemandLayerTest.cpp
@@ -50,13 +50,14 @@
 
 TEST(CompileOnDemandLayerTest, FindSymbol) {
   auto MockBaseLayer = createMockBaseLayer<int>(
-      DoNothingAndReturn<int>(0), DoNothingAndReturn<void>(),
+      DoNothingAndReturn<int>(0),
+      [](int Handle) { return Error::success(); },
       [](const std::string &Name, bool) {
         if (Name == "foo")
           return JITSymbol(1, JITSymbolFlags::Exported);
         return JITSymbol(nullptr);
       },
-      DoNothingAndReturn<JITSymbol>(nullptr));
+      ReturnNullJITSymbol());
 
   typedef decltype(MockBaseLayer) MockBaseLayerT;
   DummyCallbackManager CallbackMgr;