about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-12-07 20:04:06 +0000
committerbors <bors@rust-lang.org>2018-12-07 20:04:06 +0000
commit4a45578bc58ff262864f72680cc02e83f5d2f5b3 (patch)
tree4adb79b3a93aab5d3f97dfe0f80ff9041f73fed8 /src/librustc_codegen_ssa
parenta40fdeddd81965ee08344fbdd2dbdc04adf24561 (diff)
parenta70babed03d58d042024e41f0a46f7e33e34d0d1 (diff)
downloadrust-4a45578bc58ff262864f72680cc02e83f5d2f5b3.tar.gz
rust-4a45578bc58ff262864f72680cc02e83f5d2f5b3.zip
Auto merge of #56502 - Zoxc:hir-func, r=eddyb
Use a function to access the Hir map to be able to turn it into a query later

r? @eddyb
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/back/symbol_export.rs14
-rw-r--r--src/librustc_codegen_ssa/back/write.rs4
-rw-r--r--src/librustc_codegen_ssa/base.rs2
-rw-r--r--src/librustc_codegen_ssa/mono_item.rs2
4 files changed, 11 insertions, 11 deletions
diff --git a/src/librustc_codegen_ssa/back/symbol_export.rs b/src/librustc_codegen_ssa/back/symbol_export.rs
index ecae6197dc7..84b17e31dd4 100644
--- a/src/librustc_codegen_ssa/back/symbol_export.rs
+++ b/src/librustc_codegen_ssa/back/symbol_export.rs
@@ -93,9 +93,9 @@ fn reachable_non_generics_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
             //
             // As a result, if this id is an FFI item (foreign item) then we only
             // let it through if it's included statically.
-            match tcx.hir.get(node_id) {
+            match tcx.hir().get(node_id) {
                 Node::ForeignItem(..) => {
-                    let def_id = tcx.hir.local_def_id(node_id);
+                    let def_id = tcx.hir().local_def_id(node_id);
                     if tcx.is_statically_included_foreign_item(def_id) {
                         Some(def_id)
                     } else {
@@ -115,7 +115,7 @@ fn reachable_non_generics_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
                     node: hir::ImplItemKind::Method(..),
                     ..
                 }) => {
-                    let def_id = tcx.hir.local_def_id(node_id);
+                    let def_id = tcx.hir().local_def_id(node_id);
                     let generics = tcx.generics_of(def_id);
                     if !generics.requires_monomorphization(tcx) &&
                         // Functions marked with #[inline] are only ever codegened
@@ -158,12 +158,12 @@ fn reachable_non_generics_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
         .collect();
 
     if let Some(id) = *tcx.sess.proc_macro_decls_static.get() {
-        let def_id = tcx.hir.local_def_id(id);
+        let def_id = tcx.hir().local_def_id(id);
         reachable_non_generics.insert(def_id, SymbolExportLevel::C);
     }
 
     if let Some(id) = *tcx.sess.plugin_registrar_fn.get() {
-        let def_id = tcx.hir.local_def_id(id);
+        let def_id = tcx.hir().local_def_id(id);
         reachable_non_generics.insert(def_id, SymbolExportLevel::C);
     }
 
@@ -355,7 +355,7 @@ fn upstream_monomorphizations_for_provider<'a, 'tcx>(
 }
 
 fn is_unreachable_local_definition_provider(tcx: TyCtxt, def_id: DefId) -> bool {
-    if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {
+    if let Some(node_id) = tcx.hir().as_local_node_id(def_id) {
         !tcx.reachable_set(LOCAL_CRATE).0.contains(&node_id)
     } else {
         bug!("is_unreachable_local_definition called with non-local DefId: {:?}",
@@ -393,7 +393,7 @@ fn symbol_export_level(tcx: TyCtxt, sym_def_id: DefId) -> SymbolExportLevel {
             if let Some(Node::Item(&hir::Item {
                 node: hir::ItemKind::Static(..),
                 ..
-            })) = tcx.hir.get_if_local(sym_def_id) {
+            })) = tcx.hir().get_if_local(sym_def_id) {
                 return SymbolExportLevel::Rust;
             }
         }
diff --git a/src/librustc_codegen_ssa/back/write.rs b/src/librustc_codegen_ssa/back/write.rs
index 59955ce77cd..ec790e6c665 100644
--- a/src/librustc_codegen_ssa/back/write.rs
+++ b/src/librustc_codegen_ssa/back/write.rs
@@ -320,8 +320,8 @@ pub fn start_async_codegen<B: ExtraBackendMethods>(
     let sess = tcx.sess;
     let crate_name = tcx.crate_name(LOCAL_CRATE);
     let crate_hash = tcx.crate_hash(LOCAL_CRATE);
-    let no_builtins = attr::contains_name(&tcx.hir.krate().attrs, "no_builtins");
-    let subsystem = attr::first_attr_value_str_by_name(&tcx.hir.krate().attrs,
+    let no_builtins = attr::contains_name(&tcx.hir().krate().attrs, "no_builtins");
+    let subsystem = attr::first_attr_value_str_by_name(&tcx.hir().krate().attrs,
                                                        "windows_subsystem");
     let windows_subsystem = subsystem.map(|subsystem| {
         if subsystem != "windows" && subsystem != "console" {
diff --git a/src/librustc_codegen_ssa/base.rs b/src/librustc_codegen_ssa/base.rs
index 266f78996b3..76d699d1736 100644
--- a/src/librustc_codegen_ssa/base.rs
+++ b/src/librustc_codegen_ssa/base.rs
@@ -453,7 +453,7 @@ pub fn maybe_create_entry_wrapper<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>>(
 ) {
     let (main_def_id, span) = match *cx.sess().entry_fn.borrow() {
         Some((id, span, _)) => {
-            (cx.tcx().hir.local_def_id(id), span)
+            (cx.tcx().hir().local_def_id(id), span)
         }
         None => return,
     };
diff --git a/src/librustc_codegen_ssa/mono_item.rs b/src/librustc_codegen_ssa/mono_item.rs
index 8fe89791969..26f8a9a5dd4 100644
--- a/src/librustc_codegen_ssa/mono_item.rs
+++ b/src/librustc_codegen_ssa/mono_item.rs
@@ -42,7 +42,7 @@ pub trait MonoItemExt<'a, 'tcx: 'a>: fmt::Debug + BaseMonoItemExt<'a, 'tcx> {
                 cx.codegen_static(def_id, is_mutable);
             }
             MonoItem::GlobalAsm(node_id) => {
-                let item = cx.tcx().hir.expect_item(node_id);
+                let item = cx.tcx().hir().expect_item(node_id);
                 if let hir::ItemKind::GlobalAsm(ref ga) = item.node {
                     cx.codegen_global_asm(ga);
                 } else {