forked from OSchip/llvm-project
[MC] Improve error message when a codeview register is unknown
This is in MCRegisterInfo, we can print the actual register name easily. llvm-svn: 340089
This commit is contained in:
parent
4746aa7b8f
commit
aa56bac652
|
@ -13,6 +13,7 @@
|
|||
|
||||
#include "llvm/MC/MCRegisterInfo.h"
|
||||
#include "llvm/ADT/DenseMap.h"
|
||||
#include "llvm/ADT/Twine.h"
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include <algorithm>
|
||||
#include <cassert>
|
||||
|
@ -127,6 +128,8 @@ int MCRegisterInfo::getCodeViewRegNum(unsigned RegNum) const {
|
|||
report_fatal_error("target does not implement codeview register mapping");
|
||||
const DenseMap<unsigned, int>::const_iterator I = L2CVRegs.find(RegNum);
|
||||
if (I == L2CVRegs.end())
|
||||
report_fatal_error("unknown codeview register");
|
||||
report_fatal_error("unknown codeview register " + (RegNum < getNumRegs()
|
||||
? getName(RegNum)
|
||||
: Twine(RegNum)));
|
||||
return I->second;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue