Skip to content

Commit

Permalink
Merge pull request #2998 from elliottslaughter/no-landing-pads
Browse files Browse the repository at this point in the history
Add debug flag to turn off landing pads.
  • Loading branch information
graydon committed Jul 23, 2012
2 parents df4db83 + d8c75cf commit 7680f50
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/rustc/driver/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ const coherence: uint = 512u;
const borrowck_stats: uint = 1024u;
const borrowck_note_pure: uint = 2048;
const borrowck_note_loan: uint = 4096;
const no_landing_pads: uint = 8192;

fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
~[(~"ppregions", ~"prettyprint regions with \
Expand All @@ -58,7 +59,9 @@ fn debugging_opts_map() -> ~[(~str, ~str, uint)] {
(~"borrowck-note-pure", ~"note where purity is req'd",
borrowck_note_pure),
(~"borrowck-note-loan", ~"note where loans are req'd",
borrowck_note_loan)
borrowck_note_loan),
(~"no-landing-pads", ~"omit landing pads for unwinding",
no_landing_pads)
]
}

Expand Down
4 changes: 4 additions & 0 deletions src/rustc/middle/trans/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3224,6 +3224,10 @@ fn invoke(bcx: block, llfn: ValueRef, llargs: ~[ValueRef]) -> block {
}

fn need_invoke(bcx: block) -> bool {
if (bcx.ccx().sess.opts.debugging_opts & session::no_landing_pads != 0) {
ret false;
}

if have_cached_lpad(bcx) {
ret true;
}
Expand Down

0 comments on commit 7680f50

Please sign in to comment.