On Mon, 15 Jun 2020, Shuai Wang via Gcc wrote:
Dear Marc,
Thank you very much! Just another quick question.. Can I iterate the
operands of a GIMPLE statement, like how I iterate a LLVM instruction in
the following way?
Instruction* instr;
for (size_t i=0; i< instr->getNumOperands();i++) {
instr->getOperand(i))
}
Sorry for such naive questions.. I actually searched the documents and
GIMPLE pretty print for a while but couldn't find such a way of accessing
arbitrary numbers of operands...
https://gcc.gnu.org/onlinedocs/gccint/GIMPLE_005fASSIGN.html
or for lower level
https://gcc.gnu.org/onlinedocs/gccint/Logical-Operators.html#Operand-vector-allocation
But really you need to look at the code of gcc. Search for places that use
SSA_NAME_DEF_STMT and see what they do with the result.
--
Marc Glisse