[llvm-commits] [llvm] r68713 - /llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
Sanjiv Gupta
sanjiv.gupta at microchip.com
Thu Apr 9 10:06:24 PDT 2009
Author: sgupta
Date: Thu Apr 9 12:06:24 2009
New Revision: 68713
URL: http://llvm.org/viewvc/llvm-project?rev=68713&view=rev
Log:
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.
Modified:
llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
Modified: llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp?rev=68713&r1=68712&r2=68713&view=diff
==============================================================================
--- llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp (original)
+++ llvm/trunk/lib/Target/PIC16/PIC16AsmPrinter.cpp Thu Apr 9 12:06:24 2009
@@ -77,8 +77,9 @@
// 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);
More information about the llvm-commits
mailing list