1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

[MachineRegisterInfo] Add a method to set the size of a virtual register a posteriori.

This is required for mir testing.

llvm-svn: 262861
This commit is contained in:
Quentin Colombet 2016-03-07 21:41:39 +00:00
parent 6941ebec51
commit 732081b83a
2 changed files with 9 additions and 0 deletions

View File

@ -603,6 +603,11 @@ public:
/// (target independent) virtual register.
unsigned getSize(unsigned VReg) const;
/// Set the size of \p VReg to \p Size.
/// Although the size should be set at build time, mir infrastructure
/// is not yet able to do it.
void setSize(unsigned VReg, unsigned Size);
/// Create and return a new generic virtual register with a size of \p Size.
/// \pre Size > 0.
unsigned createGenericVirtualRegister(unsigned Size);

View File

@ -109,6 +109,10 @@ MachineRegisterInfo::getSize(unsigned VReg) const {
return SizeIt != getVRegToSize().end() ? SizeIt->second : 0;
}
void MachineRegisterInfo::setSize(unsigned VReg, unsigned Size) {
getVRegToSize()[VReg] = Size;
}
unsigned
MachineRegisterInfo::createGenericVirtualRegister(unsigned Size) {
assert(Size && "Cannot create empty virtual register");