aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/TextAPI/InterfaceFile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TextAPI/InterfaceFile.cpp')
-rw-r--r--llvm/lib/TextAPI/InterfaceFile.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/llvm/lib/TextAPI/InterfaceFile.cpp b/llvm/lib/TextAPI/InterfaceFile.cpp
index d712ed3..9979df92 100644
--- a/llvm/lib/TextAPI/InterfaceFile.cpp
+++ b/llvm/lib/TextAPI/InterfaceFile.cpp
@@ -11,6 +11,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/TextAPI/InterfaceFile.h"
+#include "llvm/TextAPI/RecordsSlice.h"
#include "llvm/TextAPI/TextAPIError.h"
#include <iomanip>
#include <sstream>
@@ -351,6 +352,34 @@ InterfaceFile::extract(Architecture Arch) const {
return std::move(IF);
}
+void InterfaceFile::setFromBinaryAttrs(const RecordsSlice::BinaryAttrs &BA,
+ const Target &Targ) {
+ if (getFileType() != BA.File)
+ setFileType(BA.File);
+ if (getInstallName().empty())
+ setInstallName(BA.InstallName);
+ if (BA.AppExtensionSafe && !isApplicationExtensionSafe())
+ setApplicationExtensionSafe();
+ if (BA.TwoLevelNamespace && !isTwoLevelNamespace())
+ setTwoLevelNamespace();
+ if (BA.OSLibNotForSharedCache && !isOSLibNotForSharedCache())
+ setOSLibNotForSharedCache();
+ if (getCurrentVersion().empty())
+ setCurrentVersion(BA.CurrentVersion);
+ if (getCompatibilityVersion().empty())
+ setCompatibilityVersion(BA.CompatVersion);
+ if (getSwiftABIVersion() == 0)
+ setSwiftABIVersion(BA.SwiftABI);
+ if (getPath().empty())
+ setPath(BA.Path);
+ if (!BA.ParentUmbrella.empty())
+ addParentUmbrella(Targ, BA.ParentUmbrella);
+ for (const auto &Client : BA.AllowableClients)
+ addAllowableClient(Client, Targ);
+ for (const auto &Lib : BA.RexportedLibraries)
+ addReexportedLibrary(Lib, Targ);
+}
+
static bool isYAMLTextStub(const FileType &Kind) {
return (Kind >= FileType::TBD_V1) && (Kind < FileType::TBD_V5);
}