[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

llvm-svn: 302369
This commit is contained in:
Peter Szecsi 2017-05-07 11:00:01 +00:00
parent df8c2ebe73
commit 5305d3933a
6 changed files with 6 additions and 6 deletions

View File

@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();
if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

View File

@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();
if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

View File

@ -1092,7 +1092,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();
if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

View File

@ -932,7 +932,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();
if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

View File

@ -1099,7 +1099,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();
if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}

View File

@ -1097,7 +1097,7 @@ Function *FunctionAST::codegen() {
TheFunction->eraseFromParent();
if (P.isBinaryOp())
BinopPrecedence.erase(Proto->getOperatorName());
BinopPrecedence.erase(P.getOperatorName());
return nullptr;
}