MCInstrInfo.cpp 1.0 KB

123456789101112131415161718192021222324252627
  1. //===- lib/MC/MCInstrInfo.cpp - Target Instruction Info -------------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #include "llvm/MC/MCInstrInfo.h"
  9. #include "llvm/MC/MCInst.h"
  10. #include "llvm/MC/MCSubtargetInfo.h"
  11. using namespace llvm;
  12. bool MCInstrInfo::getDeprecatedInfo(MCInst &MI, const MCSubtargetInfo &STI,
  13. std::string &Info) const {
  14. unsigned Opcode = MI.getOpcode();
  15. if (ComplexDeprecationInfos && ComplexDeprecationInfos[Opcode])
  16. return ComplexDeprecationInfos[Opcode](MI, STI, Info);
  17. if (DeprecatedFeatures && DeprecatedFeatures[Opcode] != uint8_t(-1U) &&
  18. STI.getFeatureBits()[DeprecatedFeatures[Opcode]]) {
  19. // FIXME: it would be nice to include the subtarget feature here.
  20. Info = "deprecated";
  21. return true;
  22. }
  23. return false;
  24. }