about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMark Simulacrum <mark.simulacrum@gmail.com>2016-12-18 09:46:11 -0700
committerMark Simulacrum <mark.simulacrum@gmail.com>2016-12-20 20:03:31 -0700
commita802b9f75fc7ac6985cb6b865fbc503584f139b6 (patch)
treef312cbb520c29c01541b159c19a75af0c47f55f9
parent1173db00628882300c2651e6e5d8eb6ddbcb5057 (diff)
downloadrust-a802b9f75fc7ac6985cb6b865fbc503584f139b6.tar.gz
rust-a802b9f75fc7ac6985cb6b865fbc503584f139b6.zip
Inline get_funclet
-rw-r--r--src/librustc_trans/cleanup.rs16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/librustc_trans/cleanup.rs b/src/librustc_trans/cleanup.rs
index ee02fe1d7f5..7ba36e45752 100644
--- a/src/librustc_trans/cleanup.rs
+++ b/src/librustc_trans/cleanup.rs
@@ -71,16 +71,6 @@ impl UnwindKind {
             }
         }
     }
-
-    fn get_funclet(&self, bcx: &BlockAndBuilder) -> Option<Funclet> {
-        match *self {
-            UnwindKind::CleanupPad(_) => {
-                let pad = bcx.cleanup_pad(None, &[]);
-                Funclet::msvc(pad)
-            },
-            UnwindKind::LandingPad => Funclet::gnu(),
-        }
-    }
 }
 
 impl PartialEq for UnwindKind {
@@ -212,7 +202,11 @@ impl<'tcx> CleanupScope<'tcx> {
         let mut cleanup = fcx.build_new_block("clean_custom_");
 
         // Insert cleanup instructions into the cleanup block
-        drop_val.trans(val.get_funclet(&cleanup).as_ref(), &cleanup);
+        let funclet = match val {
+            UnwindKind::CleanupPad(_) => Funclet::msvc(cleanup.cleanup_pad(None, &[])),
+            UnwindKind::LandingPad => Funclet::gnu(),
+        };
+        drop_val.trans(funclet.as_ref(), &cleanup);
 
         // Insert instruction into cleanup block to branch to the exit
         val.branch(&mut cleanup, resume_bcx.llbb());