MIRParser: generic register operands with types

This should fix the fallout of r283848.

llvm-svn: 283850
This commit is contained in:
Matthias Braun 2016-10-11 04:22:29 +00:00
parent 086a78cf23
commit 3d85ebe5b1
2 changed files with 3 additions and 2 deletions

View File

@ -990,7 +990,7 @@ bool MIParser::parseRegisterOperand(MachineOperand &Dest,
// Virtual registers may have a size with GlobalISel.
if (!TargetRegisterInfo::isVirtualRegister(Reg))
return error("unexpected size on physical register");
if (MRI.getRegClassOrRegBank(Reg).is<const TargetRegisterClass *>())
if (RegInfo->Kind != VRegInfo::GENERIC)
return error("unexpected size on non-generic virtual register");
LLT Ty;

View File

@ -124,7 +124,8 @@ LLT MachineRegisterInfo::getType(unsigned VReg) const {
void MachineRegisterInfo::setType(unsigned VReg, LLT Ty) {
// Check that VReg doesn't have a class.
assert(!getRegClassOrRegBank(VReg).is<const TargetRegisterClass *>() &&
assert(getRegClassOrRegBank(VReg).isNull() ||
!getRegClassOrRegBank(VReg).is<const TargetRegisterClass *>() &&
"Can't set the size of a non-generic virtual register");
getVRegToType()[VReg] = Ty;
}