On 8/13/16, feza <[email protected]> wrote:
> Is there any difference between
>
> version1:
>
> let x
> x = 0
> end
>
>
> vs.
>
> version2:
>
> let
> local x = 0
> end
>
>
> vs
>
> version3:
> let x = 0
> end

As you noticed, the return values are different. `let` (like many
non-loop code blocks) returns the value of the last executed statement
and `nothing` if it's empty.

>
>
>
> version 1 and 2
>
> ; Function Attrs: uwtable
> define i64 @julia_t2_67462() #0 {
> top:
>   ret i64 0
> }
>
> version 3
>
> ; Function Attrs: uwtable
> define void @julia_t3_67453() #0 {
> top:
>   ret void
> }
>
>
>
> looking at @code_llvm it seems like    version1 and version2 are identical
> and version3 is almost identical except for the fact that it returns a
> void.
>
> Also is there  a good reference for understanding the output of code_llvm?
>

http://llvm.org/docs/LangRef.html no kidding.
It might not be a good way to learn how to write valid LLVM IR but you
should be able to find the meaning of every instructions in there.

Reply via email to