summaryrefslogtreecommitdiffstats
path: root/llvm/examples
diff options
context:
space:
mode:
authorLang Hames <lhames@gmail.com>2015-02-17 05:36:59 +0000
committerLang Hames <lhames@gmail.com>2015-02-17 05:36:59 +0000
commit31ab495e4e1f21c801b40b3322bdf9415f0a362e (patch)
tree1c816bb24c54c5fbeb028d58e3e32d6a45a682a3 /llvm/examples
parent752d6df22ddb8c16d52989dee167d28ea00b798f (diff)
downloadbcm5719-llvm-31ab495e4e1f21c801b40b3322bdf9415f0a362e.tar.gz
bcm5719-llvm-31ab495e4e1f21c801b40b3322bdf9415f0a362e.zip
[Orc][Kaleidoscope] Update the MainLoop code of the orc/kaleidoscope tutorials
to get rid of the duplicate prompt. NFC. llvm-svn: 229465
Diffstat (limited to 'llvm/examples')
-rw-r--r--llvm/examples/Kaleidoscope/Orc/initial/toy.cpp8
-rw-r--r--llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp8
-rw-r--r--llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp8
3 files changed, 12 insertions, 12 deletions
diff --git a/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp b/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp
index c10f99bccc8..ae0d4ad33da 100644
--- a/llvm/examples/Kaleidoscope/Orc/initial/toy.cpp
+++ b/llvm/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/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp b/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
index a95da88e16e..168ebdd87ae 100644
--- a/llvm/examples/Kaleidoscope/Orc/lazy_codegen/toy.cpp
+++ b/llvm/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/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp b/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
index e3a0aa2369b..af02e939452 100644
--- a/llvm/examples/Kaleidoscope/Orc/lazy_irgen/toy.cpp
+++ b/llvm/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
}
}
OpenPOWER on IntegriCloud