Sort the register list based on the *actual* register numbers rather than the
enum values we give to them. <rdar://problem/8823730>
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123321 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index b51e351..b672bc4 100644
--- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -583,15 +583,15 @@
SmallVectorImpl<std::pair<unsigned, SMLoc> >::const_iterator
RI = Registers.begin(), RE = Registers.end();
- DenseMap<unsigned, bool> RegMap;
- RegMap[RI->first] = true;
-
- unsigned HighRegNum = RI->first;
+ unsigned HighRegNum = getARMRegisterNumbering(RI->first);
bool EmittedWarning = false;
+ DenseMap<unsigned, bool> RegMap;
+ RegMap[HighRegNum] = true;
+
for (++RI; RI != RE; ++RI) {
const std::pair<unsigned, SMLoc> &RegInfo = *RI;
- unsigned Reg = RegInfo.first;
+ unsigned Reg = getARMRegisterNumbering(RegInfo.first);
if (RegMap[Reg]) {
Error(RegInfo.second, "register duplicated in register list");