]> granicus.if.org Git - llvm/commitdiff
[Orc] Update the BuildingAJIT Chapter 5 server class for the recent RPC changes.
authorLang Hames <lhames@gmail.com>
Fri, 11 Nov 2016 21:55:25 +0000 (21:55 +0000)
committerLang Hames <lhames@gmail.com>
Fri, 11 Nov 2016 21:55:25 +0000 (21:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@286642 91177308-0d34-0410-b5e6-96231b3b80d8

examples/Kaleidoscope/BuildingAJIT/Chapter5/Server/server.cpp

index c53e22fe83ae2292d0026ecd21edd188bc62aff2..da6e8ac65234840b01f84e4cc5a6e3888879f291 100644 (file)
@@ -102,18 +102,8 @@ int main(int argc, char* argv[]) {
 
   MyServerT Server(TCPChannel, SymbolLookup, RegisterEHFrames, DeregisterEHFrames);
 
-  while (1) {
-    MyServerT::JITFuncId Id = MyServerT::InvalidId;
-    ExitOnErr(Server.startReceivingFunction(TCPChannel, (uint32_t&)Id));
-    switch (Id) {
-    case MyServerT::TerminateSessionId:
-      ExitOnErr(Server.handleTerminateSession());
-      return 0;
-    default:
-      ExitOnErr(Server.handleKnownFunction(Id));
-      break;
-    }
-  }
+  while (!Server.receivedTerminate())
+    ExitOnErr(Server.handleOne());
 
-  llvm_unreachable("Fell through server command loop.");
+  return 0;
 }