Explicitly disallow predication in Thumb1 assembly.
authorJim Grosbach <grosbach@apple.com>
Thu, 25 Aug 2011 17:23:55 +0000 (17:23 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 25 Aug 2011 17:23:55 +0000 (17:23 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138562 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/ARM/AsmParser/ARMAsmParser.cpp

index f5d2a0ea3d655f8876666f68556dda89ad7318b5..f0d74f3345d39c4a5313f6cec80ee31112d55a56 100644 (file)
@@ -2952,6 +2952,12 @@ bool ARMAsmParser::ParseInstruction(StringRef Name, SMLoc NameLoc,
   Mnemonic = splitMnemonic(Mnemonic, PredicationCode, CarrySetting,
                            ProcessorIMod);
 
+  // In Thumb1, only the branch (B) instruction can be predicated.
+  if (isThumbOne() && PredicationCode != ARMCC::AL && Mnemonic != "b") {
+    Parser.EatToEndOfStatement();
+    return Error(NameLoc, "conditional execution not supported in Thumb1");
+  }
+
   Operands.push_back(ARMOperand::CreateToken(Mnemonic, NameLoc));
 
   // FIXME: This is all a pretty gross hack. We should automatically handle