Kaleidoscope-Orc: Reuse the IRGen utility function in later chapters, and remove...
[oota-llvm.git] / examples / Kaleidoscope / Orc / initial / toy.cpp
index 1b772259a19ef8f384e644e0fa81f6d761b68d4c..f075af156c2bf2dc49eba03c9719b7bb85852554 100644 (file)
@@ -1180,8 +1180,8 @@ private:
   CompileLayerT CompileLayer;
 };
 
-static std::unique_ptr<llvm::Module>
-IRGen(KaleidoscopeJIT &J, SessionContext &S, const FunctionAST &F) {
+static std::unique_ptr<llvm::Module> IRGen(SessionContext &S,
+                                           const FunctionAST &F) {
   IRGenContext C(S);
   auto LF = F.IRGen(C);
   if (!LF)
@@ -1195,7 +1195,7 @@ IRGen(KaleidoscopeJIT &J, SessionContext &S, const FunctionAST &F) {
 
 static void HandleDefinition(SessionContext &S, KaleidoscopeJIT &J) {
   if (auto F = ParseDefinition()) {
-    if (auto M = IRGen(J, S, *F)) {
+    if (auto M = IRGen(S, *F)) {
       S.addPrototypeAST(llvm::make_unique<PrototypeAST>(*F->Proto));
       J.addModule(std::move(M));
     }