While mapping instructions for microMIPS, I made an error in capitalization of one field which led to a segfault. This patch improves diagnostic for this case, displaying reasonable message instead of segfault.
Some small nits inlined, otherwise LGTM. Please wait a few working days to let others chime in if they have suggestions before committing.
|3 ↗||(On Diff #128769)|
Add a brief description of the purpose of this test.
|246 ↗||(On Diff #128769)|
recVal -> RecVal.
|248 ↗||(On Diff #128769)|
I believe you should use the overloaded variant of PrintFatalError that takes a source location of a record. i.e:
PrintFatalError(CurInstr->getLoc(), "No value " + RowField->getAsString() + " found in \"" + CurInstr->getName() + "\" instruction description.");
This gives the following error message:
/Users/simon/dev/llvm/llvm/test/TableGen/RelTest.td:34:1: error: No value "BaseName" found in "SimpleInstr" instruction description. def SimpleInstr : SimpleRel, INSTR_DEF; ^
Which is a better in my opinion as directly points to the record which lacks the named value.