[clang] [BPF] Support preserve_access_index attribute for enum (PR #232498)
via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 19 14:47:00 PDT 2026
yonghong-song wrote:
> we can have a bit more meaningful and backport-friendly
>
> ```
> #if __bpf_relocatable_enum_attr
> ```
>
> (I didn't think about good name, please don't take it verbatim)
I think we can add a feature in clang and guard the above with that feature. For example, let us say we add a feature like __BPF_FEATURE_ENUM_PRESERVE_ACCESS_INDEX
and then we guard with it in vmlinux.h. This way we can hide the version number.
In selftest, we already have quite some examples with attribute preserve_access_index.
https://github.com/llvm/llvm-project/pull/232498
More information about the cfe-commits
mailing list