diff options
author | Georg-Johann Lay <avr@gjlay.de> | 2016-07-20 13:07:43 +0000 |
---|---|---|
committer | Georg-Johann Lay <gjl@gcc.gnu.org> | 2016-07-20 13:07:43 +0000 |
commit | ffc2284012c94620bdbffb5276a264bd7fcf7d91 (patch) | |
tree | 3af01204ef4bbfc231cede2c4fc9c9162a5b05a7 /gcc/target.def | |
parent | 144530cf6352a55404e04bce3354e23d7c7c2d1d (diff) | |
download | gcc-ffc2284012c94620bdbffb5276a264bd7fcf7d91.zip gcc-ffc2284012c94620bdbffb5276a264bd7fcf7d91.tar.gz gcc-ffc2284012c94620bdbffb5276a264bd7fcf7d91.tar.bz2 |
target.def (addr_space): Add new diagnose_usage to hook vector.
gcc/
* target.def (addr_space): Add new diagnose_usage to hook vector.
* targhooks.c (default_addr_space_diagnose_usage): Add default
implementation and...
* targhooks.h (default_addr_space_diagnose_usage): ... its prototype.
* c/c-parser.c (c_lex_one_token) [CPP_NAME]: If the token
is some address space, call targetm.addr_space.diagnose_usage.
* doc/tm.texi.in (Named Address Spaces): Add anchor for
TARGET_ADDR_SPACE_DIAGNOSE_USAGE documentation.
* doc/tm.texi: Regenerate.
From-SVN: r238514
Diffstat (limited to 'gcc/target.def')
-rw-r--r-- | gcc/target.def | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/target.def b/gcc/target.def index a4df363..4a84922 100644 --- a/gcc/target.def +++ b/gcc/target.def @@ -3241,6 +3241,20 @@ The result is the value to be used with @code{DW_AT_address_class}.", int, (addr_space_t as), default_addr_space_debug) +/* Function to emit custom diagnostic if an address space is used. */ +DEFHOOK +(diagnose_usage, + "Define this hook if the availability of an address space depends on\n\ +command line options and some diagnostics should be printed when the\n\ +address space is used. This hook is called during parsing and allows\n\ +to emit a better diagnostic compared to the case where the address space\n\ +was not registered with @code{c_register_addr_space}. @var{as} is\n\ +the address space as registered with @code{c_register_addr_space}.\n\ +@var{loc} is the location of the address space qualifier token.\n\ +The default implementation does nothing.", + void, (addr_space_t as, location_t loc), + default_addr_space_diagnose_usage) + HOOK_VECTOR_END (addr_space) #undef HOOK_PREFIX |