mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Add support for printing pc-relative displacements of functions (as used in
the CALL instruction). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12630 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
f7e44ef8d5
commit
a778ca555a
@ -396,6 +396,12 @@ void V8Printer::printOperand(const MachineOperand &MO) {
|
|||||||
O << (int)MO.getImmedValue();
|
O << (int)MO.getImmedValue();
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_PCRelativeDisp: {
|
case MachineOperand::MO_PCRelativeDisp: {
|
||||||
|
if (isa<GlobalValue> (MO.getVRegValue ())) {
|
||||||
|
O << Mang->getValueName (MO.getVRegValue ());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
assert (isa<BasicBlock> (MO.getVRegValue ())
|
||||||
|
&& "Trying to look up something which is not a BB in the NumberForBB map");
|
||||||
ValueMapTy::const_iterator i = NumberForBB.find(MO.getVRegValue());
|
ValueMapTy::const_iterator i = NumberForBB.find(MO.getVRegValue());
|
||||||
assert (i != NumberForBB.end()
|
assert (i != NumberForBB.end()
|
||||||
&& "Could not find a BB in the NumberForBB map!");
|
&& "Could not find a BB in the NumberForBB map!");
|
||||||
|
@ -396,6 +396,12 @@ void V8Printer::printOperand(const MachineOperand &MO) {
|
|||||||
O << (int)MO.getImmedValue();
|
O << (int)MO.getImmedValue();
|
||||||
return;
|
return;
|
||||||
case MachineOperand::MO_PCRelativeDisp: {
|
case MachineOperand::MO_PCRelativeDisp: {
|
||||||
|
if (isa<GlobalValue> (MO.getVRegValue ())) {
|
||||||
|
O << Mang->getValueName (MO.getVRegValue ());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
assert (isa<BasicBlock> (MO.getVRegValue ())
|
||||||
|
&& "Trying to look up something which is not a BB in the NumberForBB map");
|
||||||
ValueMapTy::const_iterator i = NumberForBB.find(MO.getVRegValue());
|
ValueMapTy::const_iterator i = NumberForBB.find(MO.getVRegValue());
|
||||||
assert (i != NumberForBB.end()
|
assert (i != NumberForBB.end()
|
||||||
&& "Could not find a BB in the NumberForBB map!");
|
&& "Could not find a BB in the NumberForBB map!");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user