]> git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: proc_macro: Refactor attribute search
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 27 Jul 2023 11:11:08 +0000 (13:11 +0200)
committerArthur Cohen <arthur.cohen@embecosm.com>
Tue, 16 Jan 2024 17:56:01 +0000 (18:56 +0100)
commitde7e34bdd6c62294831d867188807216e186ed03
tree3099f625a00771e06479bdd144d57c758785243d
parent1346a7652e8cf70b54f0b12f6844f0c929781c2f
gccrs: proc_macro: Refactor attribute search

Refactor attribute search with early return. Also fix the optional
building an object with it's default empty constructor by explicitely
using tl::null_opt.

gcc/rust/ChangeLog:

* checks/errors/privacy/rust-privacy-reporter.cc (find_proc_macro_attribute):
Refactor the function to be safer and more efficient.

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