[llvm] r229465 - [Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorials

Lang Hames lhames at gmail.com
Mon Feb 16 21:37:00 PST 2015


Author: lhames
Date: Mon Feb 16 23:36:59 2015
New Revision: 229465

URL: http://llvm.org/viewvc/llvm-project?rev=229465&view=rev
Log:
[Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorials
to get rid of the duplicate prompt. NFC.


Modified:
    llvm/trunk/examples/Kaleidoscope/Orc/initial/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
    llvm/trunk/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp

Modified: llvm/trunk/examples/Kaleidoscope/Orc/initial/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Orc/initial/toy.cpp?rev=229465&r1=229464&r2=229465&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Orc/initial/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Orc/initial/toy.cpp Mon Feb 16 23:36:59 2015
@@ -1254,16 +1254,16 @@ static void MainLoop() {
   SessionContext S(getGlobalContext());
 
   while (1) {
-#ifndef MINIMAL_STDERR_OUTPUT
-    std::cerr << "ready> ";
-#endif
     switch (CurTok) {
     case tok_eof:    return;
-    case ';':        getNextToken(); break;  // ignore top-level semicolons.
+    case ';':        getNextToken(); continue;  // ignore top-level semicolons.
     case tok_def:    HandleDefinition(S, J); break;
     case tok_extern: HandleExtern(S); break;
     default:         HandleTopLevelExpression(S, J); break;
     }
+#ifndef MINIMAL_STDERR_OUTPUT
+    std::cerr << "ready> ";
+#endif
   }
 }
 

Modified: llvm/trunk/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp?rev=229465&r1=229464&r2=229465&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp Mon Feb 16 23:36:59 2015
@@ -1256,16 +1256,16 @@ static void MainLoop() {
   SessionContext S(getGlobalContext());
 
   while (1) {
-#ifndef MINIMAL_STDERR_OUTPUT
-    std::cerr << "ready> ";
-#endif
     switch (CurTok) {
     case tok_eof:    return;
-    case ';':        getNextToken(); break;  // ignore top-level semicolons.
+    case ';':        getNextToken(); continue;  // ignore top-level semicolons.
     case tok_def:    HandleDefinition(S, J); break;
     case tok_extern: HandleExtern(S); break;
     default:         HandleTopLevelExpression(S, J); break;
     }
+#ifndef MINIMAL_STDERR_OUTPUT
+    std::cerr << "ready> ";
+#endif
   }
 }
 

Modified: llvm/trunk/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp?rev=229465&r1=229464&r2=229465&view=diff
==============================================================================
--- llvm/trunk/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp (original)
+++ llvm/trunk/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp Mon Feb 16 23:36:59 2015
@@ -1279,16 +1279,16 @@ static void MainLoop() {
   KaleidoscopeJIT J(S);
 
   while (1) {
-#ifndef MINIMAL_STDERR_OUTPUT
-    std::cerr << "ready> ";
-#endif
     switch (CurTok) {
     case tok_eof:    return;
-    case ';':        getNextToken(); break;  // ignore top-level semicolons.
+    case ';':        getNextToken(); continue;  // ignore top-level semicolons.
     case tok_def:    HandleDefinition(S, J); break;
     case tok_extern: HandleExtern(S); break;
     default:         HandleTopLevelExpression(S, J); break;
     }
+#ifndef MINIMAL_STDERR_OUTPUT
+    std::cerr << "ready> ";
+#endif
   }
 }
 





More information about the llvm-commits mailing list