mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-13 09:33:50 +00:00
Fix the root cause of the bootstrap failure:
There was no way to check if a given register/mode pair was valid. We now return an error code (-2) instead of asserting. If anyone thinks that an assert at this point is really needed, we can autogen a hasValidDwarfRegNum instead. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132236 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
de64aaf6c8
commit
7bf114c1bd
@ -769,7 +769,7 @@ void AsmPrinter::EmitDwarfRegOp(const MachineLocation &MLoc) const {
|
||||
int Reg = TRI->getDwarfRegNum(MLoc.getReg(), false);
|
||||
|
||||
for (const unsigned *SR = TRI->getSuperRegisters(MLoc.getReg());
|
||||
*SR && Reg == -1; ++SR) {
|
||||
*SR && Reg < 0; ++SR) {
|
||||
Reg = TRI->getDwarfRegNum(*SR, false);
|
||||
// FIXME: Get the bit range this register uses of the superregister
|
||||
// so that we can produce a DW_OP_bit_piece
|
||||
|
@ -1010,13 +1010,8 @@ void RegisterInfoEmitter::run(raw_ostream &OS) {
|
||||
for (DwarfRegNumsMapTy::iterator
|
||||
I = DwarfRegNums.begin(), E = DwarfRegNums.end(); I != E; ++I) {
|
||||
int RegNo = I->second[i];
|
||||
if (RegNo != -2)
|
||||
OS << " case " << getQualifiedName(I->first) << ":\n"
|
||||
<< " return " << RegNo << ";\n";
|
||||
else
|
||||
OS << " case " << getQualifiedName(I->first) << ":\n"
|
||||
<< " assert(0 && \"Invalid register for this mode\");\n"
|
||||
<< " return -1;\n";
|
||||
OS << " case " << getQualifiedName(I->first) << ":\n"
|
||||
<< " return " << RegNo << ";\n";
|
||||
}
|
||||
OS << " };\n";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user