diff options
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 |