This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Need GC help


On Mon, Nov 03, 2003 at 04:40:41PM -0500, Richard Kenner wrote:
>     > Look at ada/ada-tree.h at the TYPE_DIGITS_VALUE macro.
>     > How do I tell GC that that isn't a pointer?
>     
>     You do not, use a struct for the long, just like all other front-ends.
> 
> Sorry, I don't follow you.  Can you point me to an example?

struct lang_type GTY(())
{
  union {
    union lang_tree_node
      GTY((desc ("TREE_CODE (&%h.generic) == GNAT_LOOP_ID"),
	   tag ("0"))) t;

    long GTY((tag ("1"))) digits_value;

  } GTY ((desc ("<condition that's true when digits_value is used>"))) u;
};

#define TYPE_CI_CO_LIST(NODE)   \
  (&TYPE_LANG_SPECIFIC (FUNCTION_TYPE_CHECK (NODE))->u.t.generic)
...
#define TYPE_DIGITS_VALUE(NODE)  \
  (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->u.digits_value)



r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]