diff options
| author | Quentin Colombet <qcolombet@apple.com> | 2016-06-08 23:27:46 +0000 |
|---|---|---|
| committer | Quentin Colombet <qcolombet@apple.com> | 2016-06-08 23:27:46 +0000 |
| commit | 2c6469687d6e9c65f8060ced5768a36864784a13 (patch) | |
| tree | fd8ac4d2de86f23c9fc9d92fc46d458f820913dc /llvm/lib/CodeGen/MIRParser/MIRParser.cpp | |
| parent | f05f360debba5bb7b096f7ad8b6effc8c084609c (diff) | |
| download | bcm5719-llvm-2c6469687d6e9c65f8060ced5768a36864784a13.tar.gz bcm5719-llvm-2c6469687d6e9c65f8060ced5768a36864784a13.zip | |
[MIR] Check that generic virtual registers get a size.
Without that check it was possible to write test cases where the size
was not specified and we ended up with weird asserts down the road,
because the default value (1) would not make sense.
llvm-svn: 272226
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIRParser.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/MIRParser/MIRParser.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp index 69aae373f2e..e977973b1a5 100644 --- a/llvm/lib/CodeGen/MIRParser/MIRParser.cpp +++ b/llvm/lib/CodeGen/MIRParser/MIRParser.cpp @@ -365,6 +365,7 @@ bool MIRParserImpl::initializeRegisterInfo(MachineFunction &MF, // This is a generic virtual register. // The size will be set appropriately when we reach the definition. Reg = RegInfo.createGenericVirtualRegister(/*Size*/ 1); + PFS.GenericVRegs.insert(Reg); } else { const auto *RC = getRegClass(MF, VReg.Class.Value); if (RC) { @@ -378,6 +379,7 @@ bool MIRParserImpl::initializeRegisterInfo(MachineFunction &MF, VReg.Class.Value + "'"); Reg = RegInfo.createGenericVirtualRegister(/*Size*/ 1); RegInfo.setRegBank(Reg, *RegBank); + PFS.GenericVRegs.insert(Reg); } } if (!PFS.VirtualRegisterSlots.insert(std::make_pair(VReg.ID.Value, Reg)) |

