Format the world

This commit is contained in:
Mark Rousskov 2019-12-22 17:42:04 -05:00
parent 8eb7c58dbb
commit a06baa56b9
1160 changed files with 65934 additions and 74316 deletions

View 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 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;
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,10 +26,7 @@ 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)
};
@ -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?"))
}