The way we are trying to figure out banksel immediate operand may yield different...
authorSanjiv Gupta <sanjiv.gupta@microchip.com>
Thu, 9 Apr 2009 17:06:24 +0000 (17:06 +0000)
committerSanjiv Gupta <sanjiv.gupta@microchip.com>
Thu, 9 Apr 2009 17:06:24 +0000 (17:06 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68713 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PIC16/PIC16AsmPrinter.cpp

index 2af42cd16d81689e6e3040e021fffe94a004246b..5c4b353294cc4ab26ee9a419efeddbd384a2dd44 100644 (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);