[llvm] [DFAJumpThreading][NFC] Use const reference as range variable (PR #90342)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 27 05:57:46 PDT 2024


https://github.com/XChy created https://github.com/llvm/llvm-project/pull/90342

Fixes #90286

>From 8084544a63f449c59635d6f31888f2b12ba293b9 Mon Sep 17 00:00:00 2001
From: XChy <xxs_chy at outlook.com>
Date: Sat, 27 Apr 2024 20:56:16 +0800
Subject: [PATCH] [DFAJumpThreading][NFC] Use const reference as range variable

---
 llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp b/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
index 14cdcc956aa5d7..fe5eeb1dcdf32f 100644
--- a/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
+++ b/llvm/lib/Transforms/Scalar/DFAJumpThreading.cpp
@@ -553,7 +553,7 @@ struct AllSwitchPaths {
       return;
     }
 
-    for (PathType Path : LoopPaths) {
+    for (const PathType& Path : LoopPaths) {
       ThreadingPath TPath;
 
       const BasicBlock *PrevBB = Path.back();



More information about the llvm-commits mailing list