[LLVMdev] Personality function for llvm.gcroot

Anton Nadolskiy a.nadolskiy at samsung.com
Tue May 27 07:18:05 PDT 2014


Thanks, Joerg!

Why I can't catch exception with gcc_personality? I have lpad block:

 lpad:                                             ; preds = %while.body
  %lpad1 = landingpad { i8*, i32 } personality i32 (...)*
@__gcc_personality_v0
          catch i8* null
  %exn = extractvalue { i8*, i32 } %lpad1, 0
  store i8* %exn, i8** %exn.slot
  %ehselector = extractvalue { i8*, i32 } %lpad1, 1
  store i32 %ehselector, i32* %ehselector.slot
  br label %catch
 
but exception just falls through. With  @__gxx_personality_v0 instead
everything works fine. Throwing code is like this:

  %0 = call i8* @__cxa_allocate_exception(i64 8)
  %1 = bitcast i8* %0 to i8**
  store i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), i8** %1
  invoke void @__cxa_throw(i8* %0, i8* null, i8* null)
          to label %unreachable unwind label %lpad

-----Original Message-----
From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On
Behalf Of Joerg Sonnenberger
Sent: Friday, May 23, 2014 7:49 PM
To: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] Personality function for llvm.gcroot

On Fri, May 23, 2014 at 07:01:25PM +0400, Anton Nadolskiy wrote:
> And what's the difference between these two functions anyway?

__gcc_personality_v0 is for C code, which uses it for the cleanup attribute.
__cxx_personality_v0 is for C++ code and associated functionaltiy.

Joerg
_______________________________________________
LLVM Developers mailing list
LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev




More information about the llvm-dev mailing list