mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-02 07:32:52 +00:00
Show stackmap entry encodings in stackmap debug logs. This makes it easier to
cross-reference debug output with encoded stack-maps, and to create stackmap test-cases. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195874 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
839b0556cd
commit
60ffb59df3
@ -251,6 +251,29 @@ void StackMaps::serializeToStackMapSection() {
|
|||||||
for (LocationVec::const_iterator LocI = CSLocs.begin(), LocE = CSLocs.end();
|
for (LocationVec::const_iterator LocI = CSLocs.begin(), LocE = CSLocs.end();
|
||||||
LocI != LocE; ++LocI, ++operIdx) {
|
LocI != LocE; ++LocI, ++operIdx) {
|
||||||
const Location &Loc = *LocI;
|
const Location &Loc = *LocI;
|
||||||
|
unsigned RegNo = 0;
|
||||||
|
int Offset = Loc.Offset;
|
||||||
|
if(Loc.Reg) {
|
||||||
|
RegNo = MCRI.getDwarfRegNum(Loc.Reg, false);
|
||||||
|
for (MCSuperRegIterator SR(Loc.Reg, TRI);
|
||||||
|
SR.isValid() && (int)RegNo < 0; ++SR) {
|
||||||
|
RegNo = TRI->getDwarfRegNum(*SR, false);
|
||||||
|
}
|
||||||
|
// If this is a register location, put the subregister byte offset in
|
||||||
|
// the location offset.
|
||||||
|
if (Loc.LocType == Location::Register) {
|
||||||
|
assert(!Loc.Offset && "Register location should have zero offset");
|
||||||
|
unsigned LLVMRegNo = MCRI.getLLVMRegNum(RegNo, false);
|
||||||
|
unsigned SubRegIdx = MCRI.getSubRegIndex(LLVMRegNo, Loc.Reg);
|
||||||
|
if (SubRegIdx)
|
||||||
|
Offset = MCRI.getSubRegIdxOffset(SubRegIdx);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
assert(Loc.LocType != Location::Register &&
|
||||||
|
"Missing location register");
|
||||||
|
}
|
||||||
|
|
||||||
DEBUG(
|
DEBUG(
|
||||||
dbgs() << WSMP << " Loc " << operIdx << ": ";
|
dbgs() << WSMP << " Loc " << operIdx << ": ";
|
||||||
switch (Loc.LocType) {
|
switch (Loc.LocType) {
|
||||||
@ -276,31 +299,12 @@ void StackMaps::serializeToStackMapSection() {
|
|||||||
dbgs() << "Constant Index " << Loc.Offset;
|
dbgs() << "Constant Index " << Loc.Offset;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dbgs() << "\n";
|
dbgs() << " [encoding: .byte " << Loc.LocType
|
||||||
|
<< ", .byte " << Loc.Size
|
||||||
|
<< ", .short " << RegNo
|
||||||
|
<< ", .int " << Offset << "]\n";
|
||||||
);
|
);
|
||||||
|
|
||||||
unsigned RegNo = 0;
|
|
||||||
int Offset = Loc.Offset;
|
|
||||||
if(Loc.Reg) {
|
|
||||||
RegNo = MCRI.getDwarfRegNum(Loc.Reg, false);
|
|
||||||
for (MCSuperRegIterator SR(Loc.Reg, TRI);
|
|
||||||
SR.isValid() && (int)RegNo < 0; ++SR) {
|
|
||||||
RegNo = TRI->getDwarfRegNum(*SR, false);
|
|
||||||
}
|
|
||||||
// If this is a register location, put the subregister byte offset in
|
|
||||||
// the location offset.
|
|
||||||
if (Loc.LocType == Location::Register) {
|
|
||||||
assert(!Loc.Offset && "Register location should have zero offset");
|
|
||||||
unsigned LLVMRegNo = MCRI.getLLVMRegNum(RegNo, false);
|
|
||||||
unsigned SubRegIdx = MCRI.getSubRegIndex(LLVMRegNo, Loc.Reg);
|
|
||||||
if (SubRegIdx)
|
|
||||||
Offset = MCRI.getSubRegIdxOffset(SubRegIdx);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
assert(Loc.LocType != Location::Register &&
|
|
||||||
"Missing location register");
|
|
||||||
}
|
|
||||||
AP.OutStreamer.EmitIntValue(Loc.LocType, 1);
|
AP.OutStreamer.EmitIntValue(Loc.LocType, 1);
|
||||||
AP.OutStreamer.EmitIntValue(Loc.Size, 1);
|
AP.OutStreamer.EmitIntValue(Loc.Size, 1);
|
||||||
AP.OutStreamer.EmitIntValue(RegNo, 2);
|
AP.OutStreamer.EmitIntValue(RegNo, 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user