From: Lang Hames Date: Mon, 19 Oct 2020 07:25:15 +0000 (-0700) Subject: [examples] Fix Kaleidoscope-Ch3, which was broken by ad92f16ccc5. X-Git-Tag: llvmorg-13-init~8943 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7579941d8b02af995e152a453da9b9cc0cc205e7;p=platform%2Fupstream%2Fllvm.git [examples] Fix Kaleidoscope-Ch3, which was broken by ad92f16ccc5. --- diff --git a/llvm/examples/Kaleidoscope/Chapter3/toy.cpp b/llvm/examples/Kaleidoscope/Chapter3/toy.cpp index 61adfbc..0356300 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.