]> granicus.if.org Git - llvm/commitdiff
[Kaleidoscope] toy.cpp use after move fix
authorPeter Szecsi <szepet95@gmail.com>
Sun, 7 May 2017 11:00:01 +0000 (11:00 +0000)
committerPeter Szecsi <szepet95@gmail.com>
Sun, 7 May 2017 11:00:01 +0000 (11:00 +0000)
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
examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp
examples/Kaleidoscope/Chapter6/toy.cpp
examples/Kaleidoscope/Chapter7/toy.cpp
examples/Kaleidoscope/Chapter8/toy.cpp

index 945b9706d4d73f2b72d29ca968bfd3071eefe750..163caa6872d7b91b01d7101390211e5d235076a4 100644 (file)
@@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
   TheFunction->eraseFromParent();
 
   if (P.isBinaryOp())
-    BinopPrecedence.erase(Proto->getOperatorName());
+    BinopPrecedence.erase(P.getOperatorName());
   return nullptr;
 }
 
index 945b9706d4d73f2b72d29ca968bfd3071eefe750..163caa6872d7b91b01d7101390211e5d235076a4 100644 (file)
@@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
   TheFunction->eraseFromParent();
 
   if (P.isBinaryOp())
-    BinopPrecedence.erase(Proto->getOperatorName());
+    BinopPrecedence.erase(P.getOperatorName());
   return nullptr;
 }
 
index 945b9706d4d73f2b72d29ca968bfd3071eefe750..163caa6872d7b91b01d7101390211e5d235076a4 100644 (file)
@@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
   TheFunction->eraseFromParent();
 
   if (P.isBinaryOp())
-    BinopPrecedence.erase(Proto->getOperatorName());
+    BinopPrecedence.erase(P.getOperatorName());
   return nullptr;
 }
 
index 1e0ddca29b61f197555e25b971fd6d4ee4f80af0..0c2221735589cc232c3573f699eb4012edfb8c7b 100644 (file)
@@ -932,7 +932,7 @@ Function *FunctionAST::codegen() {
   TheFunction->eraseFromParent();
 
   if (P.isBinaryOp())
-    BinopPrecedence.erase(Proto->getOperatorName());
+    BinopPrecedence.erase(P.getOperatorName());
   return nullptr;
 }
 
index 2f8cb682a847141dfc6fa348a25af61107b71d17..79ac7b33d7a1628e1933e0ba6aad4966ad1116db 100644 (file)
@@ -1099,7 +1099,7 @@ Function *FunctionAST::codegen() {
   TheFunction->eraseFromParent();
 
   if (P.isBinaryOp())
-    BinopPrecedence.erase(Proto->getOperatorName());
+    BinopPrecedence.erase(P.getOperatorName());
   return nullptr;
 }
 
index cdf650973b86022fc65162ad053ca3345312ee1f..3ed98fcfdb5cd31b829315ebefad76bf1fc652ef 100644 (file)
@@ -1097,7 +1097,7 @@ Function *FunctionAST::codegen() {
   TheFunction->eraseFromParent();
 
   if (P.isBinaryOp())
-    BinopPrecedence.erase(Proto->getOperatorName());
+    BinopPrecedence.erase(P.getOperatorName());
   return nullptr;
 }