This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Compute all gimple statements in which a var is used
- From: Cristina Georgiana Opriceana <cristina dot opriceana at gmail dot com>
- To: gcc at gcc dot gnu dot org
- Date: Mon, 28 Mar 2016 20:23:26 +0300
- Subject: Compute all gimple statements in which a var is used
- Authentication-results: sourceware.org; auth=none
Hello,
In order to compute all the statements where a variable is used, is it
enough to rely on the SSA analysis? I tried to do something like this:
FOR_EACH_LOCAL_DECL (cfun, i, var) {
for (unsigned int i = 0; i < num_ssa_names; i++) {
if (ssa_name(i) && SSA_NAME_VAR (ssa_name(i)) == var) {
tree ssa_node = ssa_name(i);
FOR_EACH_IMM_USE_FAST (use_op, imm_iter, ssa_node) {
gimple * use_stmt = USE_STMT(use_op);
...
}
Thanks,
Cristina