Taking invoke instructions' labels

Hello everybody,
I am writing a pass, that does something on strings. It’s a long story, so I will write shortly.
If I have an iterator on invoke instruction, how can I take its label parameters?
For example,

invoke void @_ZNSsC1EPKcRKSaIcE(%“class.std::basic_string”* %str, i8* getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), %“class.std::allocator”* %2)
to label %7 unwind label %20

Here I am trying to get the label %7 and label %20. Is that possible? We have tried just to increment our iterator, but it didn’t help…

Sincerely, Schuhmacher.

invoke void @_ZNSsC1EPKcRKSaIcE(%"class.std::basic_string"* %str, i8*
getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0),
%"class.std::allocator"* %2)
          to label %7 unwind label %20

Here I am trying to get the *label %7* and *label %20*. Is that possible?
We have tried just to increment our iterator, but it didn't help...

  Try "getNormalDest()" and "getUnwindDest()" functions?
  http://llvm.org/docs/doxygen/html/classllvm_1_1InvokeInst.html

HTH,
chenwj

Hi Schuhmacher,

I am writing a pass, that does something on strings. It's a long story, so I
will write shortly.
If I have an iterator on invoke instruction, how can I take its label parameters?
For example,
invoke void @_ZNSsC1EPKcRKSaIcE(%"class.std::basic_string"* %str, i8*
getelementptr inbounds ([6 x i8]* @.str, i32 0, i32 0), %"class.std::allocator"* %2)
           to label %7 unwind label %20

Here I am trying to get the label %7 and label %20 . Is that possible? We have
tried just to increment our iterator, but it didn't help...

if I is an InvokeInst*, then I->getNormalDest() gets you the basic block you get
to if no exception is unwound, while I->getUnwindDest() gets the basic block you
unwind to.

Ciao, Duncan.