[llvm] 210616b - Rename a shadowed variable causing build failure on gcc<5.5
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Thu Apr 23 09:23:54 PDT 2020
Author: Vedant Kumar
Date: 2020-04-23T09:23:44-07:00
New Revision: 210616bd38d589020b45f8cbbf9f9ef1296f2729
URL: https://github.com/llvm/llvm-project/commit/210616bd38d589020b45f8cbbf9f9ef1296f2729
DIFF: https://github.com/llvm/llvm-project/commit/210616bd38d589020b45f8cbbf9f9ef1296f2729.diff
LOG: Rename a shadowed variable causing build failure on gcc<5.5
See discussion here: https://reviews.llvm.org/D78265
Added:
Modified:
llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp b/llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp
index a377f5c4839d..eda74b1b2e3b 100644
--- a/llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ConditionOptimizer.cpp
@@ -145,11 +145,11 @@ void AArch64ConditionOptimizer::getAnalysisUsage(AnalysisUsage &AU) const {
// instructions.
MachineInstr *AArch64ConditionOptimizer::findSuitableCompare(
MachineBasicBlock *MBB) {
- MachineBasicBlock::iterator I = MBB->getFirstTerminator();
- if (I == MBB->end())
+ MachineBasicBlock::iterator Term = MBB->getFirstTerminator();
+ if (Term == MBB->end())
return nullptr;
- if (I->getOpcode() != AArch64::Bcc)
+ if (Term->getOpcode() != AArch64::Bcc)
return nullptr;
// Since we may modify cmp of this MBB, make sure NZCV does not live out.
@@ -159,8 +159,8 @@ MachineInstr *AArch64ConditionOptimizer::findSuitableCompare(
// Now find the instruction controlling the terminator.
auto B = MBB->begin();
- for (MachineInstr &I :
- reversedInstructionsWithoutDebug(I == B ? I : std::prev(I), B)) {
+ for (MachineInstr &I : reversedInstructionsWithoutDebug(
+ Term == B ? Term : std::prev(Term), B)) {
assert(!I.isTerminator() && "Spurious terminator");
// Check if there is any use of NZCV between CMP and Bcc.
if (I.readsRegister(AArch64::NZCV))
More information about the llvm-commits
mailing list