about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorRicho Healey <richo@psych0tik.net>2015-06-27 14:39:22 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-07-16 20:25:51 -0700
commitc55d3f1ba1e78466d2f5703a9e291f4849ddcc94 (patch)
treef69a1d4f336bd11aa9ac09a45834c23bc7d03ea9 /src
parentea317e8ea40f0d50fc5d1874bed039040f978596 (diff)
downloadrust-c55d3f1ba1e78466d2f5703a9e291f4849ddcc94.tar.gz
rust-c55d3f1ba1e78466d2f5703a9e291f4849ddcc94.zip
rt: Move personality to functions from their landing pads
This is for llvm/cc714e214298cfbf11de65b46de31900d51422cf
Diffstat (limited to 'src')
-rw-r--r--src/rt/rust_try.ll17
-rw-r--r--src/rt/rust_try_msvc_64.ll8
2 files changed, 15 insertions, 10 deletions
diff --git a/src/rt/rust_try.ll b/src/rt/rust_try.ll
index 845fc097cdc..8643131d0fb 100644
--- a/src/rt/rust_try.ll
+++ b/src/rt/rust_try.ll
@@ -14,7 +14,9 @@
 
 ; See also: libstd/rt/unwind/mod.rs
 
-define i8* @rust_try(void (i8*)* %f, i8* %env) {
+define i8* @rust_try(void (i8*)* %f, i8* %env)
+    personality i8* bitcast (i32 (...)* @rust_eh_personality_catch to i8*)
+{
 
     %1 = invoke i8* @rust_try_inner(void (i8*)* %f, i8* %env)
         to label %normal
@@ -24,13 +26,15 @@ normal:
     ret i8* %1
 
 catch:
-    landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @rust_eh_personality_catch to i8*)
-        catch i8* null
-    ; rust_try_inner's landing pad does not resume unwinds, so execution will never reach here
+    landingpad { i8*, i32 } catch i8* null
+    ; rust_try_inner's landing pad does not resume unwinds, so execution will
+    ; never reach here
     ret i8* null
 }
 
-define internal i8* @rust_try_inner(void (i8*)* %f, i8* %env) {
+define internal i8* @rust_try_inner(void (i8*)* %f, i8* %env)
+    personality i8* bitcast (i32 (...)* @rust_eh_personality to i8*)
+{
 
     invoke void %f(i8* %env)
         to label %normal
@@ -40,8 +44,7 @@ normal:
     ret i8* null
 
 catch:
-    %1 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @rust_eh_personality to i8*)
-        catch i8* null
+    %1 = landingpad { i8*, i32 } catch i8* null
     ; extract and return pointer to the exception object
     %2 = extractvalue { i8*, i32 } %1, 0
     ret i8* %2
diff --git a/src/rt/rust_try_msvc_64.ll b/src/rt/rust_try_msvc_64.ll
index bda136d8478..c38e6081bf2 100644
--- a/src/rt/rust_try_msvc_64.ll
+++ b/src/rt/rust_try_msvc_64.ll
@@ -21,7 +21,9 @@
 ;
 ; See also: src/libstd/rt/unwind/seh.rs
 
-define i8* @rust_try(void (i8*)* %f, i8* %env) {
+define i8* @rust_try(void (i8*)* %f, i8* %env)
+    personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
+{
     invoke void %f(i8* %env)
         to label %normal
         unwind label %catch
@@ -58,8 +60,8 @@ normal:
 ; but apparently LLVM chokes on this, so we do the more complicated thing to
 ; placate it.
 catch:
-    %vals = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__C_specific_handler to i8*)
-        catch i8* bitcast (i32 (i8*, i8*)* @__rust_try_filter to i8*)
+    %vals = landingpad { i8*, i32 }
+              catch i8* bitcast (i32 (i8*, i8*)* @__rust_try_filter to i8*)
     %ehptr = extractvalue { i8*, i32 } %vals, 0
     %sel = extractvalue { i8*, i32 } %vals, 1
     %filter_sel = call i32 @llvm.eh.typeid.for(i8* bitcast (i32 (i8*, i8*)* @__rust_try_filter to i8*))