[llvm-bugs] [Bug 52381] New: Kaleidoscope-Ch4 is not working as expected and is missing documentation

via llvm-bugs llvm-bugs at lists.llvm.org
Tue Nov 2 10:29:55 PDT 2021


https://bugs.llvm.org/show_bug.cgi?id=52381

            Bug ID: 52381
           Summary: Kaleidoscope-Ch4 is not working as expected and is
                    missing documentation
           Product: Documentation
           Version: trunk
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: General docs
          Assignee: unassignedbugs at nondot.org
          Reporter: yarl-baudig at mailoo.org
                CC: llvm-bugs at lists.llvm.org

First, according to the tutorial, we should be able to do
    ready> def foo(x) x + 1;
    ready> foo(2);
    Evaluated to 3.000000

    ready> def foo(x) x + 2;
    ready> foo(2);
    Evaluated to 4.000000

but if I try this (I compiled llvm with examples):
    sh-5.1$ ./Kaleidoscope-Ch4
    ready> def foo(x) x + 1;
    ready> Read function definition:define double @foo(double %x) {
    entry:
      %addtmp = fadd double %x, 1.000000e+00
      ret double %addtmp
    }

    ready> def foo(x) x + 2;
    ready> Read function definition:define double @foo(double %x) {
    entry:
      %addtmp = fadd double %x, 2.000000e+00
      ret double %addtmp
    }

    Duplicate definition of symbol 'foo'
    sh-5.1$

Second, this line
https://github.com/llvm/llvm-project/blob/052a2913f5ced0d266e946f1e697815df1d1fcc0/llvm/examples/Kaleidoscope/Chapter4/toy.cpp#L612
in the full code listing is not present on its corresponding snippet and thus,
not explained.

Thank you!

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20211102/67e203f5/attachment.html>


More information about the llvm-bugs mailing list