MC: address some comments in deprecation checks
authorSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 24 Dec 2014 18:40:42 +0000 (18:40 +0000)
committerSaleem Abdulrasool <compnerd@compnerd.org>
Wed, 24 Dec 2014 18:40:42 +0000 (18:40 +0000)
Bob Wilson pointed out the unnecessary checks that had been committed to the
instruction check predicates.  The check was meant to ensure that the check was
not accidentally applied to non-ARM instructions.  This is better served as an
assertion rather than a condition check.

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

lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp

index 2cbc071f74e9438c81ddb684469ebf03ca1680cf..a6310e5093bc6bb05426bb10421f1c59b16985fe 100644 (file)
@@ -77,8 +77,8 @@ static bool getITDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
 
 static bool getARMStoreDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
                                        std::string &Info) {
-  if (STI.getFeatureBits() & llvm::ARM::ModeThumb)
-    return false;
+  assert((~STI.getFeatureBits() & llvm::ARM::ModeThumb) &&
+         "cannot predicate thumb instructions");
 
   assert(MI.getNumOperands() >= 4 && "expected >= 4 arguments");
   for (unsigned OI = 4, OE = MI.getNumOperands(); OI < OE; ++OI) {
@@ -94,8 +94,8 @@ static bool getARMStoreDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
 
 static bool getARMLoadDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
                                       std::string &Info) {
-  if (STI.getFeatureBits() & llvm::ARM::ModeThumb)
-    return false;
+  assert((~STI.getFeatureBits() & llvm::ARM::ModeThumb) &&
+         "cannot predicate thumb instructions");
 
   assert(MI.getNumOperands() >= 4 && "expected >= 4 arguments");
   bool ListContainsPC = false, ListContainsLR = false;