]> git.ipfire.org Git - thirdparty/gcc.git/commit
json: Add get_map() method to JSON object class
authorSoumya AR <soumyaa@nvidia.com>
Fri, 11 Jul 2025 12:54:33 +0000 (05:54 -0700)
committerSoumya AR <soumyaa@nvidia.com>
Wed, 26 Nov 2025 08:41:32 +0000 (14:11 +0530)
commit0cf34825923d9fc82e3d015e9bc7d0b253bd9348
treeac56a36f81a34807a57782f258b489670e26c914
parent59f37983222d869b6213e1d8690b4deb0b6dc874
json: Add get_map() method to JSON object class

This patch adds a get_map () method to the JSON object class to provide access
to the underlying hash map that stores the JSON key-value pairs.

To do this, we expose the map_t typedef, the return type of get_map().

This change is needed to allow traversal of key-value pairs when parsing
user-provided JSON tuning data.

Additionally, is_a_helper template specializations for json::literal * and
const json::literal * were added to make dynamic casting in the next patch
easier.

This patch was bootstrapped and regtested on aarch64-linux-gnu, no regression.

Signed-off-by: Soumya AR <soumyaa@nvidia.com>
gcc/ChangeLog:

* json.h (class object): Add get_map () method.
(is_a_helper<json::literal *>, is_a_helper<const json::literal *>):
New template specializations.
gcc/json.h