[PATCH] Make llvm.eh.begincatch use an outparam

Andy Kaylor andrew.kaylor at intel.com
Mon Mar 2 12:56:23 PST 2015


I think this is a reasonable approach.  I've noted a couple of places in the tests where artifacts of the earlier use of llvm.eh.begin catch are still hanging around, but I think it's fine if you want to just leave that for a later revision that strips the code that is generating those lines.  I can even roll that into one of my in-flight change sets if this is going to land before those do.


================
Comment at: test/CodeGen/X86/cppeh-catch-scalar.ll:65
@@ -64,7 +64,3 @@
   %exn11 = load i8** %exn.slot
-  %4 = call i8* @llvm.eh.begincatch(i8* %exn11) #3
-  %5 = bitcast i8* %4 to i32*
-  %6 = load i32* %5, align 4
-  store i32 %6, i32* %i, align 4
-  %7 = load i32* %i, align 4
-  call void @_Z10handle_inti(i32 %7)
+  %i.i8 = bitcast i32* %i to i8*
+  call void @llvm.eh.begincatch(i8* %exn11, i8* %i.i8) #3
----------------
Any reason that the bitcast isn't done in the call line?

================
Comment at: test/CodeGen/X86/cppeh-catch-scalar.ll:90
@@ -91,3 +89,3 @@
 ; CHECK:   %eh.data = bitcast i8* %eh.alloc to %struct._Z4testv.ehdata*
 ; CHECK:   %eh.obj.ptr = getelementptr inbounds %struct._Z4testv.ehdata* %eh.data, i32 0, i32 1
 ; CHECK:   %eh.obj = load i8** %eh.obj.ptr
----------------
This should go away.

================
Comment at: test/CodeGen/X86/cppeh-frame-vars.ll:184
@@ -185,3 +183,3 @@
 ; CHECK:   %eh.data = bitcast i8* %eh.alloc to %"struct.\01?test@@YAXXZ.ehdata"*
 ; CHECK:   %eh.obj.ptr = getelementptr inbounds %"struct.\01?test@@YAXXZ.ehdata"* %eh.data, i32 0, i32 1
 ; CHECK:   %eh.obj = load i8** %eh.obj.ptr
----------------
This should go away.

http://reviews.llvm.org/D7920

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list