From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1643) id 5BF343835410; Fri, 22 Jul 2022 13:34:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5BF343835410 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Thomas Schwinge To: gcc-cvs@gcc.gnu.org Subject: [gcc/devel/rust/master] checks: Refactor project architecture for checking passes X-Act-Checkin: gcc X-Git-Author: Arthur Cohen X-Git-Refname: refs/heads/devel/rust/master X-Git-Oldrev: 137cd3bbaa05038b01c46f7ac7472da7ca662ed7 X-Git-Newrev: 1ab1464228ae4cb97c552b4d0dedf8a48f3dfaf6 Message-Id: <20220722133446.5BF343835410@sourceware.org> Date: Fri, 22 Jul 2022 13:34:46 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 Jul 2022 13:34:46 -0000 https://gcc.gnu.org/g:1ab1464228ae4cb97c552b4d0dedf8a48f3dfaf6 commit 1ab1464228ae4cb97c552b4d0dedf8a48f3dfaf6 Author: Arthur Cohen 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