llvm
llvm copied to clipboard
Duplicate declarations
The easiest way to describe the bug is to link to a stackoverflow posting I made regarding the bug.
http://stackoverflow.com/questions/16181742/haskell-llvm-duplicate-functions-created
The problem is that inside a monad the call newNamedFunction "putchar" is called twice. This results in two declarations in the IR file "putchar" and "putchar1"
This does not have the desired effect. Perhaps, as suggested, this should be an error.
This is a deliberate feature of the upstream LLVM API, intended to ensure that API users don't need to worry about name mangling. I'm not convinced that it's appropriate to deviate from that in the binding.