mirror of
				https://github.com/c64scene-ar/llvm-6502.git
				synced 2025-10-30 16:17:05 +00:00 
			
		
		
		
	The personality routine currently lives in the LandingPadInst. This isn't desirable because: - All LandingPadInsts in the same function must have the same personality routine. This means that each LandingPadInst beyond the first has an operand which produces no additional information. - There is ongoing work to introduce EH IR constructs other than LandingPadInst. Moving the personality routine off of any one particular Instruction and onto the parent function seems a lot better than have N different places a personality function can sneak onto an exceptional function. Differential Revision: http://reviews.llvm.org/D10429 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239940 91177308-0d34-0410-b5e6-96231b3b80d8
		
			
				
	
	
		
			42 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			1.4 KiB
		
	
	
	
		
			LLVM
		
	
	
	
	
	
| ; RUN: llc < %s -mtriple=i686-pc-linux-gnu -o -     | FileCheck %s  --check-prefix=LIN
 | |
| ; RUN: llc < %s -mtriple=i386-pc-mingw32 -o -       | FileCheck %s  --check-prefix=WIN
 | |
| ; RUN: llc < %s -mtriple=i686-pc-windows-gnu -o -   | FileCheck %s  --check-prefix=WIN
 | |
| ; RUN: llc < %s -mtriple=x86_64-pc-windows-gnu -o - | FileCheck %s  --check-prefix=WIN64
 | |
| 
 | |
| ; LIN: .cfi_personality 0, __gnat_eh_personality
 | |
| ; LIN: .cfi_lsda 0, .Lexception0
 | |
| ; WIN: .cfi_personality 0, ___gnat_eh_personality
 | |
| ; WIN: .cfi_lsda 0, Lexception0
 | |
| ; WIN64: .seh_handler __gnat_eh_personality
 | |
| ; WIN64: .seh_handlerdata
 | |
| 
 | |
| @error = external global i8
 | |
| 
 | |
| define void @_ada_x() personality i8* bitcast (i32 (...)* @__gnat_eh_personality to i8*) {
 | |
| entry:
 | |
|   invoke void @raise()
 | |
|           to label %eh_then unwind label %unwind
 | |
| 
 | |
| unwind:                                           ; preds = %entry
 | |
|   %eh_ptr = landingpad { i8*, i32 }
 | |
|               catch i8* @error
 | |
|   %eh_select = extractvalue { i8*, i32 } %eh_ptr, 1
 | |
|   %eh_typeid = tail call i32 @llvm.eh.typeid.for(i8* @error)
 | |
|   %tmp2 = icmp eq i32 %eh_select, %eh_typeid
 | |
|   br i1 %tmp2, label %eh_then, label %Unwind
 | |
| 
 | |
| eh_then:                                          ; preds = %unwind, %entry
 | |
|   ret void
 | |
| 
 | |
| Unwind:                                           ; preds = %unwind
 | |
|   resume { i8*, i32 } %eh_ptr
 | |
| }
 | |
| 
 | |
| declare void @raise()
 | |
| 
 | |
| declare i32 @llvm.eh.typeid.for(i8*) nounwind
 | |
| 
 | |
| declare i32 @__gnat_eh_personality(...)
 | |
| 
 | |
| declare i32 @_Unwind_Resume(...)
 |