From ea8392454758e5d757ae524ce560072763acd96c Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 8 Jul 2019 14:10:37 -0700 Subject: [PATCH] Update to LLVM 8.0. --- lib/llvm-backend/Cargo.toml | 2 +- lib/llvm-backend/build.rs | 2 +- lib/llvm-backend/cpp/object_loader.cpp | 17 ++++++----------- lib/llvm-backend/src/code.rs | 4 ++-- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/lib/llvm-backend/Cargo.toml b/lib/llvm-backend/Cargo.toml index d9aae1ff3..fbc78c73e 100644 --- a/lib/llvm-backend/Cargo.toml +++ b/lib/llvm-backend/Cargo.toml @@ -6,7 +6,7 @@ edition = "2018" [dependencies] wasmer-runtime-core = { path = "../runtime-core", version = "0.5.4" } -inkwell = { git = "https://github.com/wasmerio/inkwell", branch = "llvm7-0" } +inkwell = { git = "https://github.com/lumen/inkwell", rev = "64921e418c3e8f4b32f9beed56ebd5aac4e677c7", features = ["llvm8-0"] } wasmparser = "0.32.1" hashbrown = "0.1.8" smallvec = "0.6.8" diff --git a/lib/llvm-backend/build.rs b/lib/llvm-backend/build.rs index ab59748b1..6c8117dd9 100644 --- a/lib/llvm-backend/build.rs +++ b/lib/llvm-backend/build.rs @@ -41,7 +41,7 @@ lazy_static! { // Did the user give us a binary path to use? If yes, try // to use that and fail if it doesn't work. - let binary_prefix_var = "LLVM_SYS_70_PREFIX"; + let binary_prefix_var = "LLVM_SYS_80_PREFIX"; let path = if let Some(path) = env::var_os(&binary_prefix_var) { Some(path.to_str().unwrap().to_owned()) diff --git a/lib/llvm-backend/cpp/object_loader.cpp b/lib/llvm-backend/cpp/object_loader.cpp index 28bea6354..3f2078c84 100644 --- a/lib/llvm-backend/cpp/object_loader.cpp +++ b/lib/llvm-backend/cpp/object_loader.cpp @@ -139,24 +139,19 @@ struct SymbolLookup : llvm::JITSymbolResolver { public: SymbolLookup(callbacks_t callbacks) : callbacks(callbacks) {} - virtual llvm::Expected lookup(const LookupSet& symbols) override { + void lookup(const LookupSet& symbols, OnResolvedFunction OnResolved) { LookupResult result; for (auto symbol : symbols) { result.emplace(symbol, symbol_lookup(symbol)); } - return result; + OnResolved(result); } - virtual llvm::Expected lookupFlags(const LookupSet& symbols) override { - LookupFlagsResult result; - - for (auto symbol : symbols) { - result.emplace(symbol, symbol_lookup(symbol).getFlags()); - } - - return result; + llvm::Expected getResponsibilitySet(const LookupSet &Symbols) { + const std::set empty; + return empty; } private: @@ -201,4 +196,4 @@ WasmModule::WasmModule( void* WasmModule::get_func(llvm::StringRef name) const { auto symbol = runtime_dyld->getSymbol(name); return (void*)symbol.getAddress(); -} \ No newline at end of file +} diff --git a/lib/llvm-backend/src/code.rs b/lib/llvm-backend/src/code.rs index 0359b3dd8..1a1844e4d 100644 --- a/lib/llvm-backend/src/code.rs +++ b/lib/llvm-backend/src/code.rs @@ -2603,7 +2603,7 @@ impl ModuleCodeGenerator self.intrinsics.as_ref().unwrap(), ); - let pass_manager = PassManager::create_for_module(); + let pass_manager = PassManager::create(()); if cfg!(test) { pass_manager.add_verifier_pass(); } @@ -2614,7 +2614,7 @@ impl ModuleCodeGenerator pass_manager.add_merged_load_store_motion_pass(); pass_manager.add_new_gvn_pass(); pass_manager.add_aggressive_dce_pass(); - pass_manager.run_on_module(&self.module); + pass_manager.run_on(&self.module); // self.module.print_to_stderr();