MC: Don't crash after issuing a diagnostic.
[oota-llvm.git] / lib / MC / MCInstrDesc.cpp
index 95e8325b9db0d9d5034034824624f6020e9a8604..5be2fa1b30b6aed7f6efa163bc99361dbf1df9ea 100644 (file)
 
 #include "llvm/MC/MCInstrDesc.h"
 #include "llvm/MC/MCInst.h"
+#include "llvm/MC/MCRegisterInfo.h"
+#include "llvm/MC/MCSubtargetInfo.h"
 
 using namespace llvm;
 
-bool MCInstrDesc::getDeprecatedInfo(MCInst &MI, MCSubtargetInfo &STI,
+bool MCInstrDesc::getDeprecatedInfo(MCInst &MI, const MCSubtargetInfo &STI,
                                     std::string &Info) const {
   if (ComplexDeprecationInfo)
     return ComplexDeprecationInfo(MI, STI, Info);
-  if ((DeprecatedFeatureMask & STI.getFeatureBits()) != 0) {
+  if (DeprecatedFeature != -1 && STI.getFeatureBits()[DeprecatedFeature]) {
     // FIXME: it would be nice to include the subtarget feature here.
     Info = "deprecated";
     return true;