From: Benjamin Y. <ben...@fa...> - 2009-06-09 00:56:12
|
On Jun 8, 2009, at 5:09 PM, Roy Shea wrote: >> For "If" statement nodes, is there any easy way to know which of the >> statements in the "succs" list corresponds to the "then" (or "else") >> branch? > > I'm pretty sure that you can get at this information by looking into > the > If stmtkind used by CIL. It is defined is: > > If of exp * block * block * location > > where the first block is the "then" branch and the second block is the > "else" branch. You could then unpack the block of interest and try to > match it to one of the succs. That is basically what I'm doing. It's just that there are rather a lot of cases, so it occurred to me that there might be a better way. If not, that's fine, though. Thanks, Ben |