public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] checks: Refactor project architecture for checking passes Date: Fri, 22 Jul 2022 13:34:46 +0000 (GMT) [thread overview] Message-ID: <20220722133446.5BF343835410@sourceware.org> (raw) https://gcc.gnu.org/g:1ab1464228ae4cb97c552b4d0dedf8a48f3dfaf6 commit 1ab1464228ae4cb97c552b4d0dedf8a48f3dfaf6 Author: Arthur Cohen <arthur.cohen@embecosm.com> Date: Fri Jul 22 10:13:26 2022 +0200 checks: Refactor project architecture for checking passes This commit adds a new `checks/` folder in the root of the Rust frontend, which then contains a folder for `lints` and one for `errors` passes. Otherwise, some error reporting passes like the privacy checks or upcoming unsafe visitor would have to live in their own folder in the root, or be part of another folder like `typecheck` or `hir` which doesn't necessarily makes sense. This should enable us to find them more easily going forward Diff: --- gcc/rust/Make-lang.in | 18 ++++++++++++------ .../{ => checks/errors}/privacy/rust-privacy-check.cc | 0 .../{ => checks/errors}/privacy/rust-privacy-check.h | 0 .../{ => checks/errors}/privacy/rust-privacy-common.h | 0 .../{ => checks/errors}/privacy/rust-privacy-ctx.cc | 0 .../{ => checks/errors}/privacy/rust-privacy-ctx.h | 0 .../errors}/privacy/rust-privacy-reporter.cc | 0 .../errors}/privacy/rust-privacy-reporter.h | 0 .../errors}/privacy/rust-pub-restricted-visitor.cc | 0 .../errors}/privacy/rust-pub-restricted-visitor.h | 0 .../{ => checks/errors}/privacy/rust-reachability.cc | 0 .../{ => checks/errors}/privacy/rust-reachability.h | 0 .../errors}/privacy/rust-visibility-resolver.cc | 0 .../errors}/privacy/rust-visibility-resolver.h | 0 .../{lint => checks/lints}/rust-lint-marklive-base.h | 0 gcc/rust/{lint => checks/lints}/rust-lint-marklive.cc | 0 gcc/rust/{lint => checks/lints}/rust-lint-marklive.h | 0 .../{lint => checks/lints}/rust-lint-scan-deadcode.h | 0 .../{lint => checks/lints}/rust-lint-unused-var.cc | 0 gcc/rust/{lint => checks/lints}/rust-lint-unused-var.h | 0 20 files changed, 12 insertions(+), 6 deletions(-) diff --git a/gcc/rust/Make-lang.in b/gcc/rust/Make-lang.in index 523680a0a52..d340e3699e1 100644 --- a/gcc/rust/Make-lang.in +++ b/gcc/rust/Make-lang.in @@ -303,8 +303,9 @@ RUST_INCLUDES = -I $(srcdir)/rust \ -I $(srcdir)/rust/resolve \ -I $(srcdir)/rust/util \ -I $(srcdir)/rust/typecheck \ - -I $(srcdir)/rust/privacy \ - -I $(srcdir)/rust/lint \ + -I $(srcdir)/rust/checks/lints \ + -I $(srcdir)/rust/checks/errors \ + -I $(srcdir)/rust/checks/errors/privacy \ -I $(srcdir)/rust/util \ -I $(srcdir)/rust/metadata @@ -367,13 +368,18 @@ rust/%.o: rust/typecheck/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< $(POSTCOMPILE) -# build rust/privacy files in rust folder -rust/%.o: rust/privacy/%.cc +# build rust/checks/lints files in rust folder +rust/%.o: rust/checks/lints/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< $(POSTCOMPILE) -# build rust/lint files in rust folder -rust/%.o: rust/lint/%.cc +# build rust/checks/errors files in rust folder +rust/%.o: rust/checks/errors/%.cc + $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< + $(POSTCOMPILE) + +# build privacy pass files in rust folder +rust/%.o: rust/checks/errors/privacy/%.cc $(COMPILE) $(RUST_CXXFLAGS) $(RUST_INCLUDES) $< $(POSTCOMPILE) diff --git a/gcc/rust/privacy/rust-privacy-check.cc b/gcc/rust/checks/errors/privacy/rust-privacy-check.cc similarity index 100% rename from gcc/rust/privacy/rust-privacy-check.cc rename to gcc/rust/checks/errors/privacy/rust-privacy-check.cc diff --git a/gcc/rust/privacy/rust-privacy-check.h b/gcc/rust/checks/errors/privacy/rust-privacy-check.h similarity index 100% rename from gcc/rust/privacy/rust-privacy-check.h rename to gcc/rust/checks/errors/privacy/rust-privacy-check.h diff --git a/gcc/rust/privacy/rust-privacy-common.h b/gcc/rust/checks/errors/privacy/rust-privacy-common.h similarity index 100% rename from gcc/rust/privacy/rust-privacy-common.h rename to gcc/rust/checks/errors/privacy/rust-privacy-common.h diff --git a/gcc/rust/privacy/rust-privacy-ctx.cc b/gcc/rust/checks/errors/privacy/rust-privacy-ctx.cc similarity index 100% rename from gcc/rust/privacy/rust-privacy-ctx.cc rename to gcc/rust/checks/errors/privacy/rust-privacy-ctx.cc diff --git a/gcc/rust/privacy/rust-privacy-ctx.h b/gcc/rust/checks/errors/privacy/rust-privacy-ctx.h similarity index 100% rename from gcc/rust/privacy/rust-privacy-ctx.h rename to gcc/rust/checks/errors/privacy/rust-privacy-ctx.h diff --git a/gcc/rust/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc similarity index 100% rename from gcc/rust/privacy/rust-privacy-reporter.cc rename to gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc diff --git a/gcc/rust/privacy/rust-privacy-reporter.h b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.h similarity index 100% rename from gcc/rust/privacy/rust-privacy-reporter.h rename to gcc/rust/checks/errors/privacy/rust-privacy-reporter.h diff --git a/gcc/rust/privacy/rust-pub-restricted-visitor.cc b/gcc/rust/checks/errors/privacy/rust-pub-restricted-visitor.cc similarity index 100% rename from gcc/rust/privacy/rust-pub-restricted-visitor.cc rename to gcc/rust/checks/errors/privacy/rust-pub-restricted-visitor.cc diff --git a/gcc/rust/privacy/rust-pub-restricted-visitor.h b/gcc/rust/checks/errors/privacy/rust-pub-restricted-visitor.h similarity index 100% rename from gcc/rust/privacy/rust-pub-restricted-visitor.h rename to gcc/rust/checks/errors/privacy/rust-pub-restricted-visitor.h diff --git a/gcc/rust/privacy/rust-reachability.cc b/gcc/rust/checks/errors/privacy/rust-reachability.cc similarity index 100% rename from gcc/rust/privacy/rust-reachability.cc rename to gcc/rust/checks/errors/privacy/rust-reachability.cc diff --git a/gcc/rust/privacy/rust-reachability.h b/gcc/rust/checks/errors/privacy/rust-reachability.h similarity index 100% rename from gcc/rust/privacy/rust-reachability.h rename to gcc/rust/checks/errors/privacy/rust-reachability.h diff --git a/gcc/rust/privacy/rust-visibility-resolver.cc b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc similarity index 100% rename from gcc/rust/privacy/rust-visibility-resolver.cc rename to gcc/rust/checks/errors/privacy/rust-visibility-resolver.cc diff --git a/gcc/rust/privacy/rust-visibility-resolver.h b/gcc/rust/checks/errors/privacy/rust-visibility-resolver.h similarity index 100% rename from gcc/rust/privacy/rust-visibility-resolver.h rename to gcc/rust/checks/errors/privacy/rust-visibility-resolver.h diff --git a/gcc/rust/lint/rust-lint-marklive-base.h b/gcc/rust/checks/lints/rust-lint-marklive-base.h similarity index 100% rename from gcc/rust/lint/rust-lint-marklive-base.h rename to gcc/rust/checks/lints/rust-lint-marklive-base.h diff --git a/gcc/rust/lint/rust-lint-marklive.cc b/gcc/rust/checks/lints/rust-lint-marklive.cc similarity index 100% rename from gcc/rust/lint/rust-lint-marklive.cc rename to gcc/rust/checks/lints/rust-lint-marklive.cc diff --git a/gcc/rust/lint/rust-lint-marklive.h b/gcc/rust/checks/lints/rust-lint-marklive.h similarity index 100% rename from gcc/rust/lint/rust-lint-marklive.h rename to gcc/rust/checks/lints/rust-lint-marklive.h diff --git a/gcc/rust/lint/rust-lint-scan-deadcode.h b/gcc/rust/checks/lints/rust-lint-scan-deadcode.h similarity index 100% rename from gcc/rust/lint/rust-lint-scan-deadcode.h rename to gcc/rust/checks/lints/rust-lint-scan-deadcode.h diff --git a/gcc/rust/lint/rust-lint-unused-var.cc b/gcc/rust/checks/lints/rust-lint-unused-var.cc similarity index 100% rename from gcc/rust/lint/rust-lint-unused-var.cc rename to gcc/rust/checks/lints/rust-lint-unused-var.cc diff --git a/gcc/rust/lint/rust-lint-unused-var.h b/gcc/rust/checks/lints/rust-lint-unused-var.h similarity index 100% rename from gcc/rust/lint/rust-lint-unused-var.h rename to gcc/rust/checks/lints/rust-lint-unused-var.h
reply other threads:[~2022-07-22 13:34 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20220722133446.5BF343835410@sourceware.org \ --to=tschwinge@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).