Skip to content

Commit

Permalink
[Kaleidoscope] toy.cpp use after move fix
Browse files Browse the repository at this point in the history
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

llvm-svn: 302369
  • Loading branch information
szepet committed May 7, 2017
1 parent df8c2eb commit 5305d39
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion llvm/examples/Kaleidoscope/BuildingAJIT/Chapter1/toy.cpp
Expand Up @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();

if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/Kaleidoscope/BuildingAJIT/Chapter2/toy.cpp
Expand Up @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();

if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/Kaleidoscope/BuildingAJIT/Chapter3/toy.cpp
Expand Up @@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();

if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/Kaleidoscope/Chapter6/toy.cpp
Expand Up @@ -932,7 +932,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();

if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/Kaleidoscope/Chapter7/toy.cpp
Expand Up @@ -1099,7 +1099,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();

if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion llvm/examples/Kaleidoscope/Chapter8/toy.cpp
Expand Up @@ -1097,7 +1097,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();

if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

Expand Down

0 comments on commit 5305d39

Please sign in to comment.