Add assertion to detect invalid registers in the PowerPC MC instruction lowering.
authorSamuel Antao <sfantao@us.ibm.com>
Tue, 17 Mar 2015 19:31:19 +0000 (19:31 +0000)
committerSamuel Antao <sfantao@us.ibm.com>
Tue, 17 Mar 2015 19:31:19 +0000 (19:31 +0000)
commit3a660c933af67d21d5f3f4493eccfd11acda6556
tree492d04dba5007bab14836e8e38f29aa610a0e3e9
parent51b4d85c62a5a72574e7fe9f3ce9bc42be3fab2e
Add assertion to detect invalid registers in the PowerPC MC instruction lowering.

We have observed that noreg was being generated due to a bug in FastIsel and was not being detected during emission. It happens that in the Asm emission there is an assertion that detects this in getRegisterName() from the tbl-generated file PPCGenAsmWriter.inc. However, when emitting an Obj file, invalid registers can be emitted given that no check are made in getBinaryCodeFromInstr() from PPCGenMCCodeEmitter.inc. In order to cover all cases this adds an assertion for reg operands in LowerPPCMachineInstrToMCInst.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@232525 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/PowerPC/PPCMCInstLower.cpp