[llvm] [BOLT] Fix -Wunused-template (PR #222439)

Aiden Grossman via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 12:53:21 PDT 2026


https://github.com/boomanaiden154 created https://github.com/llvm/llvm-project/pull/222439

This was enabled by default in LLVM 23.1.0. It was disabled in LLVM 23.1.1, but it makes sense to fix the outstanding issues given they are real.

>From dd293befd618125e660b519e2201f230ae79a785 Mon Sep 17 00:00:00 2001
From: Aiden Grossman <aidengrossman at google.com>
Date: Wed, 9 Sep 2026 19:52:06 +0000
Subject: [PATCH] [BOLT] Fix -Wunused-template

This was enabled by default in LLVM 23.1.0. It was disabled in LLVM
23.1.1, but it makes sense to fix the outstanding issues given they are
real.
---
 bolt/lib/Core/BinaryFunction.cpp                | 4 ----
 llvm/include/llvm/Support/GenericLoopInfoImpl.h | 4 ++--
 2 files changed, 2 insertions(+), 6 deletions(-)

diff --git a/bolt/lib/Core/BinaryFunction.cpp b/bolt/lib/Core/BinaryFunction.cpp
index 99d6d27264fbe..8689e0d432ac0 100644
--- a/bolt/lib/Core/BinaryFunction.cpp
+++ b/bolt/lib/Core/BinaryFunction.cpp
@@ -169,10 +169,6 @@ bool shouldPrint(const BinaryFunction &Function) {
 namespace llvm {
 namespace bolt {
 
-template <typename R> static bool emptyRange(const R &Range) {
-  return Range.begin() == Range.end();
-}
-
 /// Gets debug line information for the instruction located at the given
 /// address in the original binary. Returns an optional DebugLineTableRowRef
 /// that references the corresponding row in the DWARF line table. Since binary
diff --git a/llvm/include/llvm/Support/GenericLoopInfoImpl.h b/llvm/include/llvm/Support/GenericLoopInfoImpl.h
index 5ac1c35957cfb..f710c2b8f1615 100644
--- a/llvm/include/llvm/Support/GenericLoopInfoImpl.h
+++ b/llvm/include/llvm/Support/GenericLoopInfoImpl.h
@@ -881,8 +881,8 @@ void addInnerLoopsToHeadersMap(DenseMap<BlockT *, const LoopT *> &LoopHeaders,
 
 #ifndef NDEBUG
 template <class BlockT, class LoopT>
-static void compareLoops(const LoopT *L, const LoopT *OtherL,
-                         DenseMap<BlockT *, const LoopT *> &OtherLoopHeaders) {
+void compareLoops(const LoopT *L, const LoopT *OtherL,
+                  DenseMap<BlockT *, const LoopT *> &OtherLoopHeaders) {
   BlockT *H = L->getHeader();
   BlockT *OtherH = OtherL->getHeader();
   assert(H == OtherH &&



More information about the llvm-commits mailing list