[MCInstPrinter] Enable MCInstPrinter to change its behavior based on the
authorAkira Hatanaka <ahatanaka@apple.com>
Fri, 27 Mar 2015 20:36:02 +0000 (20:36 +0000)
committerAkira Hatanaka <ahatanaka@apple.com>
Fri, 27 Mar 2015 20:36:02 +0000 (20:36 +0000)
commitf09378397e2ed3d2e916e321c528c1cfd0ec67ca
tree6627277941cf63cbc93026ce1d17465415d38b69
parent19e2fce680cbe1c6e644b48f29ff5ed461bb26eb
[MCInstPrinter] Enable MCInstPrinter to change its behavior based on the
per-function subtarget.

Currently, code-gen passes the default or generic subtarget to the constructors
of MCInstPrinter subclasses (see LLVMTargetMachine::addPassesToEmitFile), which
enables some targets (AArch64, ARM, and X86) to change their instprinter's
behavior based on the subtarget feature bits. Since the backend can now use
different subtargets for each function, instprinter has to be changed to use the
per-function subtarget rather than the default subtarget.

This patch takes the first step towards enabling instprinter to change its
behavior based on the per-function subtarget. It adds a bit "PassSubtarget" to
AsmWriter which tells table-gen to pass a reference to MCSubtargetInfo to the
various print methods table-gen auto-generates.

I will follow up with changes to instprinters of AArch64, ARM, and X86.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233411 91177308-0d34-0410-b5e6-96231b3b80d8
39 files changed:
include/llvm/MC/MCInstPrinter.h
include/llvm/Target/Target.td
lib/MC/MCAsmStreamer.cpp
lib/MC/MCDisassembler/Disassembler.cpp
lib/Target/AArch64/AArch64.td
lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp
lib/Target/AArch64/InstPrinter/AArch64InstPrinter.h
lib/Target/ARM/InstPrinter/ARMInstPrinter.cpp
lib/Target/ARM/InstPrinter/ARMInstPrinter.h
lib/Target/BPF/InstPrinter/BPFInstPrinter.cpp
lib/Target/BPF/InstPrinter/BPFInstPrinter.h
lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.cpp
lib/Target/Hexagon/MCTargetDesc/HexagonInstPrinter.h
lib/Target/MSP430/InstPrinter/MSP430InstPrinter.cpp
lib/Target/MSP430/InstPrinter/MSP430InstPrinter.h
lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
lib/Target/Mips/InstPrinter/MipsInstPrinter.h
lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.cpp
lib/Target/NVPTX/InstPrinter/NVPTXInstPrinter.h
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp
lib/Target/PowerPC/InstPrinter/PPCInstPrinter.h
lib/Target/R600/AMDGPUMCInstLower.cpp
lib/Target/R600/InstPrinter/AMDGPUInstPrinter.cpp
lib/Target/R600/InstPrinter/AMDGPUInstPrinter.h
lib/Target/Sparc/InstPrinter/SparcInstPrinter.cpp
lib/Target/Sparc/InstPrinter/SparcInstPrinter.h
lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.cpp
lib/Target/SystemZ/InstPrinter/SystemZInstPrinter.h
lib/Target/X86/InstPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/InstPrinter/X86ATTInstPrinter.h
lib/Target/X86/InstPrinter/X86IntelInstPrinter.cpp
lib/Target/X86/InstPrinter/X86IntelInstPrinter.h
lib/Target/XCore/InstPrinter/XCoreInstPrinter.cpp
lib/Target/XCore/InstPrinter/XCoreInstPrinter.h
tools/llvm-objdump/MachODump.cpp
tools/llvm-objdump/llvm-objdump.cpp
utils/TableGen/AsmWriterEmitter.cpp
utils/TableGen/AsmWriterInst.cpp
utils/TableGen/AsmWriterInst.h