Skip to content

Commit 5fee22b

Browse files
committed
---
yaml --- r: 23062 b: refs/heads/master c: 8c95fed h: refs/heads/master v: v3
1 parent 393f778 commit 5fee22b

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
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 438765da59075339c99499e201384e835187f0ae
2+
refs/heads/master: 8c95feda3961efaffe4461d775b029f92a1744c4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cd6f24f9d14ac90d167386a56e7a6ac1f0318195
55
refs/heads/try: ffbe0e0e00374358b789b0037bcb3a577cd218be

trunk/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) }

trunk/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)