]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: privacy: Refactor proc macro privacy check
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 20 Jul 2023 11:40:35 +0000 (13:40 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:01 +0000 (18:56 +0100)
commit1346a7652e8cf70b54f0b12f6844f0c929781c2f
treef6e0ede25174a67ad066b18924c02fe9d56fe1ef
parent6ad3f1fa575a1debdaa6a41f698d71c73f6600fa
gccrs: privacy: Refactor proc macro privacy check

Refactor proc macro specific privacy check in multiple shorter
functions.

gcc/rust/ChangeLog:

* checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
Add a new function to find a potential proc macro type
attribute on a given item.
(proc_macro_privacy_check): Move all proc macro privacy check in
their own function to avoid cluttering the usual privacy check.
(PrivacyReporter::go): Add call to newly created proc macro
privacy check function.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc