Check if operand has an allocated reg before requesting it.
authorMisha Brukman <brukman+llvm@gmail.com>
Thu, 1 Jul 2004 21:09:12 +0000 (21:09 +0000)
committerMisha Brukman <brukman+llvm@gmail.com>
Thu, 1 Jul 2004 21:09:12 +0000 (21:09 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14550 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPC32AsmPrinter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PowerPCAsmPrinter.cpp

index b06eb4bcc5915f60c4165dcd1afb7d6ac96be459..bc9a97ce0261b6b31a4b5542ec5874120ff49b83 100644 (file)
@@ -564,6 +564,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
   } else {
     for (i = 0; i < ArgCount; ++i) {
       if (i == 1 && ArgCount == 3 && ArgType[2] == PPC32II::Simm16 &&
+          MI->getOperand(1).hasAllocatedReg() && 
           MI->getOperand(1).getReg() == PPC32::R0) {
         O << "0";
       } else {
index b06eb4bcc5915f60c4165dcd1afb7d6ac96be459..bc9a97ce0261b6b31a4b5542ec5874120ff49b83 100644 (file)
@@ -564,6 +564,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
   } else {
     for (i = 0; i < ArgCount; ++i) {
       if (i == 1 && ArgCount == 3 && ArgType[2] == PPC32II::Simm16 &&
+          MI->getOperand(1).hasAllocatedReg() && 
           MI->getOperand(1).getReg() == PPC32::R0) {
         O << "0";
       } else {
index b06eb4bcc5915f60c4165dcd1afb7d6ac96be459..bc9a97ce0261b6b31a4b5542ec5874120ff49b83 100644 (file)
@@ -564,6 +564,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
   } else {
     for (i = 0; i < ArgCount; ++i) {
       if (i == 1 && ArgCount == 3 && ArgType[2] == PPC32II::Simm16 &&
+          MI->getOperand(1).hasAllocatedReg() && 
           MI->getOperand(1).getReg() == PPC32::R0) {
         O << "0";
       } else {