aboutsummaryrefslogtreecommitdiff
path: root/gcc/langhooks.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2019-10-29 08:39:45 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2019-10-29 08:39:45 +0000
commitac2cfa6cc35175311f92c25acbdd244f0f3bbb87 (patch)
treec61b52f882b58f537f31ac567c953b78eeef6644 /gcc/langhooks.h
parent740785381ec9944c861dcc29b420c96aa933f040 (diff)
downloadgcc-ac2cfa6cc35175311f92c25acbdd244f0f3bbb87.zip
gcc-ac2cfa6cc35175311f92c25acbdd244f0f3bbb87.tar.gz
gcc-ac2cfa6cc35175311f92c25acbdd244f0f3bbb87.tar.bz2
Add a simulate_enum_decl langhook
Similarly to the simulate_builtin_function_decl patch, this one adds a hook for simulating an enum declaration in the source language. Again, the main SVE ACLE patch has tests for various error conditions. 2019-10-29 Richard Sandiford <richard.sandiford@arm.com> gcc/ * coretypes.h (string_int_pair): New typedef. * langhooks-def.h (LANG_HOOKS_SIMULATE_ENUM_DECL): Define. (LANG_HOOKS_FOR_TYPES_INITIALIZER): Include it. * langhooks.h (lang_hooks_for_types::simulate_enum_decl): New hook. gcc/c/ * c-tree.h (c_simulate_enum_decl): Declare. * c-decl.c (c_simulate_enum_decl): New function. * c-objc-common.h (LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above. gcc/cp/ * cp-objcp-common.h (cxx_simulate_enum_decl): Declare. (LANG_HOOKS_SIMULATE_ENUM_DECL): Define to the above. * decl.c (cxx_simulate_enum_decl): New function. From-SVN: r277555
Diffstat (limited to 'gcc/langhooks.h')
-rw-r--r--gcc/langhooks.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index 76f530e..e50162f 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -64,6 +64,10 @@ struct lang_hooks_for_types
language-specific processing is required. */
tree (*make_type) (enum tree_code);
+ /* Make an enum type with the given name and values, associating
+ them all with the given source location. */
+ tree (*simulate_enum_decl) (location_t, const char *, vec<string_int_pair>);
+
/* Return what kind of RECORD_TYPE this is, mainly for purposes of
debug information. If not defined, record types are assumed to
be structures. */