]> git.ipfire.org Git - thirdparty/gcc.git/commit
bpf: Use enum for resolved overloaded builtins
authorDavid Faust <david.faust@oracle.com>
Mon, 7 Nov 2022 18:40:01 +0000 (10:40 -0800)
committerDavid Faust <david.faust@oracle.com>
Tue, 8 Nov 2022 16:37:04 +0000 (08:37 -0800)
commit564b11184650a494d97d9e89b984664ae142a24a
tree36f7d6345be042ad8840d70de6e0ea6c7f17efd7
parent9d96a286992a0fd9ecdd6a58cd9a413c8c49f477
bpf: Use enum for resolved overloaded builtins

Change several places in the eBPF backend dealing with overloaded
built-in functions to consistently use the enum bpf_builtins type,
rather than variously using integer constants or booleans. The result is
eaiser to read and extend.

gcc/

* config/bpf/bpf.cc (struct core_walk_data): Add field `which'...
(bpf_resolve_overloaded_builtin): ... set it here. Use values of enum
bpf_builtins for error checks.
(bpf_core_walk): Use values of enum bpf_builtins.
(bpf_core_newdecl): Likewise.
(bpf_expand_builtin): Likewise.
gcc/config/bpf/bpf.cc