Skip to content

Commit fb1159b

Browse files
committed
---
yaml --- r: 31724 b: refs/heads/dist-snap c: 8c95fed h: refs/heads/master v: v3
1 parent 26a7d28 commit fb1159b

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: d0c6ce338884ee21843f4b40bf6bf18d222ce5df
99
refs/heads/incoming: d9317a174e434d4c99fc1a37fd7dc0d2f5328d37
10-
refs/heads/dist-snap: 438765da59075339c99499e201384e835187f0ae
10+
refs/heads/dist-snap: 8c95feda3961efaffe4461d775b029f92a1744c4
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/dist-snap/src/rustc/driver/session.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ const borrowck_note_pure: uint = 2048;
4141
const borrowck_note_loan: uint = 4096;
4242
const no_landing_pads: uint = 8192;
4343
const debug_llvm: uint = 16384;
44+
const count_type_sizes: uint = 32768;
4445

4546
fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
4647
~[(~"ppregions", ~"prettyprint regions with \
@@ -63,7 +64,9 @@ fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
6364
borrowck_note_loan),
6465
(~"no-landing-pads", ~"omit landing pads for unwinding",
6566
no_landing_pads),
66-
(~"debug-llvm", ~"enable debug output from LLVM", debug_llvm)
67+
(~"debug-llvm", ~"enable debug output from LLVM", debug_llvm),
68+
(~"count-type-sizes", ~"count the sizes of aggregate types",
69+
count_type_sizes)
6770
]
6871
}
6972

@@ -179,6 +182,7 @@ impl session for session {
179182
fn ppregions() -> bool { self.debugging_opt(ppregions) }
180183
fn time_passes() -> bool { self.debugging_opt(time_passes) }
181184
fn count_llvm_insns() -> bool { self.debugging_opt(count_llvm_insns) }
185+
fn count_type_sizes() -> bool { self.debugging_opt(count_type_sizes) }
182186
fn time_llvm_passes() -> bool { self.debugging_opt(time_llvm_passes) }
183187
fn trans_stats() -> bool { self.debugging_opt(trans_stats) }
184188
fn no_asm_comments() -> bool { self.debugging_opt(no_asm_comments) }

branches/dist-snap/src/rustc/middle/trans/base.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,13 @@ fn note_unique_llvm_symbol(ccx: @crate_ctxt, sym: ~str) {
490490
fn declare_tydesc(ccx: @crate_ctxt, t: ty::t) -> @tydesc_info {
491491
let _icx = ccx.insn_ctxt(~"declare_tydesc");
492492
let llty = type_of(ccx, t);
493+
494+
if ccx.sess.count_type_sizes() {
495+
io::println(fmt!("%u\t%s",
496+
llsize_of_real(ccx, llty),
497+
ty_to_str(ccx.tcx, t)));
498+
}
499+
493500
let llsize = llsize_of(ccx, llty);
494501
let llalign = llalign_of(ccx, llty);
495502
//XXX this triggers duplicate LLVM symbols
@@ -576,6 +583,7 @@ fn emit_tydescs(ccx: @crate_ctxt) {
576583
for ccx.tydescs.each |key, val| {
577584
let glue_fn_ty = T_ptr(T_glue_fn(ccx));
578585
let ti = val;
586+
579587
let take_glue =
580588
match copy ti.take_glue {
581589
none => { ccx.stats.n_null_glues += 1u; C_null(glue_fn_ty) }

0 commit comments

Comments
 (0)