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.
Details
Details
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Some small nits inlined, otherwise LGTM. Please wait a few working days to let others chime in if they have suggestions before committing.
test/TableGen/RelTest.td | ||
---|---|---|
3 | Add a brief description of the purpose of this test. | |
utils/TableGen/CodeGenMapTable.cpp | ||
246 | recVal -> RecVal. | |
248 | 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. |
Add a brief description of the purpose of this test.