From 9702e6075c3e4cd508fd787e3bf6b3e64eb029ab Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 9 Dec 2010 01:22:19 +0000 Subject: [PATCH] Add a sanity check assert() for t2ADD/SUBrSPi instructions that they really are 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/Target/ARM/ARMAsmPrinter.cpp b/lib/Target/ARM/ARMAsmPrinter.cpp index 05dfa552d1e..901a4ab7edd 100644 --- a/lib/Target/ARM/ARMAsmPrinter.cpp +++ b/lib/Target/ARM/ARMAsmPrinter.cpp @@ -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()) {