Add a sanity check assert() for t2ADD/SUBrSPi instructions that they really are
authorJim Grosbach <grosbach@apple.com>
Thu, 9 Dec 2010 01:22:19 +0000 (01:22 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 9 Dec 2010 01:22:19 +0000 (01:22 +0000)
referencing the stack pointer as they say they are.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121347 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/ARMAsmPrinter.cpp

index 05dfa552d1e7d12b97c9d665f2d75401f8b79231..901a4ab7edd2e19e416d1c3a12a122778a3e1570 100644 (file)
@@ -716,6 +716,13 @@ void ARMAsmPrinter::PrintDebugValueComment(const MachineInstr *MI,
 void ARMAsmPrinter::EmitInstruction(const MachineInstr *MI) {
   switch (MI->getOpcode()) {
   default: break;
+  case ARM::t2ADDrSPi:
+  case ARM::t2ADDrSPi12:
+  case ARM::t2SUBrSPi:
+  case ARM::t2SUBrSPi12:
+    assert (MI->getOperand(1).getReg() == ARM::SP);
+    break;
+
   case ARM::t2MOVi32imm: assert(0 && "Should be lowered by thumb2it pass");
   case ARM::DBG_VALUE: {
     if (isVerbose() && OutStreamer.hasRawTextSupport()) {