diff --git a/llvm/lib/TextAPI/InterfaceFile.cpp b/llvm/lib/TextAPI/InterfaceFile.cpp index efbf33b74776e..ce2feb65c9ec9 100644 --- a/llvm/lib/TextAPI/InterfaceFile.cpp +++ b/llvm/lib/TextAPI/InterfaceFile.cpp @@ -172,6 +172,7 @@ InterfaceFile::merge(const InterfaceFile *O) const { IF->setTwoLevelNamespace(isTwoLevelNamespace()); IF->setApplicationExtensionSafe(isApplicationExtensionSafe()); + IF->setOSLibNotForSharedCache(isOSLibNotForSharedCache()); for (const auto &It : umbrellas()) { if (!It.second.empty()) @@ -238,6 +239,8 @@ InterfaceFile::remove(Architecture Arch) const { return make_error<TextAPIError>(TextAPIErrorCode::NoSuchArchitecture); } + // FIXME: Figure out how to keep these attributes in sync when new ones are + // added. std::unique_ptr<InterfaceFile> IF(new InterfaceFile()); IF->setFileType(getFileType()); IF->setPath(getPath()); @@ -248,6 +251,7 @@ InterfaceFile::remove(Architecture Arch) const { IF->setSwiftABIVersion(getSwiftABIVersion()); IF->setTwoLevelNamespace(isTwoLevelNamespace()); IF->setApplicationExtensionSafe(isApplicationExtensionSafe()); + IF->setOSLibNotForSharedCache(isOSLibNotForSharedCache()); for (const auto &It : umbrellas()) if (It.first.Arch != Arch) IF->addParentUmbrella(It.first, It.second); @@ -316,6 +320,7 @@ InterfaceFile::extract(Architecture Arch) const { IF->setSwiftABIVersion(getSwiftABIVersion()); IF->setTwoLevelNamespace(isTwoLevelNamespace()); IF->setApplicationExtensionSafe(isApplicationExtensionSafe()); + IF->setOSLibNotForSharedCache(isOSLibNotForSharedCache()); for (const auto &It : umbrellas()) if (It.first.Arch == Arch) IF->addParentUmbrella(It.first, It.second); diff --git a/llvm/unittests/TextAPI/TextStubV5Tests.cpp b/llvm/unittests/TextAPI/TextStubV5Tests.cpp index 62fdd79ae4970..24577b3ec6148 100644 --- a/llvm/unittests/TextAPI/TextStubV5Tests.cpp +++ b/llvm/unittests/TextAPI/TextStubV5Tests.cpp @@ -2077,7 +2077,8 @@ TEST(TBDv5, RemoveIF) { "x86_64-macos" ], "attributes": [ - "flat_namespace" + "flat_namespace", + "not_for_dyld_shared_cache" ] } ], @@ -2242,6 +2243,7 @@ TEST(TBDv5, RemoveIF) { EXPECT_EQ(PackedVersion(1, 2, 0), RemovedFile->getCurrentVersion()); EXPECT_EQ(PackedVersion(1, 1, 0), RemovedFile->getCompatibilityVersion()); EXPECT_TRUE(RemovedFile->isApplicationExtensionSafe()); + EXPECT_TRUE(RemovedFile->isOSLibNotForSharedCache()); EXPECT_FALSE(RemovedFile->isTwoLevelNamespace()); EXPECT_EQ(0U, RemovedFile->documents().size());