diff options
| author | Michael Trent <mtrent@apple.com> | 2018-12-20 17:51:17 +0000 |
|---|---|---|
| committer | Michael Trent <mtrent@apple.com> | 2018-12-20 17:51:17 +0000 |
| commit | f44d830e2da3fca9168110820e22d45f3e133579 (patch) | |
| tree | 3c4cd2e33c7c8c73221f229aef45a461e5f4f31e | |
| parent | 821c93d5562c751284cd38c3b77e9bacf2e6206e (diff) | |
| download | bcm5719-llvm-f44d830e2da3fca9168110820e22d45f3e133579.tar.gz bcm5719-llvm-f44d830e2da3fca9168110820e22d45f3e133579.zip | |
Add PLATFORM constants for iOS, tvOS, and watchOS simulators
Summary:
Add PLATFORM constants for iOS, tvOS, and watchOS simulators, as well
as human readable names for these constants, to the Mach-O file format
header files.
rdar://46854119
Reviewers: ab, davide
Reviewed By: ab, davide
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D55905
llvm-svn: 349779
| -rw-r--r-- | llvm/include/llvm/BinaryFormat/MachO.h | 5 | ||||
| -rw-r--r-- | llvm/include/llvm/Object/MachO.h | 3 | ||||
| -rw-r--r-- | llvm/lib/MC/MCAsmStreamer.cpp | 13 | ||||
| -rw-r--r-- | llvm/lib/MC/MCParser/DarwinAsmParser.cpp | 5 |
4 files changed, 19 insertions, 7 deletions
diff --git a/llvm/include/llvm/BinaryFormat/MachO.h b/llvm/include/llvm/BinaryFormat/MachO.h index c5294c76ebf..b3d60984249 100644 --- a/llvm/include/llvm/BinaryFormat/MachO.h +++ b/llvm/include/llvm/BinaryFormat/MachO.h @@ -486,7 +486,10 @@ enum PlatformType { PLATFORM_IOS = 2, PLATFORM_TVOS = 3, PLATFORM_WATCHOS = 4, - PLATFORM_BRIDGEOS = 5 + PLATFORM_BRIDGEOS = 5, + PLATFORM_IOSSIMULATOR = 7, + PLATFORM_TVOSSIMULATOR = 8, + PLATFORM_WATCHOSSIMULATOR = 9 }; // Values for tools enum in build_tool_version. diff --git a/llvm/include/llvm/Object/MachO.h b/llvm/include/llvm/Object/MachO.h index 159c1765ab8..09e0a78de44 100644 --- a/llvm/include/llvm/Object/MachO.h +++ b/llvm/include/llvm/Object/MachO.h @@ -616,6 +616,9 @@ public: case MachO::PLATFORM_TVOS: return "tvos"; case MachO::PLATFORM_WATCHOS: return "watchos"; case MachO::PLATFORM_BRIDGEOS: return "bridgeos"; + case MachO::PLATFORM_IOSSIMULATOR: return "iossimulator"; + case MachO::PLATFORM_TVOSSIMULATOR: return "tvossimulator"; + case MachO::PLATFORM_WATCHOSSIMULATOR: return "watchossimulator"; default: std::string ret; raw_string_ostream ss(ret); diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp index fd10c6901b7..4f0efab73e8 100644 --- a/llvm/lib/MC/MCAsmStreamer.cpp +++ b/llvm/lib/MC/MCAsmStreamer.cpp @@ -540,11 +540,14 @@ void MCAsmStreamer::EmitVersionMin(MCVersionMinType Type, unsigned Major, static const char *getPlatformName(MachO::PlatformType Type) { switch (Type) { - case MachO::PLATFORM_MACOS: return "macos"; - case MachO::PLATFORM_IOS: return "ios"; - case MachO::PLATFORM_TVOS: return "tvos"; - case MachO::PLATFORM_WATCHOS: return "watchos"; - case MachO::PLATFORM_BRIDGEOS: return "bridgeos"; + case MachO::PLATFORM_MACOS: return "macos"; + case MachO::PLATFORM_IOS: return "ios"; + case MachO::PLATFORM_TVOS: return "tvos"; + case MachO::PLATFORM_WATCHOS: return "watchos"; + case MachO::PLATFORM_BRIDGEOS: return "bridgeos"; + case MachO::PLATFORM_IOSSIMULATOR: return "iossimulator"; + case MachO::PLATFORM_TVOSSIMULATOR: return "tvossimulator"; + case MachO::PLATFORM_WATCHOSSIMULATOR: return "watchossimulator"; } llvm_unreachable("Invalid Mach-O platform type"); } diff --git a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp index 07926d6c1c9..cd99112292a 100644 --- a/llvm/lib/MC/MCParser/DarwinAsmParser.cpp +++ b/llvm/lib/MC/MCParser/DarwinAsmParser.cpp @@ -1148,7 +1148,10 @@ static Triple::OSType getOSTypeFromPlatform(MachO::PlatformType Type) { case MachO::PLATFORM_IOS: return Triple::IOS; case MachO::PLATFORM_TVOS: return Triple::TvOS; case MachO::PLATFORM_WATCHOS: return Triple::WatchOS; - case MachO::PLATFORM_BRIDGEOS: /* silence warning */break; + case MachO::PLATFORM_BRIDGEOS: /* silence warning */ break; + case MachO::PLATFORM_IOSSIMULATOR: /* silence warning */ break; + case MachO::PLATFORM_TVOSSIMULATOR: /* silence warning */ break; + case MachO::PLATFORM_WATCHOSSIMULATOR: /* silence warning */ break; } llvm_unreachable("Invalid mach-o platform type"); } |

