[llvm] [NFC][LLVM] Code cleanup in InstructionNamer.cpp (PR #162689)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Thu Oct 9 09:15:49 PDT 2025
https://github.com/jurahul created https://github.com/llvm/llvm-project/pull/162689
Mark file local function static and use explicit type for Arg.
>From 32988452fee11cda53fc1a82c471a0961be57dd5 Mon Sep 17 00:00:00 2001
From: Rahul Joshi <rjoshi at nvidia.com>
Date: Thu, 9 Oct 2025 09:14:12 -0700
Subject: [PATCH] [NFC][LLVM] Code cleanup in InstructionNamer.cpp
Mark file local function static and use explicit type for Arg.
---
llvm/lib/Transforms/Utils/InstructionNamer.cpp | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/llvm/lib/Transforms/Utils/InstructionNamer.cpp b/llvm/lib/Transforms/Utils/InstructionNamer.cpp
index 3ae570cfeb776..4f1ff7bcacdeb 100644
--- a/llvm/lib/Transforms/Utils/InstructionNamer.cpp
+++ b/llvm/lib/Transforms/Utils/InstructionNamer.cpp
@@ -20,9 +20,8 @@
using namespace llvm;
-namespace {
-void nameInstructions(Function &F) {
- for (auto &Arg : F.args()) {
+static void nameInstructions(Function &F) {
+ for (Argument &Arg : F.args()) {
if (!Arg.hasName())
Arg.setName("arg");
}
@@ -38,8 +37,6 @@ void nameInstructions(Function &F) {
}
}
-} // namespace
-
PreservedAnalyses InstructionNamerPass::run(Function &F,
FunctionAnalysisManager &FAM) {
nameInstructions(F);
More information about the llvm-commits
mailing list