From 2c224bcd52a7f0e561e2729d1085fd390e20e189 Mon Sep 17 00:00:00 2001 From: Peter Szecsi Date: Sun, 7 May 2017 11:00:01 +0000 Subject: [Kaleidoscope] toy.cpp use after move fix The variable Proto is moved at the beginning of the codegen() function. According to the comment above, the pointed object should be used due the reference P. Differential Revision: https://reviews.llvm.org/D32939 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@302369 91177308-0d34-0410-b5e6-96231b3b80d8 --- examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp | 2 +- examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp | 2 +- examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp | 2 +- examples/Kaleidoscope/Chapter6/toy.cpp | 2 +- examples/Kaleidoscope/Chapter7/toy.cpp | 2 +- examples/Kaleidoscope/Chapter8/toy.cpp | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp index 945b9706d4d..163caa6872d 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp index 945b9706d4d..163caa6872d 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } diff --git a/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp b/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp index 945b9706d4d..163caa6872d 100644 --- a/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp +++ b/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } diff --git a/examples/Kaleidoscope/Chapter6/toy.cpp b/examples/Kaleidoscope/Chapter6/toy.cpp index 1e0ddca29b6..0c222173558 100644 --- a/examples/Kaleidoscope/Chapter6/toy.cpp +++ b/examples/Kaleidoscope/Chapter6/toy.cpp @@ -932,7 +932,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } diff --git a/examples/Kaleidoscope/Chapter7/toy.cpp b/examples/Kaleidoscope/Chapter7/toy.cpp index 2f8cb682a84..79ac7b33d7a 100644 --- a/examples/Kaleidoscope/Chapter7/toy.cpp +++ b/examples/Kaleidoscope/Chapter7/toy.cpp @@ -1099,7 +1099,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } diff --git a/examples/Kaleidoscope/Chapter8/toy.cpp b/examples/Kaleidoscope/Chapter8/toy.cpp index cdf650973b8..3ed98fcfdb5 100644 --- a/examples/Kaleidoscope/Chapter8/toy.cpp +++ b/examples/Kaleidoscope/Chapter8/toy.cpp @@ -1097,7 +1097,7 @@ Function *FunctionAST::codegen() { TheFunction->eraseFromParent(); if (P.isBinaryOp()) - BinopPrecedence.erase(Proto->getOperatorName()); + BinopPrecedence.erase(P.getOperatorName()); return nullptr; } -- cgit v1.2.3