iron-kaleidoscope icon indicating copy to clipboard operation
iron-kaleidoscope copied to clipboard

LLVM ERROR when using defined function more than once.

Open cbrewster opened this issue 9 years ago • 0 comments

When I define a function and try to use it multiple times, LLVM has an error and the program crashes.

Example:

> def double(x) x * 2

define double @double(double %x) {
entry:
  %multmp = fmul double %x, 2.000000e+00
  ret double %multmp
}

> double(4)
=> 8
> double(5)
LLVM ERROR: Program used external function '_double' which could not be resolved!

This appears to be an issue in my own codebase and the code found in the chapters in this repository, I am using code from chapter 5.

cbrewster avatar Feb 12 '16 01:02 cbrewster