mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 09:06:06 +00:00

The builtin computes the discriminator for a type, which can be used to sign/authenticate function pointers and member function pointers. If the type passed to the builtin is a C++ member function pointer type, the result is the discriminator used to signed member function pointers of that type. If the type is a function, function pointer, or function reference type, the result is the discriminator used to sign functions of that type. It is ill-formed to use this builtin with any other type. A call to this function is an integer constant expression. Co-Authored-By: John McCall rjmccall@apple.com
6 lines
237 B
C++
6 lines
237 B
C++
// RUN: %clang_cc1 -triple arm64-apple-ios -fptrauth-calls -fptrauth-intrinsics -std=c++11 -ast-dump=json %s | FileCheck %s
|
|
|
|
// CHECK: "name": "__builtin_ptrauth_type_discriminator",
|
|
|
|
int d = __builtin_ptrauth_type_discriminator(int());
|