From c3ffbc3151a8676efe1ae8ac1ccf353f76c52549 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Sun, 15 Sep 2013 11:22:22 +0200 Subject: [PATCH] debuginfo: Fix style nits for pull request. --- src/librustc/lib/llvm.rs | 1 - src/librustc/middle/trans/debuginfo.rs | 21 ++++++++++----------- src/test/debug-info/trait-pointers.rs | 2 -- 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/librustc/lib/llvm.rs b/src/librustc/lib/llvm.rs index 9a9015179f6..beadcf3a19d 100644 --- a/src/librustc/lib/llvm.rs +++ b/src/librustc/lib/llvm.rs @@ -2120,7 +2120,6 @@ pub mod llvm { #[fast_ffi] pub fn LLVMDICompositeTypeSetTypeArray(CompositeType: ValueRef, TypeArray: ValueRef); - #[fast_ffi] pub fn LLVMIsAArgument(value_ref: ValueRef) -> ValueRef; diff --git a/src/librustc/middle/trans/debuginfo.rs b/src/librustc/middle/trans/debuginfo.rs index b10f03729e4..59cf137b2b3 100644 --- a/src/librustc/middle/trans/debuginfo.rs +++ b/src/librustc/middle/trans/debuginfo.rs @@ -601,10 +601,8 @@ pub fn create_function_debug_context(cx: &mut CrateContext, _) => { (ident, fn_decl, generics, Some(top_level_block), span) } - ast_map::node_foreign_item(@ast::foreign_item { _ }, _, _, _) => { - return FunctionWithoutDebugInfo; - } - ast_map::node_variant(*) | + ast_map::node_foreign_item(@ast::foreign_item { _ }, _, _, _) | + ast_map::node_variant(*) | ast_map::node_struct_ctor(*) => { return FunctionWithoutDebugInfo; } @@ -1166,9 +1164,10 @@ impl RecursiveTypeDescription { // Insert the stub into the cache in order to allow recursive references ... debug_context(cx).created_types.insert(cache_id, metadata_stub); - // ... then create the member descriptions + // ... then create the member descriptions ... let member_descriptions = member_description_factory(cx); + // ... and attach them to the stub to complete it. set_members_of_composite_type(cx, metadata_stub, llvm_type, @@ -1465,7 +1464,7 @@ fn prepare_enum_metadata(cx: &mut CrateContext, } enum MemberOffset { - FixedMemberOffset{ bytes: uint }, + FixedMemberOffset { bytes: uint }, // For ComputedMemberOffset, the offset is read from the llvm type definition ComputedMemberOffset } @@ -1863,14 +1862,14 @@ fn trait_metadata(cx: &mut CrateContext, // the trait's methods. let path = ty::item_path(cx.tcx, def_id); let ident = path.last().ident(); - let name = ppaux::trait_store_to_str(cx.tcx, trait_store) - + ppaux::mutability_to_str(mutability) - + token::ident_to_str(&ident); + let name = ppaux::trait_store_to_str(cx.tcx, trait_store) + + ppaux::mutability_to_str(mutability) + + token::ident_to_str(&ident); // Add type and region parameters let name = ppaux::parameterized(cx.tcx, name, &substs.regions, substs.tps); - let (containing_scope, - definition_span) = get_namespace_and_span_for_item(cx, def_id, usage_site_span); + let (containing_scope, definition_span) = + get_namespace_and_span_for_item(cx, def_id, usage_site_span); let file_name = span_start(cx, definition_span).file.name; let file_metadata = file_metadata(cx, file_name); diff --git a/src/test/debug-info/trait-pointers.rs b/src/test/debug-info/trait-pointers.rs index 4ec9fae1e2f..db02e69cfb8 100644 --- a/src/test/debug-info/trait-pointers.rs +++ b/src/test/debug-info/trait-pointers.rs @@ -31,5 +31,3 @@ fn main() { let managed: @Trait = @Struct { a:2, b: 3.0 } as @Trait; let unique: ~Trait = ~Struct { a:2, b: 3.0 } as ~Trait; } - -fn zzz() {()}