diff options
author | Lang Hames <lhames@gmail.com> | 2015-08-19 18:32:58 +0000 |
---|---|---|
committer | Lang Hames <lhames@gmail.com> | 2015-08-19 18:32:58 +0000 |
commit | 596aec96aca7e8b3b88168c07f4d8fb029e68a17 (patch) | |
tree | 498bdea19633604b86093c33e07e70189b79fb4a /llvm/docs/tutorial | |
parent | cb23639d392011704611721c0e5ec7a1c7af38c3 (diff) | |
download | bcm5719-llvm-596aec96aca7e8b3b88168c07f4d8fb029e68a17.tar.gz bcm5719-llvm-596aec96aca7e8b3b88168c07f4d8fb029e68a17.zip |
[Kaleidoscope] More inter-chapter diff reduction.
llvm-svn: 245474
Diffstat (limited to 'llvm/docs/tutorial')
-rw-r--r-- | llvm/docs/tutorial/LangImpl3.rst | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/docs/tutorial/LangImpl3.rst b/llvm/docs/tutorial/LangImpl3.rst index a2d23e7bcf9..d80140ef241 100644 --- a/llvm/docs/tutorial/LangImpl3.rst +++ b/llvm/docs/tutorial/LangImpl3.rst @@ -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 |