Issue 129698
Summary [LLVM] Kaleidoscope compilation fails for chapter 4
Labels new issue
Assignees
Reporter nots1dd
    Upon compiling Chapter 4 of Kaleidoscope this error pops up:

```bash
untoy.cpp:646:35: error: no member named 'toPtr' in 'llvm::orc::ExecutorSymbolDef'
  646 |       double (*FP)() = ExprSymbol.toPtr<double (*)()>();
      |                        ~~~~~~~~~~ ^
untoy.cpp:646:50: error: expected _expression_
  646 |       double (*FP)() = ExprSymbol.toPtr<double (*)()>();
      | ^
untoy.cpp:646:55: error: expected _expression_
  646 | double (*FP)() = ExprSymbol.toPtr<double (*)()>();
      | ^
3 errors generated.
```

The main issue lies in this code snippet:

```cpp
      // Search the JIT for the __anon_expr symbol.
      auto ExprSymbol = ExitOnErr(TheJIT->lookup("__anon_expr"));

      /* ExprSymbolDef does not have this method (API change)! */
      double (*FP)() = ExprSymbol.toPtr<double (*)()>();
      fprintf(stderr, "Evaluated to %f\n", FP());
```

The error persists in future chapters until Chapter 8 where the focus shifts on compiling to object code.

This seems to be the issue of the ORC's API being outdated and I already have a possible solution on how to fix this.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to