[clang] [llvm] [BPF] introduce `__attribute__((bpf_fastcall))` (PR #101228)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 15 09:59:16 PDT 2024
================
@@ -0,0 +1,7 @@
+// REQUIRES: bpf-registered-target
+// RUN: %clang_cc1 %s -triple bpf -verify
+
+__attribute__((bpf_fastcall)) int var; // expected-warning {{'bpf_fastcall' attribute only applies to functions and function pointers}}
+
+__attribute__((bpf_fastcall)) void func();
+__attribute__((bpf_fastcall(1))) void func_invalid(); // expected-error {{'bpf_fastcall' attribute takes no arguments}}
----------------
AaronBallman wrote:
Can you also add a test applying it to a function pointer, with some tests showing that this attribute is not part of the type (so there's no pointer mismatches)?
If you have to care about C++ member functions, a test for that would be useful as well (and a codegen test too).
https://github.com/llvm/llvm-project/pull/101228
More information about the cfe-commits
mailing list