mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 15:39:06 +00:00
[Kaleidoscope] More inter-chapter diff reduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@245474 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4d554fb21d
commit
1356c7901a
@ -131,7 +131,9 @@ are all uniqued together and shared. For this reason, the API uses the
|
||||
Value *VariableExprAST::Codegen() {
|
||||
// Look this variable up in the function.
|
||||
Value *V = NamedValues[Name];
|
||||
return V ? V : ErrorV("Unknown variable name");
|
||||
if (!V)
|
||||
ErrorV("Unknown variable name");
|
||||
return V;
|
||||
}
|
||||
|
||||
References to variables are also quite simple using LLVM. In the simple
|
||||
|
@ -398,7 +398,9 @@ Value *NumberExprAST::Codegen() {
|
||||
Value *VariableExprAST::Codegen() {
|
||||
// Look this variable up in the function.
|
||||
Value *V = NamedValues[Name];
|
||||
return V ? V : ErrorV("Unknown variable name");
|
||||
if (!V)
|
||||
return ErrorV("Unknown variable name");
|
||||
return V;
|
||||
}
|
||||
|
||||
Value *BinaryExprAST::Codegen() {
|
||||
|
@ -642,7 +642,9 @@ Value *NumberExprAST::Codegen() {
|
||||
Value *VariableExprAST::Codegen() {
|
||||
// Look this variable up in the function.
|
||||
Value *V = NamedValues[Name];
|
||||
return V ? V : ErrorV("Unknown variable name");
|
||||
if (!V)
|
||||
return ErrorV("Unknown variable name");
|
||||
return V;
|
||||
}
|
||||
|
||||
Value *BinaryExprAST::Codegen() {
|
||||
|
@ -532,7 +532,9 @@ Value *NumberExprAST::Codegen() {
|
||||
Value *VariableExprAST::Codegen() {
|
||||
// Look this variable up in the function.
|
||||
Value *V = NamedValues[Name];
|
||||
return V ? V : ErrorV("Unknown variable name");
|
||||
if (!V)
|
||||
return ErrorV("Unknown variable name");
|
||||
return V;
|
||||
}
|
||||
|
||||
Value *BinaryExprAST::Codegen() {
|
||||
|
@ -626,7 +626,6 @@ Value *VariableExprAST::Codegen() {
|
||||
Value *V = NamedValues[Name];
|
||||
if (!V)
|
||||
return ErrorV("Unknown variable name");
|
||||
|
||||
return V;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user