[GlobalISel][TableGen] Fix seg fault for zero instruction
authorGabriel Hjort Ã…kerlund <gabriel.hjort.akerlund@ericsson.com>
Tue, 24 Nov 2020 06:12:54 +0000 (07:12 +0100)
committerMikael Holmen <mikael.holmen@ericsson.com>
Tue, 24 Nov 2020 06:47:58 +0000 (07:47 +0100)
commit5e9e335a247040a175855f99dbab5957064434ba
tree807192affb71b82584e5a2c040097f5fb5473ff4
parentda3bc99bdd778ce2c22f17cab2b94eefcc285953
[GlobalISel][TableGen] Fix seg fault for zero instruction

Tablegen seg faulted when parsing a Pat where the destination part has
no output (zero instruction), due to a register class lookup using
nullptr.

Reviewed By: Paul-C-Anagnostopoulos

Differential Revision: https://reviews.llvm.org/D90829
llvm/test/TableGen/GlobalISelEmitter-zero-instr.td [new file with mode: 0644]
llvm/utils/TableGen/GlobalISelEmitter.cpp