]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc_codegen_llvm/debuginfo/utils.rs
Rollup merge of #67313 - oli-obk:document_all_the_t̶h̶i̶n̶g̶s̶dataflow, r=ecstatic...
[rust.git] / src / librustc_codegen_llvm / debuginfo / utils.rs
index c64e0d9806b2930653f9f2907fba2c188cff2567..4e17387e057f9ba85098b9cbc2204b178b16defd 100644 (file)
@@ -1,20 +1,19 @@
 // Utility Functions.
 
-use super::{CrateDebugContext};
 use super::namespace::item_namespace;
+use super::CrateDebugContext;
 
-use rustc::hir::def_id::DefId;
 use rustc::ty::DefIdTree;
+use rustc_hir::def_id::DefId;
 
+use crate::common::CodegenCx;
 use crate::llvm;
-use crate::llvm::debuginfo::{DIScope, DIBuilder, DIDescriptor, DIArray};
-use crate::common::{CodegenCx};
+use crate::llvm::debuginfo::{DIArray, DIBuilder, DIDescriptor, DIScope};
 use rustc_codegen_ssa::traits::*;
 
-use syntax_pos::Span;
+use rustc_span::Span;
 
-pub fn is_node_local_to_unit(cx: &CodegenCx<'_, '_>, def_id: DefId) -> bool
-{
+pub fn is_node_local_to_unit(cx: &CodegenCx<'_, '_>, def_id: DefId) -> bool {
     // The is_local_to_unit flag indicates whether a function is local to the
     // current compilation unit (i.e., if it is *static* in the C-sense). The
     // *reachable* set should provide a good approximation of this, as it
@@ -27,17 +26,14 @@ pub fn is_node_local_to_unit(cx: &CodegenCx<'_, '_>, def_id: DefId) -> bool
 }
 
 #[allow(non_snake_case)]
-pub fn create_DIArray(
-    builder: &DIBuilder<'ll>,
-    arr: &[Option<&'ll DIDescriptor>],
-) -> &'ll DIArray {
+pub fn create_DIArray(builder: &DIBuilder<'ll>, arr: &[Option<&'ll DIDescriptor>]) -> &'ll DIArray {
     return unsafe {
         llvm::LLVMRustDIBuilderGetOrCreateArray(builder, arr.as_ptr(), arr.len() as u32)
     };
 }
 
-/// Returns syntax_pos::Loc corresponding to the beginning of the span
-pub fn span_start(cx: &CodegenCx<'_, '_>, span: Span) -> syntax_pos::Loc {
+/// Returns rustc_span::Loc corresponding to the beginning of the span
+pub fn span_start(cx: &CodegenCx<'_, '_>, span: Span) -> rustc_span::Loc {
     cx.sess().source_map().lookup_char_pos(span.lo())
 }
 
@@ -53,6 +49,5 @@ pub fn DIB(cx: &'a CodegenCx<'ll, '_>) -> &'a DIBuilder<'ll> {
 }
 
 pub fn get_namespace_for_item(cx: &CodegenCx<'ll, '_>, def_id: DefId) -> &'ll DIScope {
-    item_namespace(cx, cx.tcx.parent(def_id)
-        .expect("get_namespace_for_item: missing parent?"))
+    item_namespace(cx, cx.tcx.parent(def_id).expect("get_namespace_for_item: missing parent?"))
 }