[llvm] 5d7a0a7 - [X86] Use a range-based for loop (NFC)
Kazu Hirata via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 30 22:12:16 PST 2024
Author: Kazu Hirata
Date: 2024-01-30T22:12:05-08:00
New Revision: 5d7a0a734a0073ed2237606558d7616923ff50c2
URL: https://github.com/llvm/llvm-project/commit/5d7a0a734a0073ed2237606558d7616923ff50c2
DIFF: https://github.com/llvm/llvm-project/commit/5d7a0a734a0073ed2237606558d7616923ff50c2.diff
LOG: [X86] Use a range-based for loop (NFC)
Added:
Modified:
llvm/lib/Target/X86/X86InstrInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86InstrInfo.cpp b/llvm/lib/Target/X86/X86InstrInfo.cpp
index 5609272cf935c..fb0ab8c3f916c 100644
--- a/llvm/lib/Target/X86/X86InstrInfo.cpp
+++ b/llvm/lib/Target/X86/X86InstrInfo.cpp
@@ -760,11 +760,8 @@ static bool regIsPICBase(Register BaseReg, const MachineRegisterInfo &MRI) {
if (!BaseReg.isVirtual())
return false;
bool isPICBase = false;
- for (MachineRegisterInfo::def_instr_iterator I = MRI.def_instr_begin(BaseReg),
- E = MRI.def_instr_end();
- I != E; ++I) {
- MachineInstr *DefMI = &*I;
- if (DefMI->getOpcode() != X86::MOVPC32r)
+ for (const MachineInstr &DefMI : MRI.def_instructions(BaseReg)) {
+ if (DefMI.getOpcode() != X86::MOVPC32r)
return false;
assert(!isPICBase && "More than one PIC base?");
isPICBase = true;
More information about the llvm-commits
mailing list