mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-09 22:04:10 +00:00
Document the shortcomings of DwarfExpression::addMachineReg().
Also make a drive-by-fix of a bug in the subregister scan code that only triggers with an incomplete or otherwise very irregular machine description. rdar://problem/37404493 llvm-svn: 324972
This commit is contained in:
parent
870f6d17a4
commit
455280bb24
@ -123,7 +123,10 @@ bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI,
|
||||
const TargetRegisterClass *RC = TRI.getMinimalPhysRegClass(MachineReg);
|
||||
unsigned RegSize = TRI.getRegSizeInBits(*RC);
|
||||
// Keep track of the bits in the register we already emitted, so we
|
||||
// can avoid emitting redundant aliasing subregs.
|
||||
// can avoid emitting redundant aliasing subregs. Because this is
|
||||
// just doing a greedy scan of all subregisters, it is possible that
|
||||
// this doesn't find a combination of subregisters that fully cover
|
||||
// the register (even though one may exist).
|
||||
SmallBitVector Coverage(RegSize, false);
|
||||
for (MCSubRegIterator SR(MachineReg, &TRI); SR.isValid(); ++SR) {
|
||||
unsigned Idx = TRI.getSubRegIndex(MachineReg, *SR);
|
||||
@ -143,7 +146,7 @@ bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI,
|
||||
if (CurSubReg.test(Coverage)) {
|
||||
// Emit a piece for any gap in the coverage.
|
||||
if (Offset > CurPos)
|
||||
DwarfRegs.push_back({-1, Offset - CurPos, nullptr});
|
||||
DwarfRegs.push_back({-1, Offset - CurPos, "no DWARF register encoding"});
|
||||
DwarfRegs.push_back(
|
||||
{Reg, std::min<unsigned>(Size, MaxSize - Offset), "sub-register"});
|
||||
if (Offset >= MaxSize)
|
||||
@ -154,7 +157,8 @@ bool DwarfExpression::addMachineReg(const TargetRegisterInfo &TRI,
|
||||
CurPos = Offset + Size;
|
||||
}
|
||||
}
|
||||
|
||||
if (CurPos < RegSize)
|
||||
DwarfRegs.push_back({-1, RegSize - CurPos, "no DWARF register encoding"});
|
||||
return CurPos;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user