[macho][NFC] Extract all CPU_(SUB_)TYPE logic to BinaryFormat
authorFrancis Visoiu Mistrih <francisvm@yahoo.com>
Wed, 19 Feb 2020 00:39:05 +0000 (16:39 -0800)
committerFrancis Visoiu Mistrih <francisvm@yahoo.com>
Fri, 21 Feb 2020 20:43:29 +0000 (12:43 -0800)
commit1874dee5662603c9251228c71b66de72cec0c979
tree8742eaba03799ce305deadc6b95b966e8dc7ecd7
parent8875ee18d72b1b395331c1b7217d2b91fb4dc4b7
[macho][NFC] Extract all CPU_(SUB_)TYPE logic to BinaryFormat

This moves all the logic of converting LLVM Triples to
MachO::CPU_(SUB_)TYPE from the specific target (Target)AsmBackend to
more convenient functions in lib/BinaryFormat.

This also gets rid of the separate two X86AsmBackend classes.

The previous attempt was to add it to libObject, but that adds an
unnecessary dependency to libObject from all the targets.

Differential Revision: https://reviews.llvm.org/D74808
llvm/include/llvm/BinaryFormat/MachO.h
llvm/lib/BinaryFormat/CMakeLists.txt
llvm/lib/BinaryFormat/MachO.cpp [new file with mode: 0644]
llvm/lib/Target/AArch64/MCTargetDesc/AArch64AsmBackend.cpp
llvm/lib/Target/AArch64/MCTargetDesc/AArch64MachObjectWriter.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackend.cpp
llvm/lib/Target/ARM/MCTargetDesc/ARMAsmBackendDarwin.h
llvm/lib/Target/PowerPC/MCTargetDesc/PPCAsmBackend.cpp
llvm/lib/Target/X86/MCTargetDesc/X86AsmBackend.cpp