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. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111229/a1e1e843/attachment.html>
> 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 -- Wei-Ren Chen (陳韋任) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~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.