Add support for GlobalAddress's for alkis

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11560 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2004-02-17 18:23:55 +00:00
parent 9b9b7fc28d
commit cc0d2f586f
2 changed files with 14 additions and 3 deletions

View File

@ -602,7 +602,12 @@ void Emitter::emitInstruction(MachineInstr &MI) {
if (MI.getNumOperands() == 5) {
unsigned Size = sizeOfPtr(Desc);
emitConstant(MI.getOperand(4).getImmedValue(), Size);
if (MI.getOperand(4).isImmediate())
emitConstant(MI.getOperand(4).getImmedValue(), Size);
else if (MI.getOperand(4).isGlobalAddress())
emitGlobalAddressForPtr(MI.getOperand(4).getGlobal());
else
assert(0 && "Unknown operand!");
}
break;
}

View File

@ -100,8 +100,14 @@ static MachineInstr *MakeMRInst(unsigned Opcode, unsigned FrameIndex,
static MachineInstr *MakeMIInst(unsigned Opcode, unsigned FrameIndex,
MachineInstr *MI) {
return addFrameReference(BuildMI(Opcode, 5), FrameIndex)
.addZImm(MI->getOperand(1).getImmedValue());
if (MI->getOperand(1).isImmediate())
return addFrameReference(BuildMI(Opcode, 5), FrameIndex)
.addZImm(MI->getOperand(1).getImmedValue());
else if (MI->getOperand(1).isGlobalAddress())
return addFrameReference(BuildMI(Opcode, 5), FrameIndex)
.addGlobalAddress(MI->getOperand(1).getGlobal());
assert(0 && "Unknown operand for MakeMI!");
return 0;
}
static MachineInstr *MakeRMInst(unsigned Opcode, unsigned FrameIndex,