[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
questions about Tags and Jimple and Baf
Hi,
Here is what I would like to do:
1) In Jimple, determine if a method return value is consumed or not. I
already have this working, I just check if an InvokeExpr appears as the
rvalue of an AssignStmt (it's can't be consumed otherwise because Jimple
is stackless).
2) Attach a Tag to the InvokeExpr in question saying whether or not the
method return value is consumed.
3) In Baf, recognize all <X>InvokeInst's that have Tags from the
preceding Jimple phase, and insert two StaticInvokeInst's of my own, one
immediately before, and one immediately after the <X>InvokeInst. The
specific call in the second StaticInvokeInst will depend on whether or
not the Tag says the method return value is consumed or not.
It seems that using a TagAggregrator is not appropriate in this case,
since I'm just passing information between Jimple and Baf and not
actually creating any attributes. Is that right?
Also, will it work if I attach Tags to the ValueBox returned by either
InvokeStmt.getInvokeExprBox() or AssignStmt.getRightOpBox(), and then
retrieve them in Baf using <X>InvokeInst.getTag()? Is there an
obviously better way of doing things? I'm avoiding doing this with
attributes for now because I think it would take longer to get working.
Cheers,
Chris