diff options
author | liushuyu <liushuyu011@gmail.com> | 2023-09-09 14:19:06 -0600 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2025-01-10 10:10:01 +0000 |
commit | 077bd4618b627c8ce177b267bf971d0b1861645b (patch) | |
tree | 70a0d23026a14ecc590e42f89e36b20e00681bb2 /gcc/rust/rust-lang.cc | |
parent | b4a525ce39716cd1e9355b8503c78f3dd0fdbbb3 (diff) | |
download | gcc-077bd4618b627c8ce177b267bf971d0b1861645b.zip gcc-077bd4618b627c8ce177b267bf971d0b1861645b.tar.gz gcc-077bd4618b627c8ce177b267bf971d0b1861645b.tar.bz2 |
rust/intrinsic: add try intrinsic and panic strategy options
gcc/rust/ChangeLog:
* backend/rust-compile-intrinsic.cc: add `try` intrinsic handler.
* lang.opt: add `-frust-panic` option.
* rust-lang.cc: enable exception handler code generation.
* rust-session-manager.cc: add getter and setter for panic
strategy option.
* rust-session-manager.h: Likewise.
Signed-off-by: Zixing Liu <liushuyu011@gmail.com>
Diffstat (limited to 'gcc/rust/rust-lang.cc')
-rw-r--r-- | gcc/rust/rust-lang.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gcc/rust/rust-lang.cc b/gcc/rust/rust-lang.cc index 258b5f3..df06026 100644 --- a/gcc/rust/rust-lang.cc +++ b/gcc/rust/rust-lang.cc @@ -146,6 +146,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 (); |