This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] New pragma handling mechanism.
Hi.
I want to add a type to each pragma. This type will let front end know
what to do with pragma. At present all pragmas are handled separately
from front end so all have PRAGMA_NORMAL type. Which means that front
end should just call a handler and nothing more. OpenMP pragmas will
have different types, so the front end will be able to handle them
specially.
I have few questions.
1. What do you think of these?
2. How to tell GC to do nothing with a pointer in union?
We have:
struct pragma entry
{
...
unsigned char type;
union {
pragma_cb handler;
struct pragma_entry *space;
} u;
};
struct pragma_node
{
unsigned char type;
pragma_cb handler;
};
struct cpp_token GTY(())
{
...
union cpp_token_u
{
...
/* Pragma node. */
struct pragma_node * GTY ((tag ("CPP_TOKEN_FLD_PRAGMA"))) pragma;
} GTY ((desc ("cpp_token_val_index (&%1)"))) val;
};
cpp_token.val.pragma points inside the pragma_entry. pragma_entry is
not marked GTY().
How to tell GC to do nothing with cpp_token.val.pragma? Is the skip()
what I want?
--
Dmitry