This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
What is the difference between datatype "const_tree" and "tree" ?
- From: "冠人 王 via gcc" <gcc at gcc dot gnu dot org>
- To: "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>
- Date: Thu, 5 Jul 2018 04:58:36 +0000 (UTC)
- Subject: What is the difference between datatype "const_tree" and "tree" ?
- References: <1944714078.2881309.1530766716580.ref@mail.yahoo.com>
- Reply-to: 冠人 王 <guanjen375 at yahoo dot com dot tw>
In the function emit_side_effect_warnings, I find its inputs are "location_t loc" and "tree expr".
And, there is a function warn_if_unused_value called by emit_side_effect_warnings:
emit_side_effect_warnings(location_t loc, tree expr){ ...
else
warn_if_unused_value(expr,loc)
}
To call warn_if_unused_value, we use location_t loc and tree expr as inputs
In the function warn_if_unused_value, I find its inputs are "location_t loc" and "const_tree expr"
warn_if_unused_value(const_tree exp, location_t locus){ ...
}
I am confused about the difference between "tree expr" and "const_tree expr" since
if I modify the"const_tree" to "tree", I make failed.
Besides this, I try to use debug_tree function to dump the imformation of the node.
I am successful when I use it in the function emit_side_effect_warnings but
not in the function warn_if_unused_value