diff options
author | Jakub Dupak <dev@jakubdupak.com> | 2023-10-19 11:37:41 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:09:26 +0100 |
commit | 2f6161e47fbfee41a3d22de21ce58efe5be01d90 (patch) | |
tree | a854d8c45f0a601b835b8fe47863eae93f14ef5e /gcc/rust/rust-session-manager.cc | |
parent | 206fc6de9827809cef89b95d1eeb55c5632dd66a (diff) | |
download | gcc-2f6161e47fbfee41a3d22de21ce58efe5be01d90.zip gcc-2f6161e47fbfee41a3d22de21ce58efe5be01d90.tar.gz gcc-2f6161e47fbfee41a3d22de21ce58efe5be01d90.tar.bz2 |
gccrs: borrowck: Execute only with CLI flag
gcc/rust/ChangeLog:
* lang.opt: CLI flag.
* rust-session-manager.cc (Session::compile_crate): Guard execution.
Signed-off-by: Jakub Dupak <dev@jakubdupak.com>
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r-- | gcc/rust/rust-session-manager.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc index 8e69fc3..1d95291 100644 --- a/gcc/rust/rust-session-manager.cc +++ b/gcc/rust/rust-session-manager.cc @@ -583,9 +583,11 @@ void Session::compile_crate(const char *filename) { if (last_step == CompileOptions::CompileStep::BorrowCheck) return; - const bool dump_bir = - options.dump_option_enabled(CompileOptions::DumpOption::BIR_DUMP); - HIR::BorrowChecker(dump_bir).go(hir); + if (flag_borrowcheck) { + const bool dump_bir = + options.dump_option_enabled(CompileOptions::DumpOption::BIR_DUMP); + HIR::BorrowChecker(dump_bir).go(hir); + } if (saw_errors()) return; |