Add method comment for opt::Function::WhileEachInst (#2867)

Also, say that ForEachInst and ForEachParam process instructions/parameters
in order.
This commit is contained in:
David Neto 2019-09-23 08:36:48 -05:00 committed by Steven Perron
parent 6b07212659
commit 8d0ca43da5

View File

@ -104,19 +104,24 @@ class Function {
});
}
// Runs the given function |f| on each instruction in this function, and
// optionally on debug line instructions that might precede them.
// Runs the given function |f| on instructions in this function, in order,
// and optionally on debug line instructions that might precede them.
void ForEachInst(const std::function<void(Instruction*)>& f,
bool run_on_debug_line_insts = false);
void ForEachInst(const std::function<void(const Instruction*)>& f,
bool run_on_debug_line_insts = false) const;
// Runs the given function |f| on instructions in this function, in order,
// and optionally on debug line instructions that might precede them.
// If |f| returns false, iteration is terminated and this function returns
// false.
bool WhileEachInst(const std::function<bool(Instruction*)>& f,
bool run_on_debug_line_insts = false);
bool WhileEachInst(const std::function<bool(const Instruction*)>& f,
bool run_on_debug_line_insts = false) const;
// Runs the given function |f| on each parameter instruction in this function,
// and optionally on debug line instructions that might precede them.
// in order, and optionally on debug line instructions that might precede
// them.
void ForEachParam(const std::function<void(const Instruction*)>& f,
bool run_on_debug_line_insts = false) const;
void ForEachParam(const std::function<void(Instruction*)>& f,