From 0c49ac05cd2374a99a3126ebe6c8370490a73ca5 Mon Sep 17 00:00:00 2001 From: Jim Grosbach Date: Thu, 25 Aug 2011 17:23:55 +0000 Subject: [PATCH] Explicitly disallow predication in Thumb1 assembly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138562 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/ARM/AsmParser/ARMAsmParser.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp index f5d2a0ea3d6..f0d74f3345d 100644 --- a/lib/Target/ARM/AsmParser/ARMAsmParser.cpp +++ b/lib/Target/ARM/AsmParser/ARMAsmParser.cpp @@ -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