From 8be883e77fa0986455d40e2dbbcab9feffa9bfb1 Mon Sep 17 00:00:00 2001 From: Daniel Kolsoi Date: Wed, 11 Apr 2018 23:53:10 -0400 Subject: [PATCH 1/4] First pass at (incomplete) LLVM 3.8 support --- .travis.yml | 11 ++++++++ Cargo.toml | 3 ++- src/lib.rs | 14 +++++++--- src/types/enums.rs | 5 +++- src/values/instruction_value.rs | 48 ++++++++++++++++++++------------- src/values/metadata_value.rs | 2 ++ tests/test_builder.rs | 3 +++ tests/test_execution_engine.rs | 3 +++ 8 files changed, 66 insertions(+), 23 deletions(-) diff --git a/.travis.yml b/.travis.yml index 45df32b229718..2ac949504db70 100644 --- a/.travis.yml +++ b/.travis.yml @@ -55,6 +55,17 @@ matrix: packages: - *BASE_PACKAGES - llvm-3.7-dev + - env: + - LLVM_VERSION="3.8" + <<: *BASE + addons: + apt: + sources: + - *BASE_SOURCES + - llvm-toolchain-precise-3.8 + packages: + - *BASE_PACKAGES + - llvm-3.8-dev - deploy: # Documentation build; Only latest supported LLVM version for now provider: pages skip-cleanup: true diff --git a/Cargo.toml b/Cargo.toml index a976cda15aaef..351a80db9224a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,12 +14,13 @@ categories = ["development-tools::ffi"] default = [] llvm3-6 = [] llvm3-7 = [] +llvm3-8 = [] [dependencies] either = "1.4.0" enum-methods = "0.0.8" libc = "*" -llvm-sys = "37" +llvm-sys = "38" [[example]] name = "kaleidoscope" diff --git a/src/lib.rs b/src/lib.rs index 1c3e055315c07..030d35c77e016 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,18 +20,21 @@ pub mod types; pub mod values; use llvm_sys::{LLVMIntPredicate, LLVMRealPredicate, LLVMVisibility, LLVMThreadLocalMode, LLVMDLLStorageClass}; -use llvm_sys::core::LLVMResetFatalErrorHandler; use llvm_sys::support::LLVMLoadLibraryPermanently; use std::ffi::CString; -#[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + + +#[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7", feature = "llvm3-8")))] compile_error!("A LLVM feature flag must be provided. See the README for more details."); // TODO: Probably move into error handling module pub fn enable_llvm_pretty_stack_trace() { - // use llvm_sys::error_handling::LLVMEnablePrettyStackTrace; // v3.8 + #[cfg(any(feature = "llvm3-6", feature = "llvm3-7"))] use llvm_sys::core::LLVMEnablePrettyStackTrace; + #[cfg(feature = "llvm3-8")] + use llvm_sys::error_handling::LLVMEnablePrettyStackTrace; unsafe { LLVMEnablePrettyStackTrace() @@ -88,6 +91,11 @@ pub fn shutdown_llvm() { /// Resets LLVM's fatal error handler back to the default pub fn reset_fatal_error_handler() { + #[cfg(any(feature = "llvm3-6", feature = "llvm3-7"))] + use llvm_sys::core::LLVMResetFatalErrorHandler; + #[cfg(feature = "llvm3-8")] + use llvm_sys::error_handling::LLVMResetFatalErrorHandler; + unsafe { LLVMResetFatalErrorHandler() } diff --git a/src/types/enums.rs b/src/types/enums.rs index 18f6a8ab7c0dd..1d8687bad2a1a 100644 --- a/src/types/enums.rs +++ b/src/types/enums.rs @@ -61,7 +61,8 @@ impl AnyTypeEnum { LLVMTypeKind::LLVMVectorTypeKind => AnyTypeEnum::VectorType(VectorType::new(type_)), LLVMTypeKind::LLVMMetadataTypeKind => panic!("FIXME: Unsupported type: Metadata"), LLVMTypeKind::LLVMX86_MMXTypeKind => panic!("FIXME: Unsupported type: MMX"), - // LLVMTypeKind::LLVMTokenTypeKind => panic!("FIXME: Unsupported type: Token"), // Different version? + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMTypeKind::LLVMTokenTypeKind => panic!("FIXME: Unsupported type: Token"), } } } @@ -89,6 +90,8 @@ impl BasicTypeEnum { LLVMTypeKind::LLVMLabelTypeKind => unreachable!("Unsupported type: Label"), LLVMTypeKind::LLVMVoidTypeKind => unreachable!("Unsupported type: VoidType"), LLVMTypeKind::LLVMFunctionTypeKind => unreachable!("Unsupported type: FunctionType"), + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMTypeKind::LLVMTokenTypeKind => panic!("FIXME: Unsupported type: Token"), } } } diff --git a/src/values/instruction_value.rs b/src/values/instruction_value.rs index 9d2be6f6af14d..157a2d8ca6ebb 100644 --- a/src/values/instruction_value.rs +++ b/src/values/instruction_value.rs @@ -22,12 +22,16 @@ pub enum InstructionOpcode { BitCast, Br, Call, - // Later versions: - // CatchPad, - // CatchRet, - // CatchSwitch, - // CleanupPad, - // CleanupRet, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + CatchPad, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + CatchRet, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + CatchSwitch, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + CleanupPad, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + CleanupRet, ExtractElement, ExtractValue, FAdd, @@ -92,12 +96,16 @@ impl InstructionOpcode { LLVMOpcode::LLVMBitCast => InstructionOpcode::BitCast, LLVMOpcode::LLVMBr => InstructionOpcode::Br, LLVMOpcode::LLVMCall => InstructionOpcode::Call, - // Newer versions: - // LLVMOpcode::LLVMCatchPad => InstructionOpcode::CatchPad, - // LLVMOpcode::LLVMCatchRet => InstructionOpcode::CatchRet, - // LLVMOpcode::LLVMCatchSwitch => InstructionOpcode::CatchSwitch, - // LLVMOpcode::LLVMCleanupPad => InstructionOpcode::CleanupPad, - // LLVMOpcode::LLVMCleanupRet => InstructionOpcode::CleanupRet, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMOpcode::LLVMCatchPad => InstructionOpcode::CatchPad, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMOpcode::LLVMCatchRet => InstructionOpcode::CatchRet, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMOpcode::LLVMCatchSwitch => InstructionOpcode::CatchSwitch, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMOpcode::LLVMCleanupPad => InstructionOpcode::CleanupPad, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + LLVMOpcode::LLVMCleanupRet => InstructionOpcode::CleanupRet, LLVMOpcode::LLVMExtractElement => InstructionOpcode::ExtractElement, LLVMOpcode::LLVMExtractValue => InstructionOpcode::ExtractValue, LLVMOpcode::LLVMFAdd => InstructionOpcode::FAdd, @@ -162,12 +170,16 @@ impl InstructionOpcode { InstructionOpcode::BitCast => LLVMOpcode::LLVMBitCast, InstructionOpcode::Br => LLVMOpcode::LLVMBr, InstructionOpcode::Call => LLVMOpcode::LLVMCall, - // Newer versions: - // InstructionOpcode::CatchPad => LLVMOpcode::LLVMCatchPad, - // InstructionOpcode::CatchRet => LLVMOpcode::LLVMCatchRet, - // InstructionOpcode::CatchSwitch => LLVMOpcode::LLVMCatchSwitch, - // InstructionOpcode::CleanupPad => LLVMOpcode::LLVMCleanupPad, - // InstructionOpcode::CleanupRet => LLVMOpcode::LLVMCleanupRet, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + InstructionOpcode::CatchPad => LLVMOpcode::LLVMCatchPad, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + InstructionOpcode::CatchRet => LLVMOpcode::LLVMCatchRet, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + InstructionOpcode::CatchSwitch => LLVMOpcode::LLVMCatchSwitch, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + InstructionOpcode::CleanupPad => LLVMOpcode::LLVMCleanupPad, + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + InstructionOpcode::CleanupRet => LLVMOpcode::LLVMCleanupRet, InstructionOpcode::ExtractElement => LLVMOpcode::LLVMExtractElement, InstructionOpcode::ExtractValue => LLVMOpcode::LLVMExtractValue, InstructionOpcode::FAdd => LLVMOpcode::LLVMFAdd, diff --git a/src/values/metadata_value.rs b/src/values/metadata_value.rs index 260ef86bc21e8..7b7c9bd657337 100644 --- a/src/values/metadata_value.rs +++ b/src/values/metadata_value.rs @@ -14,6 +14,8 @@ use std::slice::from_raw_parts; pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 12; #[cfg(feature = "llvm3-7")] pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 14; +#[cfg(feature = "llvm3-8")] +pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 20; // FIXME #[derive(PartialEq, Eq, Clone, Copy)] pub struct MetadataValue { diff --git a/tests/test_builder.rs b/tests/test_builder.rs index b077d3a606e2b..f7ebfe6eddddd 100644 --- a/tests/test_builder.rs +++ b/tests/test_builder.rs @@ -440,7 +440,10 @@ fn test_no_builder_double_free2() { builder.position_at_end(&entry); builder.build_unreachable(); + #[cfg(any(feature = "llvm3-6", feature = "llvm3-7"))] assert_eq!(module.print_to_string(), &*CString::new("; ModuleID = \'my_mod\'\n\ndefine void @my_fn() {\nentry:\n unreachable\n}\n").unwrap()); + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + assert_eq!(module.print_to_string(), &*CString::new("; ModuleID = \'my_mod\'\nsource_filename = \"my_mod\"\n\ndefine void @my_fn() {\nentry:\n unreachable\n}\n").unwrap()); // 2nd Context drops fine // Builds drops fine diff --git a/tests/test_execution_engine.rs b/tests/test_execution_engine.rs index 7233e714eb8f4..4cce1d792e27f 100644 --- a/tests/test_execution_engine.rs +++ b/tests/test_execution_engine.rs @@ -4,9 +4,12 @@ use self::inkwell::OptimizationLevel; use self::inkwell::context::Context; use self::inkwell::execution_engine::FunctionLookupError; use self::inkwell::targets::{InitializationConfig, Target}; +use self::inkwell::enable_llvm_pretty_stack_trace; #[test] fn test_get_function_address() { + enable_llvm_pretty_stack_trace(); + let context = Context::create(); // let module = context.create_module("errors_abound"); let builder = context.create_builder(); From 6d288edcc83f60cab7e11a7c735e04bfaf8d97f9 Mon Sep 17 00:00:00 2001 From: Daniel Kolsoi Date: Thu, 12 Apr 2018 21:16:41 -0400 Subject: [PATCH 2/4] Complete initial LLVM 3.8 support --- .travis.yml | 8 ++++--- README.md | 3 ++- build.rs | 4 ++++ src/values/metadata_value.rs | 2 +- tests/test_builder.rs | 8 +++---- tests/test_execution_engine.rs | 3 --- tests/test_passes.rs | 8 +++---- tests/test_values.rs | 43 +++++++++++++++++++--------------- 8 files changed, 44 insertions(+), 35 deletions(-) create mode 100644 build.rs diff --git a/.travis.yml b/.travis.yml index 2ac949504db70..fce06dbecc6ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,7 +75,7 @@ matrix: on: branch: master script: - - cargo doc --no-default-features --features llvm3-7 + - cargo doc --no-default-features --features llvm3-8 - echo '' > target/doc/index.html after_success: rust: nightly @@ -84,11 +84,13 @@ matrix: sources: - *BASE_SOURCES # - llvm-toolchain-precise-3.6 - - llvm-toolchain-precise-3.7 + # - llvm-toolchain-precise-3.7 + - llvm-toolchain-precise-3.8 packages: - *BASE_PACKAGES # - llvm-3.6-dev - - llvm-3.7-dev + # - llvm-3.7-dev + - llvm-3.8-dev env: global: diff --git a/README.md b/README.md index b1bbd97cf660b..0c3eee29aa2e3 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Inkwell aims to help you pen your own programming languages by safely wrapping l * Any Rust version released in the last year or so * Rust Stable, Beta, or Nightly -* LLVM 3.6 or 3.7 (3.8+ support is planned: [#1](https://github.com/TheDan64/inkwell/issues/1)) +* LLVM 3.6, 3.7, or 3.8 (3.9+ support is planned: [#1](https://github.com/TheDan64/inkwell/issues/1)) ## Usage @@ -31,6 +31,7 @@ Supported versions: | :-----------: | :----------: | | llvm3-6 | llvm3-6 | | llvm3-7 | llvm3-7 | +| llvm3-8 | llvm3-8 | In the root of your source code you will have to add an extern crate to begin using Inkwell: diff --git a/build.rs b/build.rs new file mode 100644 index 0000000000000..0319e8d4e4e3e --- /dev/null +++ b/build.rs @@ -0,0 +1,4 @@ +fn main() { + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + println!("cargo:rustc-link-lib=dylib=ffi"); +} diff --git a/src/values/metadata_value.rs b/src/values/metadata_value.rs index 7b7c9bd657337..493c87d989678 100644 --- a/src/values/metadata_value.rs +++ b/src/values/metadata_value.rs @@ -15,7 +15,7 @@ pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 12; #[cfg(feature = "llvm3-7")] pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 14; #[cfg(feature = "llvm3-8")] -pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 20; // FIXME +pub const FIRST_CUSTOM_METADATA_KIND_ID: u32 = 18; #[derive(PartialEq, Eq, Clone, Copy)] pub struct MetadataValue { diff --git a/tests/test_builder.rs b/tests/test_builder.rs index f7ebfe6eddddd..54a7db295d647 100644 --- a/tests/test_builder.rs +++ b/tests/test_builder.rs @@ -440,11 +440,11 @@ fn test_no_builder_double_free2() { builder.position_at_end(&entry); builder.build_unreachable(); - #[cfg(any(feature = "llvm3-6", feature = "llvm3-7"))] + #[cfg(any(feature = "llvm3-6", feature = "llvm3-7", feature = "llvm3-8"))] assert_eq!(module.print_to_string(), &*CString::new("; ModuleID = \'my_mod\'\n\ndefine void @my_fn() {\nentry:\n unreachable\n}\n").unwrap()); - #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] - assert_eq!(module.print_to_string(), &*CString::new("; ModuleID = \'my_mod\'\nsource_filename = \"my_mod\"\n\ndefine void @my_fn() {\nentry:\n unreachable\n}\n").unwrap()); + // llvm 6.0?: + // assert_eq!(module.print_to_string(), &*CString::new("; ModuleID = \'my_mod\'\nsource_filename = \"my_mod\"\n\ndefine void @my_fn() {\nentry:\n unreachable\n}\n").unwrap()); // 2nd Context drops fine - // Builds drops fine + // Builder drops fine } diff --git a/tests/test_execution_engine.rs b/tests/test_execution_engine.rs index 4cce1d792e27f..7233e714eb8f4 100644 --- a/tests/test_execution_engine.rs +++ b/tests/test_execution_engine.rs @@ -4,12 +4,9 @@ use self::inkwell::OptimizationLevel; use self::inkwell::context::Context; use self::inkwell::execution_engine::FunctionLookupError; use self::inkwell::targets::{InitializationConfig, Target}; -use self::inkwell::enable_llvm_pretty_stack_trace; #[test] fn test_get_function_address() { - enable_llvm_pretty_stack_trace(); - let context = Context::create(); // let module = context.create_module("errors_abound"); let builder = context.create_builder(); diff --git a/tests/test_passes.rs b/tests/test_passes.rs index 310d4b77b8cc0..67e0c67356670 100644 --- a/tests/test_passes.rs +++ b/tests/test_passes.rs @@ -112,11 +112,11 @@ fn test_pass_manager_builder() { pass_manager_builder.populate_module_pass_manager(&module_pass_manager); - // REVIEW: Seems to return true in 3.7, even though no changes were made. - // In 3.6 it returns false. LLVM bug? - #[cfg(feature = "llvm3-6")] + // TODOC: Seems to return true in 3.7, even though no changes were made. + // In 3.6 and 3.8 it returns false. Seems like an LLVM bug + #[cfg(not(feature = "llvm3-7"))] assert!(!module_pass_manager.run_on_module(&module)); - #[cfg(not(feature = "llvm3-6"))] + #[cfg(feature = "llvm3-7")] assert!(module_pass_manager.run_on_module(&module)); // TODO: Populate LTO pass manager? diff --git a/tests/test_values.rs b/tests/test_values.rs index 01966f6394e85..c7b1013347601 100644 --- a/tests/test_values.rs +++ b/tests/test_values.rs @@ -400,25 +400,28 @@ fn test_metadata() { assert_eq!(MetadataValue::get_kind_id("dereferenceable_or_null"), 13); } + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] + { + assert_eq!(context.get_kind_id("make.implicit"), 14); + assert_eq!(MetadataValue::get_kind_id("make.implicit"), 14); + assert_eq!(context.get_kind_id("unpredictable"), 15); + assert_eq!(MetadataValue::get_kind_id("unpredictable"), 15); + assert_eq!(context.get_kind_id("invariant.group"), 16); + assert_eq!(MetadataValue::get_kind_id("invariant.group"), 16); + assert_eq!(context.get_kind_id("align"), 17); + assert_eq!(MetadataValue::get_kind_id("align"), 17); + } // TODO: Predefined, but only newer versions we don't support yet - // assert_eq!(context.get_kind_id("make.implicit"), 14); - // assert_eq!(MetadataValue::get_kind_id("make.implicit"), 14); - // assert_eq!(context.get_kind_id("unpredictable"), 15); - // assert_eq!(MetadataValue::get_kind_id("unpredictable"), 15); - // assert_eq!(context.get_kind_id("invariant.group"), 16); - // assert_eq!(MetadataValue::get_kind_id("invariant.group"), 16); - // assert_eq!(context.get_kind_id("align"), 16); - // assert_eq!(MetadataValue::get_kind_id("align"), 16); - // assert_eq!(context.get_kind_id("llvm.loop"), 17); - // assert_eq!(MetadataValue::get_kind_id("llvm.loop"), 17); - // assert_eq!(context.get_kind_id("type"), 18); - // assert_eq!(MetadataValue::get_kind_id("type"), 18); - // assert_eq!(context.get_kind_id("section_prefix"), 19); - // assert_eq!(MetadataValue::get_kind_id("section_prefix"), 19); - // assert_eq!(context.get_kind_id("absolute_symbol"), 20); - // assert_eq!(MetadataValue::get_kind_id("absolute_symbol"), 20); - // assert_eq!(context.get_kind_id("associated"), 21); - // assert_eq!(MetadataValue::get_kind_id("associated"), 21); + // assert_eq!(context.get_kind_id("llvm.loop"), 18); + // assert_eq!(MetadataValue::get_kind_id("llvm.loop"), 18); + // assert_eq!(context.get_kind_id("type"), 19); + // assert_eq!(MetadataValue::get_kind_id("type"), 19); + // assert_eq!(context.get_kind_id("section_prefix"), 20); + // assert_eq!(MetadataValue::get_kind_id("section_prefix"), 20); + // assert_eq!(context.get_kind_id("absolute_symbol"), 21); + // assert_eq!(MetadataValue::get_kind_id("absolute_symbol"), 21); + // assert_eq!(context.get_kind_id("associated"), 22); + // assert_eq!(MetadataValue::get_kind_id("associated"), 22); assert_eq!(module.get_global_metadata_size("my_string_md"), 0); assert_eq!(module.get_global_metadata("my_string_md").len(), 0); @@ -686,7 +689,9 @@ fn test_function_value_no_params() { assert!(fn_value.get_first_param().is_none()); assert!(fn_value.get_last_param().is_none()); assert!(fn_value.get_nth_param(0).is_none()); - #[cfg(not(feature = "llvm3-6"))] + // REVIEW: get_personality_function causes segfault in 3.8 Probably LLVM bug + // if so, should document + #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-8")))] assert!(fn_value.get_personality_function().is_none()); assert!(!fn_value.is_null()); assert!(!fn_value.is_undef()); From 25e11024a768ee1a3e3153358022ff6d76568f58 Mon Sep 17 00:00:00 2001 From: Daniel Kolsoi Date: Mon, 16 Apr 2018 20:21:31 -0400 Subject: [PATCH 3/4] Worked around LLVM 3.8+ ffi linking issue. See https://bitbucket.org/tari/llvm-sys.rs/issues/12/not-linking-to-libffi-typo for more info. --- .cargo/config | 2 ++ build.rs | 4 ---- src/lib.rs | 2 -- src/passes.rs | 5 ++--- 4 files changed, 4 insertions(+), 9 deletions(-) create mode 100644 .cargo/config delete mode 100644 build.rs diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000000000..0ce18f9742fc8 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[build] +rustflags = ["-lffi"] diff --git a/build.rs b/build.rs deleted file mode 100644 index 0319e8d4e4e3e..0000000000000 --- a/build.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7")))] - println!("cargo:rustc-link-lib=dylib=ffi"); -} diff --git a/src/lib.rs b/src/lib.rs index 030d35c77e016..9f3e4747622c0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,8 +24,6 @@ use llvm_sys::support::LLVMLoadLibraryPermanently; use std::ffi::CString; - - #[cfg(not(any(feature = "llvm3-6", feature = "llvm3-7", feature = "llvm3-8")))] compile_error!("A LLVM feature flag must be provided. See the README for more details."); diff --git a/src/passes.rs b/src/passes.rs index 9531f447909c6..e220094babba5 100644 --- a/src/passes.rs +++ b/src/passes.rs @@ -17,7 +17,6 @@ use targets::TargetData; use values::{AsValueRef, FunctionValue}; // REVIEW: Opt Level might be identical to targets::Option -// REVIEW: size_level 0-2 according to llvmlite #[derive(Debug)] pub struct PassManagerBuilder { pass_manager_builder: LLVMPassManagerBuilderRef, @@ -28,7 +27,7 @@ impl PassManagerBuilder { assert!(!pass_manager_builder.is_null()); PassManagerBuilder { - pass_manager_builder: pass_manager_builder, + pass_manager_builder, } } @@ -118,7 +117,7 @@ impl PassManager { assert!(!pass_manager.is_null()); PassManager { - pass_manager: pass_manager + pass_manager, } } From cb6f41300dcdb47d81dd3caafd3aa205feb0c280 Mon Sep 17 00:00:00 2001 From: Daniel Kolsoi Date: Mon, 16 Apr 2018 20:43:35 -0400 Subject: [PATCH 4/4] Specify tests should link against ffi in .travis.yml This is because tests are overriding the specification in .cargo/config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index fce06dbecc6ff..ac1c6367d883a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -94,7 +94,7 @@ matrix: env: global: - - RUSTFLAGS="-C link-dead-code -C target-cpu=native" + - RUSTFLAGS="-C link-dead-code -C target-cpu=native -l ffi" after_success: | wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&