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