[llvm-commits] [llvm] r118653 - /llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Bill Wendling
isanbard at gmail.com
Tue Nov 9 15:45:59 PST 2010
Author: void
Date: Tue Nov 9 17:45:59 2010
New Revision: 118653
URL: http://llvm.org/viewvc/llvm-project?rev=118653&view=rev
Log:
Emit the warning about the register list not being in ascending order only once.
Modified:
llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
Modified: llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp?rev=118653&r1=118652&r2=118653&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (original)
+++ llvm/trunk/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Tue Nov 9 17:45:59 2010
@@ -512,24 +512,27 @@
SmallVectorImpl<std::pair<unsigned, SMLoc> >::const_iterator
RI = Registers.begin(), RE = Registers.end();
- unsigned HighRegNum = RI->first;
DenseMap<unsigned, bool> RegMap;
RegMap[RI->first] = true;
+ unsigned HighRegNum = RI->first;
+ bool EmittedWarning = false;
+
for (++RI; RI != RE; ++RI) {
const std::pair<unsigned, SMLoc> &RegInfo = *RI;
+ unsigned Reg = RegInfo.first;
- if (RegMap[RegInfo.first]) {
+ if (RegMap[Reg]) {
Error(RegInfo.second, "register duplicated in register list");
return 0;
}
- if (RegInfo.first < HighRegNum)
+ if (!EmittedWarning && Reg < HighRegNum)
Warning(RegInfo.second,
"register not in ascending order in register list");
- RegMap[RegInfo.first] = true;
- HighRegNum = std::max(RegInfo.first, HighRegNum);
+ RegMap[Reg] = true;
+ HighRegNum = std::max(Reg, HighRegNum);
}
return ARMOperand::CreateRegList(Registers, S, E);
More information about the llvm-commits
mailing list