TomBebbington / llvm-rs

LLVM wrappers for Rust
BSD 3-Clause "New" or "Revised" License
68 stars 27 forks source link

builder::build_neg only works for integer inputs #3

Open pnkfelix opened 9 years ago

pnkfelix commented 9 years ago

Just a heads up: The API of builder.rs might lead one to think that all the build methods for arithmetic will automatically dispatch to floating point or integer versions of the requested operations based on the input Value types

But the build_neg method does not dispatch to LLVMBuildFNeg when given a floating point value.

(This is easy for client to work around, e.g. by using builder.build_sub(0.0, arg); but it left me scratching my head for quite a while when my code was not passing the LLVM function validator.)

TomBebbington commented 9 years ago

Oh, sorry about that. If there isn't a PR by tomorrow I'll make one, then merge it.