[PATCH] D83878: BPF: support CORE existence checking for typedef and struct variables

Yonghong Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 15 08:04:58 PDT 2020


yonghong-song created this revision.
yonghong-song added reviewers: ast, anakryiko.
yonghong-song added a project: LLVM.
Herald added subscribers: llvm-commits, hiraditya.

This patch added support to generate correct relocation
for existence relocation of typedef and struct/union expressions.
It is able to generate a relocation for following type
and expressions:

  typedef int (*foo_t)(void);
  struct s { int a; ... };
  ...__builtin_preserve_field_info((foo_t)0, 2)...
  ...__builtin_preserve_field_info(*(struct s *)0, 2)...

This will make bpf program easier to deal with multiple kernel versions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D83878

Files:
  llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
  llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-4.ll
  llvm/test/CodeGen/BPF/CORE/intrinsic-fieldinfo-existence-5.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83878.278192.patch
Type: text/x-patch
Size: 13404 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200715/20feef9a/attachment.bin>


More information about the llvm-commits mailing list