[llvm] 7579941 - [examples] Fix Kaleidoscope-Ch3, which was broken by ad92f16ccc5.
Lang Hames via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 19 00:26:53 PDT 2020
Author: Lang Hames
Date: 2020-10-19T00:26:43-07:00
New Revision: 7579941d8b02af995e152a453da9b9cc0cc205e7
URL: https://github.com/llvm/llvm-project/commit/7579941d8b02af995e152a453da9b9cc0cc205e7
DIFF: https://github.com/llvm/llvm-project/commit/7579941d8b02af995e152a453da9b9cc0cc205e7.diff
LOG: [examples] Fix Kaleidoscope-Ch3, which was broken by ad92f16ccc5.
Added:
Modified:
llvm/examples/Kaleidoscope/Chapter3/toy.cpp
Removed:
################################################################################
diff --git a/llvm/examples/Kaleidoscope/Chapter3/toy.cpp b/llvm/examples/Kaleidoscope/Chapter3/toy.cpp
index 61adfbc6af3b..03563006685a 100644
--- a/llvm/examples/Kaleidoscope/Chapter3/toy.cpp
+++ b/llvm/examples/Kaleidoscope/Chapter3/toy.cpp
@@ -533,9 +533,6 @@ static void HandleDefinition() {
fprintf(stderr, "Read function definition:");
FnIR->print(errs());
fprintf(stderr, "\n");
-
- // Reset the module.
- InitializeModule();
}
} else {
// Skip token for error recovery.
@@ -564,8 +561,8 @@ static void HandleTopLevelExpression() {
FnIR->print(errs());
fprintf(stderr, "\n");
- // Reset the module.
- InitializeModule();
+ // Remove the anonymous expression.
+ FnIR->eraseFromParent();
}
} else {
// Skip token for error recovery.
More information about the llvm-commits
mailing list