mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-25 17:20:48 +00:00
Emit the warning about the register list not being in ascending order only once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118653 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -512,24 +512,27 @@ ARMOperand *ARMAsmParser::ParseRegisterList() {
|
|||||||
SmallVectorImpl<std::pair<unsigned, SMLoc> >::const_iterator
|
SmallVectorImpl<std::pair<unsigned, SMLoc> >::const_iterator
|
||||||
RI = Registers.begin(), RE = Registers.end();
|
RI = Registers.begin(), RE = Registers.end();
|
||||||
|
|
||||||
unsigned HighRegNum = RI->first;
|
|
||||||
DenseMap<unsigned, bool> RegMap;
|
DenseMap<unsigned, bool> RegMap;
|
||||||
RegMap[RI->first] = true;
|
RegMap[RI->first] = true;
|
||||||
|
|
||||||
|
unsigned HighRegNum = RI->first;
|
||||||
|
bool EmittedWarning = false;
|
||||||
|
|
||||||
for (++RI; RI != RE; ++RI) {
|
for (++RI; RI != RE; ++RI) {
|
||||||
const std::pair<unsigned, SMLoc> &RegInfo = *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");
|
Error(RegInfo.second, "register duplicated in register list");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RegInfo.first < HighRegNum)
|
if (!EmittedWarning && Reg < HighRegNum)
|
||||||
Warning(RegInfo.second,
|
Warning(RegInfo.second,
|
||||||
"register not in ascending order in register list");
|
"register not in ascending order in register list");
|
||||||
|
|
||||||
RegMap[RegInfo.first] = true;
|
RegMap[Reg] = true;
|
||||||
HighRegNum = std::max(RegInfo.first, HighRegNum);
|
HighRegNum = std::max(Reg, HighRegNum);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ARMOperand::CreateRegList(Registers, S, E);
|
return ARMOperand::CreateRegList(Registers, S, E);
|
||||||
|
Reference in New Issue
Block a user