[all-commits] [llvm/llvm-project] 50b919: [clang] Define ptrauth_string_discriminator builti...

Ahmed Bougacha via All-commits all-commits at lists.llvm.org
Thu Jun 20 11:56:02 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 50b919378186ebb59e2dd402720f6ea8576d2477
      https://github.com/llvm/llvm-project/commit/50b919378186ebb59e2dd402720f6ea8576d2477
  Author: Ahmed Bougacha <ahmed at bougacha.org>
  Date:   2024-06-20 (Thu, 20 Jun 2024)

  Changed paths:
    M clang/docs/PointerAuthentication.rst
    M clang/include/clang/Basic/Builtins.td
    M clang/include/clang/Basic/DiagnosticSemaKinds.td
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/Headers/ptrauth.h
    M clang/lib/Sema/SemaChecking.cpp
    M clang/test/CodeGen/ptrauth-intrinsics.c
    M clang/test/Sema/ptrauth-intrinsics-macro.c
    M clang/test/Sema/ptrauth.c

  Log Message:
  -----------
  [clang] Define ptrauth_string_discriminator builtin. (#93903)

This exposes the ABI-stable hash function that allows computing a 16-bit
discriminator from a constant string.

This allows manually matching the implicit string discriminators
computed in the ABI (e.g., from mangled names for vtable pointer/entry
signing), as well as enabling the use of interesting discriminators when
manually annotating specific pointers with the __ptrauth qualifier.

The argument must be a string literal of char character type.  The
result has type ptrauth_extra_data_t.
The result value is never zero and always within range for both the
__ptrauth qualifier and ptrauth_blend_discriminator.
This can be used in constant expressions.

Co-authored-by: John McCall <rjmccall at apple.com>



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list