summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-09 17:06:24 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-09 17:06:24 +0000
commit38533d48ddac4dba0c237470c7bb60308a2bc8cf (patch)
tree2e954b11c59310b2e07dcfda5d993b478f3d8c7a
parenta725028d41bd1c339dfc75de9e8c98d2e3987155 (diff)
downloadbcm5719-llvm-38533d48ddac4dba0c237470c7bb60308a2bc8cf.tar.gz
bcm5719-llvm-38533d48ddac4dba0c237470c7bb60308a2bc8cf.zip
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
-rw-r--r--llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
index 2af42cd16d8..5c4b353294c 100644
--- a/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
+++ b/llvm/lib/Target/PIC16/PIC16AsmPrinter.cpp
@@ -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);
OpenPOWER on IntegriCloud