diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2020-01-24 22:00:03 +0000 |
commit | 480093f4440d54b30b3025afeac24b48f2ba7a2e (patch) | |
tree | 162e72994062888647caf0d875428db9445491a8 /contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp | |
parent | 489b1cf2ecf5b9b4a394857987014bfb09067726 (diff) | |
parent | 706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff) |
Notes
Diffstat (limited to 'contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp b/contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp index c0c873f97354..8540b7ab03cd 100644 --- a/contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp +++ b/contrib/llvm-project/llvm/lib/Object/MachOObjectFile.cpp @@ -128,6 +128,10 @@ static unsigned getCPUType(const MachOObjectFile &O) { return O.getHeader().cputype; } +static unsigned getCPUSubType(const MachOObjectFile &O) { + return O.getHeader().cpusubtype; +} + static uint32_t getPlainRelocationAddress(const MachO::any_relocation_info &RE) { return RE.r_word0; @@ -2565,7 +2569,7 @@ StringRef MachOObjectFile::getFileFormatName() const { } } -Triple::ArchType MachOObjectFile::getArch(uint32_t CPUType) { +Triple::ArchType MachOObjectFile::getArch(uint32_t CPUType, uint32_t CPUSubType) { switch (CPUType) { case MachO::CPU_TYPE_I386: return Triple::x86; @@ -2737,7 +2741,7 @@ ArrayRef<StringRef> MachOObjectFile::getValidArchs() { } Triple::ArchType MachOObjectFile::getArch() const { - return getArch(getCPUType(*this)); + return getArch(getCPUType(*this), getCPUSubType(*this)); } Triple MachOObjectFile::getArchTriple(const char **McpuDefault) const { |