about summary refs log tree commit diff
path: root/src/rustc
diff options
context:
space:
mode:
authorGraydon Hoare <graydon@pobox.com>2012-07-23 16:47:35 -0700
committerGraydon Hoare <graydon@pobox.com>2012-07-23 16:47:35 -0700
commit7680f504c2c9934a617ff20b1d852ea191c6bc52 (patch)
treee03310be12902e895ec196000b120f9a5f106486 /src/rustc
parentdf4db83ed840b042942a26ed34f126d9829fcd11 (diff)
parentd8c75cfbe7951f62296b4c9311811a0f414ab0f7 (diff)
downloadrust-7680f504c2c9934a617ff20b1d852ea191c6bc52.tar.gz
rust-7680f504c2c9934a617ff20b1d852ea191c6bc52.zip
Merge pull request #2998 from elliottslaughter/no-landing-pads
Add debug flag to turn off landing pads.
Diffstat (limited to 'src/rustc')
-rw-r--r--src/rustc/driver/session.rs5
-rw-r--r--src/rustc/middle/trans/base.rs4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/rustc/driver/session.rs b/src/rustc/driver/session.rs
index c5643c90be3..64ae30895c4 100644
--- a/src/rustc/driver/session.rs
+++ b/src/rustc/driver/session.rs
@@ -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 \
@@ -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)
     ]
 }
 
diff --git a/src/rustc/middle/trans/base.rs b/src/rustc/middle/trans/base.rs
index 05c43240165..1d9080d2b19 100644
--- a/src/rustc/middle/trans/base.rs
+++ b/src/rustc/middle/trans/base.rs
@@ -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;
     }