[llvm-dev] Kaleidoscope code example error

David Blaikie via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 2 13:09:32 PDT 2021


Perhaps you're trying to run that fib example in noe of the early
chapters (like chapter 1) - it's only going to work once you're a few
chapters in - I think at least around chapter 5, which provides
control flow ('if'/'else').

On Fri, Apr 2, 2021 at 5:45 AM Sudakshina Dutta via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
>
> Dear all,
>
> Good day to you. I was trying to subject some sample input code to Kaleidoscope code (given in https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/index.html). However, as I subject the following code segment (given in https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl01.html) to the kaleidoscope executable
>
> # Compute the x'th fibonacci number.
> def fib(x)
>   if x < 3 then
>     1
>   else
>     fib(x-1)+fib(x-2)
>
> # This expression will compute the 40th number.
> fib(40)
>
> the following errors are shown.
>
> ready> ready> Error: Unknown variable name
> ready> Error: Unknown variable name
> ready> Error: Unknown variable name
> ready> Read top-level expression:
> define double @__anon_expr() {
> entry:
>   ret double 1.000000e+00
> }
>
> ready> Error: Unknown variable name
> ready> Error: Unknown function referenced
> Error: Unknown function referenced
> ready> ; ModuleID = 'my cool jit'
> source_filename = "my cool jit"
>
> Can somebody kindly help ?
>
> Thanks a lot.
>
> Sudakshina
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev


More information about the llvm-dev mailing list