The "trap" instruction is one of this which doesn't have a condition code. Hack
authorBill Wendling <isanbard@gmail.com>
Sun, 21 Nov 2010 10:56:05 +0000 (10:56 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 21 Nov 2010 10:56:05 +0000 (10:56 +0000)
the code to not add a "condition code" if it's trap.

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

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index 4b21cc6d85b079aeb3b56f21f276e585a43815fa..7c34b58ec2001e2a0151cbfa063c82adee7d79a0 100644 (file)
@@ -857,8 +857,11 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
   }
 
   Operands.push_back(ARMOperand::CreateToken(Head, NameLoc));
-  // FIXME: Should only add this operand for predicated instructions
-  Operands.push_back(ARMOperand::CreateCondCode(ARMCC::CondCodes(CC), NameLoc));
+
+  if (Head != "trap")
+    // FIXME: Should only add this operand for predicated instructions
+    Operands.push_back(ARMOperand::CreateCondCode(ARMCC::CondCodes(CC),
+                                                  NameLoc));
 
   // Add the remaining tokens in the mnemonic.
   while (Next != StringRef::npos) {