[LLVMdev] how to get the InvodInst 's Operand Name?

zhengjian zhang zhangzhengjian at gmail.com
Thu Mar 26 04:49:51 PDT 2009


Hi Duncan,

thanks ! hehe .

>> Why do you want the names anyway?

because i 'am working on llvm to support  sjlj-eh  for my target.
for my side, I  lookup the  llvm   invoke instruction to build the sjlj-eh
on sjlj-eh it's need store the  landing pad index to stack before
call __cxa_throw,
 but  it seems  no !  in llvm-backend   because it only suport dwarf-eh!
 so i have to build another node to store landingpad index to stack
before  llvm invoke instruction.
am i write for the direction?  hehe.

zhangzw





2009/3/26 Duncan Sands <baldrick at free.fr>:
> Hi zhangzw,
>
>>> invoke void @__cxa_throw(i8* %7, i8* bitcast
>>> (%struct.__fundamental_type_info_pseudo* @_ZTIi to i8*), void (i8*)*
>>> null)
>>> noreturn         to label %invcont unwind label %lpad
>>
>> >>are you trying to get the name "@_ZTIi" or "@__cxa_throw"?
>>
>> yes! i want get the name @_ZTi or @__cxa_throw,
>> the latter @__cxa_throw i can get it throw  value->getName(), but the
>>  @_ZTi it  did n't has  name!
>
> if II is the invoke instruction, you can get the names as follows:
>
>  "@__cxa_throw": II->getCalledFunction()->getValueName()
>  "@_ZTi": II->getOperand(4)->stripPointerCasts()->getValueName()
>
> The first one won't work for indirect calls.  The second one
> won't work in more complicated situations.  Why do you want
> the names anyway?
>
> Ciao,
>
> Duncan.
>



More information about the llvm-dev mailing list