From bb26aadaf3497089e9264266455d1c53391a41c0 Mon Sep 17 00:00:00 2001 From: Nick Cameron Date: Fri, 24 Apr 2015 17:25:35 +1200 Subject: [PATCH] Tidy up --- src/librustc_trans/trans/debuginfo/adt.rs | 12 ++++----- src/librustc_trans/trans/debuginfo/create.rs | 6 ++--- src/librustc_trans/trans/debuginfo/doc.rs | 6 ++--- src/librustc_trans/trans/debuginfo/gdb.rs | 8 +++--- .../trans/debuginfo/metadata.rs | 9 ++++--- src/librustc_trans/trans/debuginfo/mod.rs | 26 ++++++++++--------- .../trans/debuginfo/namespace.rs | 8 +++--- src/librustc_trans/trans/debuginfo/types.rs | 8 +++--- src/librustc_trans/trans/debuginfo/utils.rs | 6 ++--- 9 files changed, 46 insertions(+), 43 deletions(-) diff --git a/src/librustc_trans/trans/debuginfo/adt.rs b/src/librustc_trans/trans/debuginfo/adt.rs index 4dc96e0ee69..1145be80024 100644 --- a/src/librustc_trans/trans/debuginfo/adt.rs +++ b/src/librustc_trans/trans/debuginfo/adt.rs @@ -1,10 +1,10 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. @@ -16,9 +16,8 @@ use self::MemberOffset::*; use super::{UNKNOWN_FILE_METADATA, UNKNOWN_SCOPE_METADATA, UNKNOWN_LINE_NUMBER, UniqueTypeId, FLAGS_NONE, create_and_register_recursive_type_forward_declaration}; - -use super::utils::{debug_context, DIB, span_start, bytes_to_bits, size_and_align_of, - get_namespace_and_span_for_item}; +use super::utils::{debug_context, DIB, span_start, bytes_to_bits, + size_and_align_of, get_namespace_and_span_for_item}; use super::create::create_DIArray; use super::types::compute_debuginfo_type_name; use super::metadata::{type_metadata, file_metadata}; @@ -43,6 +42,7 @@ use syntax::codemap::Span; use syntax::{ast, codemap}; use syntax::parse::token::{self, special_idents}; + pub enum MemberOffset { FixedMemberOffset { bytes: usize }, // For ComputedMemberOffset, the offset is read from the llvm type definition. diff --git a/src/librustc_trans/trans/debuginfo/create.rs b/src/librustc_trans/trans/debuginfo/create.rs index 33ec225450b..e031cd4efa1 100644 --- a/src/librustc_trans/trans/debuginfo/create.rs +++ b/src/librustc_trans/trans/debuginfo/create.rs @@ -1,10 +1,10 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. diff --git a/src/librustc_trans/trans/debuginfo/doc.rs b/src/librustc_trans/trans/debuginfo/doc.rs index 138770c42b8..a91619b2f84 100644 --- a/src/librustc_trans/trans/debuginfo/doc.rs +++ b/src/librustc_trans/trans/debuginfo/doc.rs @@ -1,10 +1,10 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. diff --git a/src/librustc_trans/trans/debuginfo/gdb.rs b/src/librustc_trans/trans/debuginfo/gdb.rs index 952ae335203..a6f1199d0ff 100644 --- a/src/librustc_trans/trans/debuginfo/gdb.rs +++ b/src/librustc_trans/trans/debuginfo/gdb.rs @@ -1,14 +1,14 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -// .debug_gdb_scripts binary section +// .debug_gdb_scripts binary section. use llvm; use llvm::ValueRef; diff --git a/src/librustc_trans/trans/debuginfo/metadata.rs b/src/librustc_trans/trans/debuginfo/metadata.rs index d21002ffa95..81377d42902 100644 --- a/src/librustc_trans/trans/debuginfo/metadata.rs +++ b/src/librustc_trans/trans/debuginfo/metadata.rs @@ -1,15 +1,15 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. use super::utils::{debug_context, DIB, span_start, bytes_to_bits, size_and_align_of, - get_namespace_and_span_for_item}; + get_namespace_and_span_for_item}; use super::{UNKNOWN_FILE_METADATA, UNKNOWN_SCOPE_METADATA, UniqueTypeId, FLAGS_NONE}; use super::types::compute_debuginfo_type_name; @@ -35,6 +35,7 @@ use std::ptr; use syntax::codemap::Span; use syntax::{ast, codemap}; + const DW_LANG_RUST: c_uint = 0x9000; #[allow(non_upper_case_globals)] const DW_ATE_boolean: c_uint = 0x02; diff --git a/src/librustc_trans/trans/debuginfo/mod.rs b/src/librustc_trans/trans/debuginfo/mod.rs index 808a6cb01fb..0cc4c2a1e6d 100644 --- a/src/librustc_trans/trans/debuginfo/mod.rs +++ b/src/librustc_trans/trans/debuginfo/mod.rs @@ -1,24 +1,16 @@ // Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. // See doc.rs for documentation. mod doc; -pub mod gdb; -mod utils; -mod create; -mod namespace; -mod types; -mod metadata; -mod adt; - use self::VariableAccess::*; use self::VariableKind::*; use self::InternalDebugLocation::*; @@ -30,7 +22,8 @@ use self::utils::{debug_context, DIB, span_start, use self::create::{declare_local, create_DIArray, is_node_local_to_unit}; use self::namespace::{namespace_for_item, NamespaceTreeNode}; use self::types::{compute_debuginfo_type_name, push_debuginfo_type_name}; -use self::metadata::{type_metadata, file_metadata, scope_metadata, compile_unit_metadata, MetadataCreationResult}; +use self::metadata::{type_metadata, file_metadata, scope_metadata, + compile_unit_metadata, MetadataCreationResult}; use self::adt::{MemberDescriptionFactory, set_members_of_composite_type}; use llvm; @@ -59,6 +52,15 @@ use syntax::codemap::{Span, Pos}; use syntax::{ast, codemap, ast_util, ast_map}; use syntax::parse::token::{self, special_idents}; +pub mod gdb; +mod utils; +mod create; +mod namespace; +mod types; +mod metadata; +mod adt; + + #[allow(non_upper_case_globals)] const DW_TAG_auto_variable: c_uint = 0x100; #[allow(non_upper_case_globals)] diff --git a/src/librustc_trans/trans/debuginfo/namespace.rs b/src/librustc_trans/trans/debuginfo/namespace.rs index 1300a203918..0aa0408c0ef 100644 --- a/src/librustc_trans/trans/debuginfo/namespace.rs +++ b/src/librustc_trans/trans/debuginfo/namespace.rs @@ -1,14 +1,14 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -// Namespace Handling +// Namespace Handling. use super::utils::{DIB, debug_context}; diff --git a/src/librustc_trans/trans/debuginfo/types.rs b/src/librustc_trans/trans/debuginfo/types.rs index 586dd1526cd..2d0003d93a5 100644 --- a/src/librustc_trans/trans/debuginfo/types.rs +++ b/src/librustc_trans/trans/debuginfo/types.rs @@ -1,14 +1,14 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms. -// Type Names for Debug Info +// Type Names for Debug Info. use super::namespace::crate_root_namespace; diff --git a/src/librustc_trans/trans/debuginfo/utils.rs b/src/librustc_trans/trans/debuginfo/utils.rs index 48c11dd7ebb..6384f90d499 100644 --- a/src/librustc_trans/trans/debuginfo/utils.rs +++ b/src/librustc_trans/trans/debuginfo/utils.rs @@ -1,10 +1,10 @@ // Copyright 2015 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at -// http://!rust-lang.org/COPYRIGHT. +// http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 or the MIT license -// , at your +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// , at your // option. This file may not be copied, modified, or distributed // except according to those terms.