Displaying 2 results from an estimated 2 matches for "child_iterator".
2004 Aug 27
1
[LLVMdev] Help getting condition of branch instructions in pass
Hi, this is a bit of a newbie question:
I am trying to discover, given a block with a conditional and its
successors, which condition (T/F) each successor applies to.
There's almost identical code in CFGPrinter.cpp, but where it gets
called in GraphWriter.h, the child_iterator type is a pretty hairy
thing, so I still don't quite understand how to get one from a
BasicBlock in my own code...
Is there a simpler way to do it without getting into all that?
-mike
2009 Jun 15
3
[LLVMdev] Some df_iterator and po_iterator issues
...appropriate here.
--snip--
While trying to eleminate as much std::tr1::function as possible I
stumbled over a design flaw in llvm::df_iterator.
Consider the following code:
void for_all_stmts(Stmt* S, const std::tr1::function<void(Stmt*)>& fn)
{
if (S)
{
fn(S);
for (Stmt::child_iterator i = S->child_begin(), e = S->child_end();
i != e; ++i)
{
for_all_stmts(*i, fn);
}
}
}
In a first step I want to replace this with:
void for_all_stmts(Stmt* S, const std::tr1::function<void(Stmt*)>& fn)
{
for (llvm::df_iterator<Stmt*> i = llvm::df_begin(S),...