]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_metadata/csearch.rs
Only retain external static symbols across LTO
[rust.git] / src / librustc_metadata / csearch.rs
index bc52921e1b8ca530bd10d513ce1402239ce41eb7..5eade3bc0a54ed7c82152832cccac8bad11fb60f 100644 (file)
@@ -23,6 +23,7 @@
 
 use rustc::front::map as hir_map;
 use rustc::mir::repr::Mir;
+use rustc::mir::mir_map::MirMap;
 use rustc::util::nodemap::{FnvHashMap, NodeMap, NodeSet};
 
 use std::cell::RefCell;
@@ -259,16 +260,9 @@ fn is_default_impl(&self, impl_did: DefId) -> bool {
         decoder::is_default_impl(&*cdata, impl_did.index)
     }
 
-    fn is_extern_fn(&self, tcx: &ty::ctxt<'tcx>, did: DefId) -> bool
-    {
-        let cdata = self.get_crate_data(did.krate);
-        decoder::is_extern_fn(&*cdata, did.index, tcx)
-    }
-
-    fn is_static(&self, did: DefId) -> bool
-    {
+    fn is_extern_item(&self, tcx: &ty::ctxt<'tcx>, did: DefId) -> bool {
         let cdata = self.get_crate_data(did.krate);
-        decoder::is_static(&*cdata, did.index)
+        decoder::is_extern_item(&*cdata, did.index, tcx)
     }
 
     fn is_static_method(&self, def: DefId) -> bool
@@ -502,7 +496,7 @@ fn encode_metadata(&self,
                        item_symbols: &RefCell<NodeMap<String>>,
                        link_meta: &LinkMeta,
                        reachable: &NodeSet,
-                       mir_map: &NodeMap<Mir<'tcx>>,
+                       mir_map: &MirMap<'tcx>,
                        krate: &hir::Crate) -> Vec<u8>
     {
         let encode_inlined_item: encoder::EncodeInlinedItem =