diff options
author | Yonghong Song <yhs@fb.com> | 2019-09-22 17:33:48 +0000 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2019-09-22 17:33:48 +0000 |
commit | 54dbd1f65ae900fb5e9665a03501f6cbed743e14 (patch) | |
tree | c016378559e5e80a341625eb6276305a9b1a0892 /docs | |
parent | 917053476805b535d160b1244771653d041571a8 (diff) | |
download | clang-54dbd1f65ae900fb5e9665a03501f6cbed743e14.tar.gz |
[CLANG][BPF] permit any argument type for __builtin_preserve_access_index()
Commit c15aa241f821 ("[CLANG][BPF] change __builtin_preserve_access_index()
signature") changed the builtin function signature to
PointerT __builtin_preserve_access_index(PointerT ptr)
with a pointer type as the argument/return type, where argument and
return types must be the same.
There is really no reason for this constraint. The builtin just
presented a code region so that IR builtins
__builtin_{array, struct, union}_preserve_access_index
can be applied.
This patch removed the pointer type restriction to permit any
argument type as long as it is permitted by the compiler.
Differential Revision: https://reviews.llvm.org/D67883
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@372516 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs')
-rw-r--r-- | docs/LanguageExtensions.rst | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/LanguageExtensions.rst b/docs/LanguageExtensions.rst index 9826c41c35..23c8778113 100644 --- a/docs/LanguageExtensions.rst +++ b/docs/LanguageExtensions.rst @@ -2354,13 +2354,13 @@ array subscript access and structure/union member access are relocatable under bpf compile-once run-everywhere framework. Debuginfo (typically with ``-g``) is needed, otherwise, the compiler will exit with an error. The return type for the intrinsic is the same as the type of the -argument, and must be a pointer type. +argument. **Syntax**: .. code-block:: c - PointerT __builtin_preserve_access_index(PointerT ptr) + type __builtin_preserve_access_index(type arg) **Example of Use**: @@ -2375,7 +2375,8 @@ argument, and must be a pointer type. } c[4]; }; struct t *v = ...; - const void *pb =__builtin_preserve_access_index(&v->c[3].b); + int *pb =__builtin_preserve_access_index(&v->c[3].b); + __builtin_preserve_access_index(v->j); Multiprecision Arithmetic Builtins ---------------------------------- |