]> git.ipfire.org Git - thirdparty/gcc.git/commit
Change lookup_local_defid return type to optional
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Thu, 2 May 2024 09:43:02 +0000 (11:43 +0200)
committerP-E-P <32375388+P-E-P@users.noreply.github.com>
Fri, 17 May 2024 15:28:30 +0000 (15:28 +0000)
commita83bc198e19a99d9f266dbb77deb5a7a5200f53f
treedb67da4334d9666a4c7bc57114f0f07736f7ab13
parentd1f2064d643cf9e8865641746e3cf907b276d234
Change lookup_local_defid return type to optional

Make the API more convenient by changing the function's return type. We
can now differentiate between a stored null pointer and a missing value.

gcc/rust/ChangeLog:

* util/rust-hir-map.cc (Mappings::insert_defid_mapping): Adapt call
to new return type.
(Mappings::insert_local_defid_mapping): Likewise.
(Mappings::lookup_local_defid): Change return type to wrap it with an
optional.
* util/rust-hir-map.h: Update the function's prototype.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
gcc/rust/util/rust-hir-map.cc
gcc/rust/util/rust-hir-map.h