mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-23 14:25:07 +00:00
Add an instruction deprecation feature to TableGen.
The 'Deprecated' class allows you to specify a SubtargetFeature that the instruction is deprecated on. The 'ComplexDeprecationPredicate' class allows you to define a custom predicate that is called to check for deprecation. For example: ComplexDeprecationPredicate<"MCR"> would mean you would have to define the following function: bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI, std::string &Info) Which returns 'false' for not deprecated, and 'true' for deprecated and store the warning message in 'Info'. The MCTargetAsmParser constructor was chaned to take an extra argument of the MCInstrInfo class, so out-of-tree targets will need to be changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190598 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -26,16 +26,32 @@
|
||||
#include "llvm/Support/ErrorHandling.h"
|
||||
#include "llvm/Support/TargetRegistry.h"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
#define GET_REGINFO_MC_DESC
|
||||
#include "ARMGenRegisterInfo.inc"
|
||||
|
||||
static bool getMCRDeprecationInfo(MCInst &MI, MCSubtargetInfo &STI,
|
||||
std::string &Info) {
|
||||
// Checks for the deprecated CP15ISB encoding:
|
||||
// mcr pX, #0, rX, c7, c5, #4
|
||||
if (STI.getFeatureBits() & llvm::ARM::HasV8Ops &&
|
||||
(MI.getOperand(1).isImm() && MI.getOperand(1).getImm() == 0) &&
|
||||
(MI.getOperand(3).isImm() && MI.getOperand(3).getImm() == 7) &&
|
||||
(MI.getOperand(4).isImm() && MI.getOperand(4).getImm() == 5) &&
|
||||
(MI.getOperand(5).isImm() && MI.getOperand(5).getImm() == 4)) {
|
||||
Info = "deprecated on armv8";
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
#define GET_INSTRINFO_MC_DESC
|
||||
#include "ARMGenInstrInfo.inc"
|
||||
|
||||
#define GET_SUBTARGETINFO_MC_DESC
|
||||
#include "ARMGenSubtargetInfo.inc"
|
||||
|
||||
using namespace llvm;
|
||||
|
||||
std::string ARM_MC::ParseARMTriple(StringRef TT, StringRef CPU) {
|
||||
Triple triple(TT);
|
||||
|
Reference in New Issue
Block a user