[llvm] r224825 - MC: address some comments in deprecation checks

Saleem Abdulrasool compnerd at compnerd.org
Wed Dec 24 10:40:43 PST 2014


Author: compnerd
Date: Wed Dec 24 12:40:42 2014
New Revision: 224825

URL: http://llvm.org/viewvc/llvm-project?rev=224825&view=rev
Log:
MC: address some comments in deprecation checks

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.

Modified:
    llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp

Modified: llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp?rev=224825&r1=224824&r2=224825&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp (original)
+++ llvm/trunk/lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp Wed Dec 24 12:40:42 2014
@@ -77,8 +77,8 @@ static bool getITDeprecationInfo(MCInst
 
 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(M
 
 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;





More information about the llvm-commits mailing list