about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorJan-Erik Rediger <janerik@fnordig.de>2016-07-24 22:31:16 +0200
committerJan-Erik Rediger <janerik@fnordig.de>2016-07-29 10:29:44 +0200
commit2c16e24643976523e6858fd41a1ded0429a96ef1 (patch)
treee588f386e05215903493156ee918951f31dcf211 /src/rustllvm/RustWrapper.cpp
parent079db4f9715ab5c495115b11adcca5f5bd4ed260 (diff)
downloadrust-2c16e24643976523e6858fd41a1ded0429a96ef1.tar.gz
rust-2c16e24643976523e6858fd41a1ded0429a96ef1.zip
Use C type when passing value to LLVM pass
Previously the C type LLVMRelocMode (available as RelocMode in Rust)
was passed as is to the function.
However createTargetMachine expects a Reloc::Model, which is an enum
just one value short.
Additionally, the function was marked as requiring Reloc::Model in the
C code, but RelocMode on the Rust-side.

We now use the correct C type LLVMRelocMode and convert it to an
Optional<Reloc::Model> as expected by the createTargetMachine call the
same the original LLVMCreateTargetMachine function does.
See
https://github.com/llvm-mirror/llvm/blob/c9b262bfbd5b9fb6f10749dba1465569f39bd625/lib/Target/TargetMachineC.cpp#L104-L121

This was found by @eddyb.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions