Move the Mips target to storing the ABI in the TargetMachine rather
authorEric Christopher <echristo@gmail.com>
Mon, 26 Jan 2015 17:33:46 +0000 (17:33 +0000)
committerEric Christopher <echristo@gmail.com>
Mon, 26 Jan 2015 17:33:46 +0000 (17:33 +0000)
commitfcd3c4065d3492c5b688d2044ef9e7edbfbcdf4e
tree3162fc525958918bd14a11b203bda0a97e177215
parent5da54492f13f4263eeb4323f4c7baaaa11807519
Move the Mips target to storing the ABI in the TargetMachine rather
than on MipsSubtargetInfo.

This required a bit of massaging in the MC level to handle this since
MC is a) largely a collection of disparate classes with no hierarchy,
and b) there's no overarching equivalent to the TargetMachine, instead
only the subtarget via MCSubtargetInfo (which is the base class of
TargetSubtargetInfo).

We're now storing the ABI in both the TargetMachine level and in the
MC level because the AsmParser and the TargetStreamer both need to
know what ABI we have to parse assembly and emit objects. The target
streamer has a pointer to the one in the asm parser and is updated
when the asm parser is created. This is fragile as the FIXME comment
notes, but shouldn't be a problem in practice since we always
create an asm parser before attempting to emit object code via the
assembler. The TargetMachine now contains the ABI so that the DataLayout
can be constructed dependent upon ABI.

All testcases have been updated to use the -target-abi command line
flag so that we can set the ABI without using a subtarget feature.

Should be no change visible externally here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@227102 91177308-0d34-0410-b5e6-96231b3b80d8
55 files changed:
lib/Target/Mips/AsmParser/MipsAsmParser.cpp
lib/Target/Mips/MCTargetDesc/MipsABIInfo.cpp
lib/Target/Mips/MCTargetDesc/MipsABIInfo.h
lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
lib/Target/Mips/MCTargetDesc/MipsOptionRecord.cpp
lib/Target/Mips/MCTargetDesc/MipsTargetStreamer.cpp
lib/Target/Mips/Mips.td
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsLongBranch.cpp
lib/Target/Mips/MipsOptionRecord.h
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/Mips/MipsTargetMachine.cpp
lib/Target/Mips/MipsTargetMachine.h
lib/Target/Mips/MipsTargetStreamer.h
test/CodeGen/Mips/2009-11-16-CstPoolLoad.ll
test/CodeGen/Mips/abiflags32.ll
test/CodeGen/Mips/blockaddr.ll
test/CodeGen/Mips/cconv/arguments-float.ll
test/CodeGen/Mips/cconv/arguments-fp128.ll
test/CodeGen/Mips/cconv/arguments-hard-float-varargs.ll
test/CodeGen/Mips/cconv/arguments-hard-float.ll
test/CodeGen/Mips/cconv/arguments-hard-fp128.ll
test/CodeGen/Mips/cconv/arguments-struct.ll
test/CodeGen/Mips/cconv/arguments-varargs.ll
test/CodeGen/Mips/cconv/arguments.ll
test/CodeGen/Mips/cconv/callee-saved-float.ll
test/CodeGen/Mips/cconv/callee-saved.ll
test/CodeGen/Mips/cconv/memory-layout.ll
test/CodeGen/Mips/cconv/reserved-space.ll
test/CodeGen/Mips/cconv/return-float.ll
test/CodeGen/Mips/cconv/return-hard-float.ll
test/CodeGen/Mips/cconv/return-hard-fp128.ll
test/CodeGen/Mips/cconv/return-hard-struct-f128.ll
test/CodeGen/Mips/cconv/return-struct.ll
test/CodeGen/Mips/cconv/return.ll
test/CodeGen/Mips/cconv/stack-alignment.ll
test/CodeGen/Mips/fpxx.ll
test/CodeGen/Mips/global-address.ll
test/CodeGen/Mips/mips64fpldst.ll
test/CodeGen/Mips/mips64intldst.ll
test/CodeGen/Mips/named-register-n32.ll
test/CodeGen/Mips/start-asm-file.ll
test/MC/Mips/cpload.s
test/MC/Mips/cpsetup.s
test/MC/Mips/elf_eflags.s
test/MC/Mips/elf_reginfo.s
test/MC/Mips/mips-reginfo-fp64.s
test/MC/Mips/mips64-register-names-n32-n64.s
test/MC/Mips/mips64-register-names-o32.s
test/MC/Mips/nabi-regs.s
test/MC/Mips/nooddspreg-cmdarg.s
test/MC/Mips/nooddspreg.s
test/MC/Mips/oddspreg.s