[PATCH] D55905: Add PLATFORM constants for iOS, tvOS, and watchOS simulators

Michael Trent via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 19 15:24:34 PST 2018


mtrent created this revision.
mtrent added reviewers: ab, davide.

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


Repository:
  rL LLVM

https://reviews.llvm.org/D55905

Files:
  include/llvm/BinaryFormat/MachO.h
  include/llvm/Object/MachO.h
  lib/MC/MCAsmStreamer.cpp
  lib/MC/MCParser/DarwinAsmParser.cpp


Index: lib/MC/MCParser/DarwinAsmParser.cpp
===================================================================
--- lib/MC/MCParser/DarwinAsmParser.cpp
+++ lib/MC/MCParser/DarwinAsmParser.cpp
@@ -1148,7 +1148,10 @@
   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");
 }
Index: lib/MC/MCAsmStreamer.cpp
===================================================================
--- lib/MC/MCAsmStreamer.cpp
+++ lib/MC/MCAsmStreamer.cpp
@@ -540,11 +540,14 @@
 
 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");
 }
Index: include/llvm/Object/MachO.h
===================================================================
--- include/llvm/Object/MachO.h
+++ include/llvm/Object/MachO.h
@@ -616,6 +616,9 @@
     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);
Index: include/llvm/BinaryFormat/MachO.h
===================================================================
--- include/llvm/BinaryFormat/MachO.h
+++ include/llvm/BinaryFormat/MachO.h
@@ -486,7 +486,10 @@
   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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D55905.178977.patch
Type: text/x-patch
Size: 2943 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181219/210a72ba/attachment-0001.bin>


More information about the llvm-commits mailing list