diff options
Diffstat (limited to 'gcc/rust/rust-lang.cc')
-rw-r--r-- | gcc/rust/rust-lang.cc | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc index 258b5f3..9409d81 100644 --- a/gcc/rust/rust-lang.cc +++ b/gcc/rust/rust-lang.cc @@ -16,9 +16,8 @@ // along with GCC; see the file COPYING3. If not see // <http://www.gnu.org/licenses/>. +#include "rust-system.h" #include "rust-diagnostics.h" -#include "config.h" -#include "system.h" #include "coretypes.h" #include "target.h" #include "tree.h" @@ -66,7 +65,6 @@ * e.g. HIR conversion. */ -#include "rust-system.h" #include "rust-session-manager.h" #include "rust-tree.h" @@ -146,6 +144,8 @@ grs_langhook_init_options_struct (struct gcc_options *opts) opts->x_warn_unused_result = 1; /* lets warn for infinite recursion*/ opts->x_warn_infinite_recursion = 1; + /* Enable exception handling (aka `panic!` in Rust) */ + opts->x_flag_exceptions = 1; // nothing yet - used by frontends to change specific options for the language Rust::Session::get_instance ().init_options (); @@ -374,7 +374,13 @@ rust_localize_identifier (const char *ident) return identifier_to_locale (ident); } -extern const attribute_spec grs_langhook_common_attribute_table[]; +extern const struct scoped_attribute_specs grs_langhook_gnu_attribute_table; +extern const struct scoped_attribute_specs grs_langhook_common_attribute_table; + +const scoped_attribute_specs *const grs_langhook_attribute_table[] = { + &grs_langhook_gnu_attribute_table, + &grs_langhook_common_attribute_table, +}; /* The language hooks data structure. This is the main interface between the GCC * front-end and the GCC middle-end/back-end. A list of language hooks could be @@ -395,8 +401,7 @@ extern const attribute_spec grs_langhook_common_attribute_table[]; #undef LANG_HOOKS_WRITE_GLOBALS #undef LANG_HOOKS_GIMPLIFY_EXPR #undef LANG_HOOKS_EH_PERSONALITY - -#undef LANG_HOOKS_COMMON_ATTRIBUTE_TABLE +#undef LANG_HOOKS_ATTRIBUTE_TABLE #define LANG_HOOKS_NAME "GNU Rust" #define LANG_HOOKS_INIT grs_langhook_init @@ -418,7 +423,7 @@ extern const attribute_spec grs_langhook_common_attribute_table[]; #define LANG_HOOKS_GIMPLIFY_EXPR grs_langhook_gimplify_expr #define LANG_HOOKS_EH_PERSONALITY grs_langhook_eh_personality -#define LANG_HOOKS_COMMON_ATTRIBUTE_TABLE grs_langhook_common_attribute_table +#define LANG_HOOKS_ATTRIBUTE_TABLE grs_langhook_attribute_table #if CHECKING_P |