This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Question about DECL_UID of struct field
- From: "Haifeng He" <hehaifeng2nd at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 27 Feb 2008 02:16:15 -0700
- Subject: Question about DECL_UID of struct field
Hi,
I am trying to write a pass to do value profiling of struct fields.
For example, given a struct
struct S {
a;
b;
}
I would like to profile values of every instance of S.a and S.b.
Currently I use DECL_UID(a) and DELC_UID(b) to represent the two fields.
However, I found out that, for different compilation units (i.e.,
different source files), the DECL_UID are different. Therefore, S.a
and S.b will be treated
differently for different source files. Is there a way that I can get
a global unique identification of
struct fields?
thanks
Haifeng