diff options
| author | Jan-Erik Rediger <janerik@fnordig.de> | 2016-07-24 22:31:16 +0200 |
|---|---|---|
| committer | Jan-Erik Rediger <janerik@fnordig.de> | 2016-07-29 10:29:44 +0200 |
| commit | 2c16e24643976523e6858fd41a1ded0429a96ef1 (patch) | |
| tree | e588f386e05215903493156ee918951f31dcf211 /src/rustllvm/RustWrapper.cpp | |
| parent | 079db4f9715ab5c495115b11adcca5f5bd4ed260 (diff) | |
| download | rust-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
