mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-25 13:24:46 +00:00
Lowers block address. Currently asserts when relocation model is not PIC. Patch by Akira Hatanaka
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -121,7 +121,8 @@ SelectAddr(SDValue Addr, SDValue &Offset, SDValue &Base) {
|
||||
if (TM.getRelocationModel() == Reloc::PIC_) {
|
||||
if ((Addr.getOpcode() == ISD::TargetGlobalAddress) ||
|
||||
(Addr.getOpcode() == ISD::TargetConstantPool) ||
|
||||
(Addr.getOpcode() == ISD::TargetJumpTable)){
|
||||
(Addr.getOpcode() == ISD::TargetJumpTable) ||
|
||||
(Addr.getOpcode() == ISD::TargetBlockAddress)) {
|
||||
Base = CurDAG->getRegister(Mips::GP, MVT::i32);
|
||||
Offset = Addr;
|
||||
return true;
|
||||
@@ -170,6 +171,11 @@ SelectAddr(SDValue Addr, SDValue &Offset, SDValue &Base) {
|
||||
}
|
||||
}
|
||||
|
||||
if (isa<BlockAddressSDNode>(Addr.getOperand(1))) {
|
||||
Base = Addr.getOperand(0);
|
||||
Offset = Addr.getOperand(1);
|
||||
}
|
||||
|
||||
Base = Addr;
|
||||
Offset = CurDAG->getTargetConstant(0, MVT::i32);
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user