1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 13:11:39 +01:00

The way we are trying to figure out banksel immediate operand may yield different results for different type of insns. This will eventually need to be changed but currently let us prevent the crash in cases of incorrect detection of banksel operand.

llvm-svn: 68713
This commit is contained in:
Sanjiv Gupta 2009-04-09 17:06:24 +00:00
parent 301c4f39a0
commit 14c26ced49

View File

@ -77,8 +77,9 @@ bool PIC16AsmPrinter::printMachineInstruction(const MachineInstr *MI) {
// This is not true for external variables as section names for global
// variables in all files are same at this time. For eg. initialized
// data in put in idata.# section in all files.
if (((int)BS.getImm() == 1) &&
((Op.isGlobal() && Op.getGlobal()->hasExternalLinkage()) ||
if ((BS.getType() == MachineOperand::MO_Immediate
&& (int)BS.getImm() == 1)
&& ((Op.isGlobal() && Op.getGlobal()->hasExternalLinkage()) ||
(NewBank.compare(CurBank) != 0))) {
O << "\tbanksel ";
printOperand(MI, BankSelVar);