]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_trans/lib.rs
rustc: Start a custom cabi module for wasm32
[rust.git] / src / librustc_trans / lib.rs
index 6c281ab5e7a40823bc0145ab07f5a920e720530e..4a32b614c05d4a40a6cd52574cbd426dc09bc1bc 100644 (file)
@@ -49,9 +49,8 @@
 extern crate rustc_allocator;
 extern crate rustc_apfloat;
 extern crate rustc_back;
-extern crate rustc_binaryen;
 extern crate rustc_const_math;
-extern crate rustc_data_structures;
+#[macro_use] extern crate rustc_data_structures;
 extern crate rustc_demangle;
 extern crate rustc_incremental;
 extern crate rustc_llvm as llvm;
@@ -63,7 +62,6 @@
 extern crate syntax_pos;
 extern crate rustc_errors as errors;
 extern crate serialize;
-#[cfg(windows)]
 extern crate cc; // Used to locate MSVC
 extern crate tempdir;
 
@@ -73,8 +71,8 @@
 
 use std::any::Any;
 use std::path::PathBuf;
-use std::rc::Rc;
 use std::sync::mpsc;
+use rustc_data_structures::sync::Lrc;
 
 use rustc::dep_graph::DepGraph;
 use rustc::hir::def_id::CrateNum;
@@ -125,6 +123,7 @@ mod back {
 mod cabi_x86;
 mod cabi_x86_64;
 mod cabi_x86_win64;
+mod cabi_wasm32;
 mod callee;
 mod common;
 mod consts;
@@ -240,7 +239,7 @@ fn join_trans_and_link(
             back::write::dump_incremental_data(&trans);
         }
 
-        time(sess.time_passes(),
+        time(sess,
              "serialize work products",
              move || rustc_incremental::save_work_products(sess, &dep_graph));
 
@@ -253,7 +252,7 @@ fn join_trans_and_link(
 
         // Run the linker on any artifacts that resulted from the LLVM run.
         // This should produce either a finished executable or library.
-        time(sess.time_passes(), "linking", || {
+        time(sess, "linking", || {
             back::link::link_binary(sess, &trans, outputs, &trans.crate_name.as_str());
         });
 
@@ -394,11 +393,11 @@ struct CrateInfo {
     profiler_runtime: Option<CrateNum>,
     sanitizer_runtime: Option<CrateNum>,
     is_no_builtins: FxHashSet<CrateNum>,
-    native_libraries: FxHashMap<CrateNum, Rc<Vec<NativeLibrary>>>,
+    native_libraries: FxHashMap<CrateNum, Lrc<Vec<NativeLibrary>>>,
     crate_name: FxHashMap<CrateNum, String>,
-    used_libraries: Rc<Vec<NativeLibrary>>,
-    link_args: Rc<Vec<String>>,
-    used_crate_source: FxHashMap<CrateNum, Rc<CrateSource>>,
+    used_libraries: Lrc<Vec<NativeLibrary>>,
+    link_args: Lrc<Vec<String>>,
+    used_crate_source: FxHashMap<CrateNum, Lrc<CrateSource>>,
     used_crates_static: Vec<(CrateNum, LibSource)>,
     used_crates_dynamic: Vec<(CrateNum, LibSource)>,
 }