[llvm] 3ed88b0 - [llvm][TextAPI/MachO] Support writing single macCatalyst platform

Jonas Devlieghere via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 10:21:16 PST 2020


Author: Jonas Devlieghere
Date: 2020-01-27T10:21:06-08:00
New Revision: 3ed88b052b198285d4464166b728ec2e236f814e

URL: https://github.com/llvm/llvm-project/commit/3ed88b052b198285d4464166b728ec2e236f814e
DIFF: https://github.com/llvm/llvm-project/commit/3ed88b052b198285d4464166b728ec2e236f814e.diff

LOG: [llvm][TextAPI/MachO] Support writing single macCatalyst platform

TAPI currently lacks a way to emit the macCatalyst platform. For TBD_V3
is does support zippered frameworks given that both macOS and
macCatalyst are part of the PlatformSet.

Differential revision: https://reviews.llvm.org/D73325

Added: 
    

Modified: 
    llvm/lib/TextAPI/MachO/TextStubCommon.cpp
    llvm/unittests/TextAPI/TextStubV3Tests.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/TextAPI/MachO/TextStubCommon.cpp b/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
index 183c5d5a93b0..a7fd58fba5f9 100644
--- a/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
+++ b/llvm/lib/TextAPI/MachO/TextStubCommon.cpp
@@ -74,6 +74,9 @@ void ScalarTraits<PlatformSet>::output(const PlatformSet &Values, void *IO,
   case PlatformKind::bridgeOS:
     OS << "bridgeos";
     break;
+  case PlatformKind::macCatalyst:
+    OS << "iosmac";
+    break;
   }
 }
 

diff  --git a/llvm/unittests/TextAPI/TextStubV3Tests.cpp b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
index 6d27700758ec..4a05920805e9 100644
--- a/llvm/unittests/TextAPI/TextStubV3Tests.cpp
+++ b/llvm/unittests/TextAPI/TextStubV3Tests.cpp
@@ -329,15 +329,11 @@ TEST(TBDv3, Platform_macCatalyst) {
   EXPECT_EQ(FileType::TBD_V3, File->getFileType());
   EXPECT_EQ(Platform, *File->getPlatforms().begin());
 
-  // It's not currently possible to emit the iomac platform. Enable this once
-  // that's fixed.
-#if 0
   SmallString<4096> Buffer;
   raw_svector_ostream OS(Buffer);
   auto WriteResult = TextAPIWriter::writeToStream(OS, *File);
   EXPECT_TRUE(!WriteResult);
   EXPECT_EQ(stripWhitespace(tbd_v3_platform_iosmac), stripWhitespace(Buffer.c_str()));
-#endif
 }
 
 TEST(TBDv3, Platform_zippered) {


        


More information about the llvm-commits mailing list