LLVM 23.0.0git
MCInstrInfo.cpp
Go to the documentation of this file.
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
10#include "llvm/MC/MCInst.h"
12
13using namespace llvm;
14
16 std::string &Info) const {
17 if (ComplexDeprecationInfo)
18 if (ComplexDeprecationInfo(MI, STI, Info))
19 return true;
20 unsigned Opcode = MI.getOpcode();
21 if (DeprecatedFeatures && DeprecatedFeatures[Opcode] != uint8_t(-1U) &&
22 STI.getFeatureBits()[DeprecatedFeatures[Opcode]]) {
23 // FIXME: it would be nice to include the subtarget feature here.
24 Info = "deprecated";
25 return true;
26 }
27 return false;
28}
IRTranslator LLVM IR MI
Instances of this class represent a single low-level machine instruction.
Definition MCInst.h:188
LLVM_ABI bool getDeprecatedInfo(MCInst &MI, const MCSubtargetInfo &STI, std::string &Info) const
Returns true if a certain instruction is deprecated and if so returns the reason in Info.
Generic base class for all target subtargets.
const FeatureBitset & getFeatureBits() const
This is an optimization pass for GlobalISel generic memory operations.