aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-lang.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-08-17 15:44:38 +0000
committerGitHub <noreply@github.com>2021-08-17 15:44:38 +0000
commit3a944e1b7a49dae8c0970f9a491121ab84ff2e0b (patch)
tree47c7ffaa62bd37723993795708a98a7b56ff9ab5 /gcc/rust/rust-lang.cc
parent335cd53ddadbe43f2a1c2187fcbd28cf04fe911e (diff)
parentc4bab97a9911250409ab5e72bb649fe3818e9502 (diff)
downloadgcc-3a944e1b7a49dae8c0970f9a491121ab84ff2e0b.zip
gcc-3a944e1b7a49dae8c0970f9a491121ab84ff2e0b.tar.gz
gcc-3a944e1b7a49dae8c0970f9a491121ab84ff2e0b.tar.bz2
Merge #632
632: Use default type_for_size langhook r=philberty a=dkm From Mark Wielaard : https://gcc.gnu.org/pipermail/gcc-rust/2021-August/000144.html > The gcc constant folding code uses the type_for_size langhook. Use the > default implementation instead of crashing when the langhook is > called. Add a new testcase "prims_struct_eq.rs" that creates trees > that triggers the constant folding. > > Also remove the write_globals langhook which was removed when early > debug was integrated into gcc. Co-authored-by: Mark Wielaard <mark@klomp.org>
Diffstat (limited to 'gcc/rust/rust-lang.cc')
-rw-r--r--gcc/rust/rust-lang.cc17
1 files changed, 0 insertions, 17 deletions
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc
index 462e834..b4f8cbe 100644
--- a/gcc/rust/rust-lang.cc
+++ b/gcc/rust/rust-lang.cc
@@ -224,20 +224,6 @@ grs_langhook_type_for_mode (machine_mode mode, int unsignedp)
return NULL;
}
-/* This appears to be used for creating different types for different bit sizes
- * (e.g. int and long). Also, the Go frontend calls this from type_for_mode to
- * determine the type from a specific bitsize for integer types.
- * FIXME: change this when working on AST-GENERIC conversion to allow the full
- * range of Rust type sizes. */
-static tree
-grs_langhook_type_for_size (unsigned int bits ATTRIBUTE_UNUSED,
- int unsignedp ATTRIBUTE_UNUSED)
-{
- gcc_unreachable ();
- return NULL_TREE;
- // nothing at the moment, but change later
-}
-
// Record a builtin function. We just ignore builtin functions.
static tree
grs_langhook_builtin_function (tree decl ATTRIBUTE_UNUSED)
@@ -420,7 +406,6 @@ rust_localize_identifier (const char *ident)
#undef LANG_HOOKS_POST_OPTIONS
#undef LANG_HOOKS_PARSE_FILE
#undef LANG_HOOKS_TYPE_FOR_MODE
-#undef LANG_HOOKS_TYPE_FOR_SIZE
#undef LANG_HOOKS_BUILTIN_FUNCTION
#undef LANG_HOOKS_GLOBAL_BINDINGS_P
#undef LANG_HOOKS_PUSHDECL
@@ -442,12 +427,10 @@ rust_localize_identifier (const char *ident)
*/
#define LANG_HOOKS_PARSE_FILE grs_langhook_parse_file
#define LANG_HOOKS_TYPE_FOR_MODE grs_langhook_type_for_mode
-#define LANG_HOOKS_TYPE_FOR_SIZE grs_langhook_type_for_size
#define LANG_HOOKS_BUILTIN_FUNCTION grs_langhook_builtin_function
#define LANG_HOOKS_GLOBAL_BINDINGS_P grs_langhook_global_bindings_p
#define LANG_HOOKS_PUSHDECL grs_langhook_pushdecl
#define LANG_HOOKS_GETDECLS grs_langhook_getdecls
-#define LANG_HOOKS_WRITE_GLOBALS grs_langhook_write_globals
#define LANG_HOOKS_GIMPLIFY_EXPR grs_langhook_gimplify_expr
#define LANG_HOOKS_EH_PERSONALITY grs_langhook_eh_personality