aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp/constexpr.cc
diff options
context:
space:
mode:
authorDavid Faust <david.faust@oracle.com>2023-12-12 13:55:59 -0800
committerDavid Faust <david.faust@oracle.com>2023-12-19 09:50:14 -0800
commit1502d724df85163b14b04e8f67072ca88eac411d (patch)
treee28671ba4a031630aac1213be0afb1d7f78aa922 /gcc/cp/constexpr.cc
parent0a37463758dabc9647fa3d675dffdf43a737035d (diff)
downloadgcc-1502d724df85163b14b04e8f67072ca88eac411d.zip
gcc-1502d724df85163b14b04e8f67072ca88eac411d.tar.gz
gcc-1502d724df85163b14b04e8f67072ca88eac411d.tar.bz2
btf: change encoding of forward-declared enums [PR111735]
The BTF specification does not formally define a representation for forward-declared enum types such as: enum Foo; Forward-declarations for struct and union types are represented by BTF_KIND_FWD, which has a 1-bit flag distinguishing the two. The de-facto standard format used by other tools like clang and pahole is to represent forward-declared enums as BTF_KIND_ENUM with vlen=0, i.e. as a regular enum type with no enumerators. This patch changes GCC to adopt that format, and makes a couple of minor cleanups in btf_asm_type (). gcc/ PR debug/111735 * btfout.cc (btf_fwd_to_enum_p): New. (btf_asm_type_ref): Special case references to enum forwards. (btf_asm_type): Special case enum forwards. Rename btf_size_type to btf_size, and change chained ifs switching on btf_kind into else ifs. gcc/testsuite/ PR debug/111735 * gcc.dg/debug/btf/btf-forward-2.c: New test.
Diffstat (limited to 'gcc/cp/constexpr.cc')
0 files changed, 0 insertions, 0 deletions