[llvm] Add LLVM_GSL_POINTER to llvm::function_ref. (PR #120699)

Haojian Wu via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 00:32:33 PST 2025


https://github.com/hokein updated https://github.com/llvm/llvm-project/pull/120699

>From 668f085b73c033d9359e979c726c86ba98e5af7c Mon Sep 17 00:00:00 2001
From: Haojian Wu <hokein.wu at gmail.com>
Date: Fri, 20 Dec 2024 10:02:10 +0100
Subject: [PATCH 1/2] Add LLVM_GSL_POINTER to llvm::function_ref.

---
 llvm/include/llvm/ADT/STLFunctionalExtras.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/ADT/STLFunctionalExtras.h b/llvm/include/llvm/ADT/STLFunctionalExtras.h
index 3b9d40959d7142..f1ebb581996563 100644
--- a/llvm/include/llvm/ADT/STLFunctionalExtras.h
+++ b/llvm/include/llvm/ADT/STLFunctionalExtras.h
@@ -37,7 +37,7 @@ namespace llvm {
 template<typename Fn> class function_ref;
 
 template<typename Ret, typename ...Params>
-class function_ref<Ret(Params...)> {
+class LLVM_GSL_POINTER function_ref<Ret(Params...)> {
   Ret (*callback)(intptr_t callable, Params ...params) = nullptr;
   intptr_t callable;
 

>From cf11f15bea3d3aae52de5709a1e2377089ad6dd3 Mon Sep 17 00:00:00 2001
From: Haojian Wu <hokein.wu at gmail.com>
Date: Wed, 8 Jan 2025 09:32:00 +0100
Subject: [PATCH 2/2] clang-format

---
 llvm/include/llvm/ADT/STLFunctionalExtras.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/ADT/STLFunctionalExtras.h b/llvm/include/llvm/ADT/STLFunctionalExtras.h
index f1ebb581996563..a4d50dc3648bef 100644
--- a/llvm/include/llvm/ADT/STLFunctionalExtras.h
+++ b/llvm/include/llvm/ADT/STLFunctionalExtras.h
@@ -36,7 +36,7 @@ namespace llvm {
 /// a function_ref.
 template<typename Fn> class function_ref;
 
-template<typename Ret, typename ...Params>
+template <typename Ret, typename... Params>
 class LLVM_GSL_POINTER function_ref<Ret(Params...)> {
   Ret (*callback)(intptr_t callable, Params ...params) = nullptr;
   intptr_t callable;



More information about the llvm-commits mailing list