[llvm-branch-commits] [clang] [clang] Implement function pointer signing and authenticated function calls (PR #93906)
Akira Hatanaka via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Jun 12 10:21:30 PDT 2024
================
@@ -0,0 +1,96 @@
+//===----- CGPointerAuthInfo.h - -------------------------------*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+//
+// Pointer auth info class.
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef LLVM_CLANG_LIB_CODEGEN_CGPOINTERAUTHINFO_H
+#define LLVM_CLANG_LIB_CODEGEN_CGPOINTERAUTHINFO_H
+
+#include "clang/AST/Type.h"
+#include "llvm/IR/Type.h"
+#include "llvm/IR/Value.h"
+
+namespace clang {
+namespace CodeGen {
+
+class CGPointerAuthInfo {
+private:
+ PointerAuthenticationMode AuthenticationMode : 2;
+ bool IsIsaPointer : 1;
+ bool AuthenticatesNullValues : 1;
+ unsigned Key : 28;
----------------
ahatanak wrote:
Currently we only need 2 bits, but we'll need more when we add support for soft keys. I changed the size to 4 to match the size in `PointerAuthSchema`.
https://github.com/llvm/llvm-project/pull/93906
More information about the llvm-branch-commits
mailing list