Add an instruction deprecation feature to TableGen.
authorJoey Gouly <joey.gouly@arm.com>
Thu, 12 Sep 2013 10:28:05 +0000 (10:28 +0000)
committerJoey Gouly <joey.gouly@arm.com>
Thu, 12 Sep 2013 10:28:05 +0000 (10:28 +0000)
commit715d98d657491b3fb8ea0e14643e9801b2f9628c
treed4d597bcfaee4367d1c0cbfebcc1dbb7274db0ed
parentf9d2d2dc89f0c2d39f597038ee723fb9c9af91da
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
20 files changed:
include/llvm/CodeGen/AsmPrinter.h
include/llvm/MC/MCInstrDesc.h
include/llvm/Support/TargetRegistry.h
include/llvm/Target/Target.td
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/ARM/MCTargetDesc/ARMMCTargetDesc.cpp
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/PowerPC/AsmParser/PPCAsmParser.cpp
lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp
lib/Target/X86/AsmParser/X86AsmParser.cpp
test/MC/ARM/deprecated-v8.s
tools/llvm-mc/llvm-mc.cpp
utils/TableGen/AsmMatcherEmitter.cpp
utils/TableGen/CodeGenInstruction.cpp
utils/TableGen/CodeGenInstruction.h
utils/TableGen/InstrInfoEmitter.cpp