mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 06:25:18 +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:
@@ -108,7 +108,8 @@ namespace llvm {
|
||||
StringRef TT,
|
||||
StringRef CPU);
|
||||
typedef MCTargetAsmParser *(*MCAsmParserCtorTy)(MCSubtargetInfo &STI,
|
||||
MCAsmParser &P);
|
||||
MCAsmParser &P,
|
||||
const MCInstrInfo &MII);
|
||||
typedef MCDisassembler *(*MCDisassemblerCtorTy)(const Target &T,
|
||||
const MCSubtargetInfo &STI);
|
||||
typedef MCInstPrinter *(*MCInstPrinterCtorTy)(const Target &T,
|
||||
@@ -386,10 +387,11 @@ namespace llvm {
|
||||
/// \param Parser The target independent parser implementation to use for
|
||||
/// parsing and lexing.
|
||||
MCTargetAsmParser *createMCAsmParser(MCSubtargetInfo &STI,
|
||||
MCAsmParser &Parser) const {
|
||||
MCAsmParser &Parser,
|
||||
const MCInstrInfo &MII) const {
|
||||
if (!MCAsmParserCtorFn)
|
||||
return 0;
|
||||
return MCAsmParserCtorFn(STI, Parser);
|
||||
return MCAsmParserCtorFn(STI, Parser, MII);
|
||||
}
|
||||
|
||||
/// createAsmPrinter - Create a target specific assembly printer pass. This
|
||||
@@ -1142,8 +1144,9 @@ namespace llvm {
|
||||
}
|
||||
|
||||
private:
|
||||
static MCTargetAsmParser *Allocator(MCSubtargetInfo &STI, MCAsmParser &P) {
|
||||
return new MCAsmParserImpl(STI, P);
|
||||
static MCTargetAsmParser *Allocator(MCSubtargetInfo &STI, MCAsmParser &P,
|
||||
const MCInstrInfo &MII) {
|
||||
return new MCAsmParserImpl(STI, P, MII);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user