[clang] [clang][bytecode][NFC] Remove unused `Pointer::compare()` (PR #242977)
Timm Baeder via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 15 22:56:51 PST 2026
https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/242977
None
>From e22579a62689ce7d029b9ab5bc31dffde1980e77 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Mon, 16 Nov 2026 07:56:01 +0100
Subject: [PATCH] [clang][bytecode][NFC] Remove unused `Pointer::compare()`
---
clang/lib/AST/ByteCode/Pointer.h | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/clang/lib/AST/ByteCode/Pointer.h b/clang/lib/AST/ByteCode/Pointer.h
index 04aaacd5d96512..f1dcc5637455d0 100644
--- a/clang/lib/AST/ByteCode/Pointer.h
+++ b/clang/lib/AST/ByteCode/Pointer.h
@@ -1286,20 +1286,6 @@ class Pointer {
[[nodiscard]] Pointer stripBaseCasts() const {
return Pointer(view().stripBaseCasts());
}
-
- /// Compare two pointers.
- ComparisonCategoryResult compare(const Pointer &Other) const {
- if (!hasSameBase(*this, Other))
- return ComparisonCategoryResult::Unordered;
-
- if (Offset < Other.Offset)
- return ComparisonCategoryResult::Less;
- if (Offset > Other.Offset)
- return ComparisonCategoryResult::Greater;
-
- return ComparisonCategoryResult::Equal;
- }
-
/// Checks if two pointers are comparable.
static bool hasSameBase(const Pointer &A, const Pointer &B);
/// Checks if two pointers can be subtracted.
More information about the cfe-commits
mailing list