Skip to content

Conversation

jurahul
Copy link
Contributor

@jurahul jurahul commented Oct 9, 2025

Make file local function static and use explicit type for Arg.

Mark file local function static and use explicit type for Arg.
@jurahul jurahul marked this pull request as ready for review October 9, 2025 16:49
@jurahul jurahul requested a review from bjope October 9, 2025 16:49
@llvmbot
Copy link
Member

llvmbot commented Oct 9, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Rahul Joshi (jurahul)

Changes

Make file local function static and use explicit type for Arg.


Full diff: https://github.com/llvm/llvm-project/pull/162689.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Utils/InstructionNamer.cpp (+2-5)
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);

@jurahul jurahul requested a review from kazutakahirata October 9, 2025 22:33
@jurahul jurahul merged commit a4a0a4b into llvm:main Oct 10, 2025
13 checks passed
@jurahul jurahul deleted the nfc_InstructionNamer_cleanup branch October 10, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants