[llvm] a4a0a4b - [NFC][LLVM] Code cleanup in InstructionNamer.cpp (#162689)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 10 14:42:09 PDT 2025
Author: Rahul Joshi
Date: 2025-10-10T14:42:05-07:00
New Revision: a4a0a4b9b18ad68b482e6a764cf3df7cf771edca
URL: https://github.com/llvm/llvm-project/commit/a4a0a4b9b18ad68b482e6a764cf3df7cf771edca
DIFF: https://github.com/llvm/llvm-project/commit/a4a0a4b9b18ad68b482e6a764cf3df7cf771edca.diff
LOG: [NFC][LLVM] Code cleanup in InstructionNamer.cpp (#162689)
Make file local function static and use explicit type for Arg.
Added:
Modified:
llvm/lib/Transforms/Utils/InstructionNamer.cpp
Removed:
################################################################################
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