From b8254a56a962b99def2bb45a487417cc6c99b8a8 Mon Sep 17 00:00:00 2001 From: Lang Hames Date: Tue, 17 Feb 2015 05:36:59 +0000 Subject: [PATCH] [Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorials to get rid of the duplicate prompt. NFC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229465 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/Kaleidoscope/Orc/initial/toy.cpp | 8 ++++---- examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp | 8 ++++---- examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/examples/Kaleidoscope/Orc/initial/toy.cpp b/examples/Kaleidoscope/Orc/initial/toy.cpp index c10f99bccc8..ae0d4ad33da 100644 --- a/examples/Kaleidoscope/Orc/initial/toy.cpp +++ b/examples/Kaleidoscope/Orc/initial/toy.cpp @@ -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 } } diff --git a/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp b/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp index a95da88e16e..168ebdd87ae 100644 --- a/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp +++ b/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp @@ -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 } } diff --git a/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp b/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp index e3a0aa2369b..af02e939452 100644 --- a/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp +++ b/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp @@ -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 } } -- 2.34.1