mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-15 21:24:00 +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:
@ -337,6 +337,20 @@ CodeGenInstruction::CodeGenInstruction(Record *R)
|
||||
|
||||
// Parse the DisableEncoding field.
|
||||
Operands.ProcessDisableEncoding(R->getValueAsString("DisableEncoding"));
|
||||
|
||||
// First check for a ComplexDeprecationPredicate.
|
||||
if (R->getValue("ComplexDeprecationPredicate")) {
|
||||
HasComplexDeprecationPredicate = true;
|
||||
DeprecatedReason = R->getValueAsString("ComplexDeprecationPredicate");
|
||||
} else if (RecordVal *Dep = R->getValue("DeprecatedFeatureMask")) {
|
||||
// Check if we have a Subtarget feature mask.
|
||||
HasComplexDeprecationPredicate = false;
|
||||
DeprecatedReason = Dep->getValue()->getAsString();
|
||||
} else {
|
||||
// This instruction isn't deprecated.
|
||||
HasComplexDeprecationPredicate = false;
|
||||
DeprecatedReason = "";
|
||||
}
|
||||
}
|
||||
|
||||
/// HasOneImplicitDefWithKnownVT - If the instruction has at least one
|
||||
|
Reference in New Issue
Block a user