[llvm] RuntimeLibcalls: Fix missing const on getLibcallNames (PR #143074)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 5 23:09:17 PDT 2025


https://github.com/arsenm created https://github.com/llvm/llvm-project/pull/143074

This is made simpler by just returning the array ref instead of
the fancy range.

>From f57d03b25e5a05f661fd5076257c02fcc87befc1 Mon Sep 17 00:00:00 2001
From: Matt Arsenault <Matthew.Arsenault at amd.com>
Date: Fri, 6 Jun 2025 15:07:01 +0900
Subject: [PATCH] RuntimeLibcalls: Fix missing const on getLibcallNames

This is made simpler by just returning the array ref instead of
the fancy range.
---
 llvm/include/llvm/IR/RuntimeLibcalls.h | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/llvm/include/llvm/IR/RuntimeLibcalls.h b/llvm/include/llvm/IR/RuntimeLibcalls.h
index 26c085031a48a..a16c317fd8d41 100644
--- a/llvm/include/llvm/IR/RuntimeLibcalls.h
+++ b/llvm/include/llvm/IR/RuntimeLibcalls.h
@@ -68,10 +68,7 @@ struct RuntimeLibcallsInfo {
     return LibcallCallingConvs[Call];
   }
 
-  iterator_range<const char **> getLibcallNames() {
-    return llvm::make_range(LibcallRoutineNames,
-                            LibcallRoutineNames + RTLIB::UNKNOWN_LIBCALL);
-  }
+  ArrayRef<const char *> getLibcallNames() const { return LibcallRoutineNames; }
 
 private:
   /// Stores the name each libcall.



More information about the llvm-commits mailing list