aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/rust-session-manager.cc
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-03-17 13:15:45 +0000
committerGitHub <noreply@github.com>2022-03-17 13:15:45 +0000
commit1a14348afefc62313e38156fde768744378f9ebf (patch)
tree75b49c17766404d0bda46c54d3df337e1449fd75 /gcc/rust/rust-session-manager.cc
parentb7baee87956913a4debd7e4bad29ddc9b9645325 (diff)
parente30d07de5c89e0f8a4d8304846e21f8e775c9f79 (diff)
downloadgcc-1a14348afefc62313e38156fde768744378f9ebf.zip
gcc-1a14348afefc62313e38156fde768744378f9ebf.tar.gz
gcc-1a14348afefc62313e38156fde768744378f9ebf.tar.bz2
Merge #1035
1035: Handle -fsyntax-only r=CohenArthur a=CohenArthur Handle the -fsyntax-only properly from the rust frontend. This flag allows checking for syntax and stopping after that, skipping further passes of the pipeline. The flag was accepted by the frontend, but was not used anywhere. Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/rust-session-manager.cc')
-rw-r--r--gcc/rust/rust-session-manager.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/rust-session-manager.cc b/gcc/rust/rust-session-manager.cc
index 396f35f..96d94b2 100644
--- a/gcc/rust/rust-session-manager.cc
+++ b/gcc/rust/rust-session-manager.cc
@@ -542,6 +542,11 @@ Session::parse_file (const char *filename)
rust_debug ("\033[0;31mSUCCESSFULLY PARSED CRATE \033[0m");
+ // If -fsyntax-only was passed, we can just skip the remaining passes.
+ // Parsing errors are already emitted in `parse_crate()`
+ if (flag_syntax_only)
+ return;
+
// register plugins pipeline stage
register_plugins (parsed_crate);
rust_debug ("\033[0;31mSUCCESSFULLY REGISTERED PLUGINS \033[0m");