[clang] [clang][bytecode][NFC] Remove unused Integral range functions (PR #169508)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 26 00:35:22 PST 2025


https://github.com/tbaederr updated https://github.com/llvm/llvm-project/pull/169508

>From 69ccc2db96b8a66959db46e4b4b9e6bd8e58d94f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Tue, 25 Nov 2025 16:51:19 +0100
Subject: [PATCH] [clang][bytecode][NFC] Remove unused Integral range functions

---
 clang/lib/AST/ByteCode/Integral.h | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Integral.h b/clang/lib/AST/ByteCode/Integral.h
index 5bf6621874e69..e90f1a9a74e1c 100644
--- a/clang/lib/AST/ByteCode/Integral.h
+++ b/clang/lib/AST/ByteCode/Integral.h
@@ -217,10 +217,6 @@ template <unsigned Bits, bool Signed> class Integral final {
     return Integral(Value.V);
   }
 
-  static bool inRange(int64_t Value, unsigned NumBits) {
-    return CheckRange<ReprT, Min, Max>(Value);
-  }
-
   static bool increment(Integral A, Integral *R) {
     return add(A, Integral(ReprT(1)), A.bitWidth(), R);
   }
@@ -323,13 +319,6 @@ template <unsigned Bits, bool Signed> class Integral final {
       return false;
     }
   }
-  template <typename T, T Min, T Max> static bool CheckRange(int64_t V) {
-    if constexpr (std::is_signed_v<T>) {
-      return Min <= V && V <= Max;
-    } else {
-      return V >= 0 && static_cast<uint64_t>(V) <= Max;
-    }
-  }
 };
 
 template <unsigned Bits, bool Signed>



More information about the cfe-commits mailing list