204 using namespace llvm;
209 struct ExportSection {
210 std::vector<Architecture> Architectures;
211 std::vector<FlowStringRef> AllowableClients;
212 std::vector<FlowStringRef> ReexportedLibraries;
213 std::vector<FlowStringRef>
Symbols;
214 std::vector<FlowStringRef> Classes;
215 std::vector<FlowStringRef> ClassEHs;
216 std::vector<FlowStringRef> IVars;
217 std::vector<FlowStringRef> WeakDefSymbols;
218 std::vector<FlowStringRef> TLVSymbols;
221 struct UndefinedSection {
222 std::vector<Architecture> Architectures;
223 std::vector<FlowStringRef>
Symbols;
224 std::vector<FlowStringRef> Classes;
225 std::vector<FlowStringRef> ClassEHs;
226 std::vector<FlowStringRef> IVars;
227 std::vector<FlowStringRef> WeakRefSymbols;
231 struct SymbolSection {
233 std::vector<FlowStringRef>
Symbols;
234 std::vector<FlowStringRef> Classes;
235 std::vector<FlowStringRef> ClassEHs;
236 std::vector<FlowStringRef> Ivars;
237 std::vector<FlowStringRef> WeakSymbols;
238 std::vector<FlowStringRef> TlvSymbols;
241 struct MetadataSection {
242 enum Option { Clients, Libraries };
243 std::vector<Target> Targets;
244 std::vector<FlowStringRef> Values;
247 struct UmbrellaSection {
248 std::vector<Target> Targets;
249 std::string Umbrella;
258 UUIDv4(
const Target &TargetID,
const std::string &Value)
259 : TargetID(TargetID), Value(Value) {}
265 FlatNamespace = 1U << 0,
266 NotApplicationExtensionSafe = 1U << 1,
267 InstallAPI = 1U << 2,
274 LLVM_YAML_IS_SEQUENCE_VECTOR(ExportSection)
275 LLVM_YAML_IS_SEQUENCE_VECTOR(UndefinedSection)
277 LLVM_YAML_IS_SEQUENCE_VECTOR(SymbolSection)
278 LLVM_YAML_IS_SEQUENCE_VECTOR(MetadataSection)
279 LLVM_YAML_IS_SEQUENCE_VECTOR(UmbrellaSection)
280 LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(
Target)
281 LLVM_YAML_IS_SEQUENCE_VECTOR(UUIDv4)
288 const auto *Ctx =
reinterpret_cast<TextAPIContext *
>(IO.getContext());
290 "File type is not set in YAML context");
292 IO.mapRequired(
"archs", Section.Architectures);
294 IO.mapOptional(
"allowed-clients", Section.AllowableClients);
296 IO.mapOptional(
"allowable-clients", Section.AllowableClients);
297 IO.mapOptional(
"re-exports", Section.ReexportedLibraries);
298 IO.mapOptional(
"symbols", Section.Symbols);
299 IO.mapOptional(
"objc-classes", Section.Classes);
301 IO.mapOptional(
"objc-eh-types", Section.ClassEHs);
302 IO.mapOptional(
"objc-ivars", Section.IVars);
303 IO.mapOptional(
"weak-def-symbols", Section.WeakDefSymbols);
304 IO.mapOptional(
"thread-local-symbols", Section.TLVSymbols);
310 const auto *Ctx =
reinterpret_cast<TextAPIContext *
>(IO.getContext());
312 "File type is not set in YAML context");
314 IO.mapRequired(
"archs", Section.Architectures);
315 IO.mapOptional(
"symbols", Section.Symbols);
316 IO.mapOptional(
"objc-classes", Section.Classes);
318 IO.mapOptional(
"objc-eh-types", Section.ClassEHs);
319 IO.mapOptional(
"objc-ivars", Section.IVars);
320 IO.mapOptional(
"weak-ref-symbols", Section.WeakRefSymbols);
326 IO.mapRequired(
"targets", Section.Targets);
327 IO.mapOptional(
"symbols", Section.Symbols);
328 IO.mapOptional(
"objc-classes", Section.Classes);
329 IO.mapOptional(
"objc-eh-types", Section.ClassEHs);
330 IO.mapOptional(
"objc-ivars", Section.Ivars);
331 IO.mapOptional(
"weak-symbols", Section.WeakSymbols);
332 IO.mapOptional(
"thread-local-symbols", Section.TlvSymbols);
338 IO.mapRequired(
"targets", Section.Targets);
339 IO.mapRequired(
"umbrella", Section.Umbrella);
345 IO.mapRequired(
"target", UUID.TargetID);
346 IO.mapRequired(
"value", UUID.Value);
351 struct MappingContextTraits<MetadataSection, MetadataSection::Option> {
353 MetadataSection::Option &OptionKind) {
354 IO.mapRequired(
"targets", Section.Targets);
355 switch (OptionKind) {
356 case MetadataSection::Option::Clients:
357 IO.mapRequired(
"clients", Section.Values);
359 case MetadataSection::Option::Libraries:
360 IO.mapRequired(
"libraries", Section.Values);
369 IO.bitSetCase(Flags,
"flat_namespace", TBDFlags::FlatNamespace);
370 IO.bitSetCase(Flags,
"not_app_extension_safe",
371 TBDFlags::NotApplicationExtensionSafe);
372 IO.bitSetCase(Flags,
"installapi", TBDFlags::InstallAPI);
376 template <>
struct ScalarTraits<
Target> {
378 OS << Value.Arch <<
"-";
379 switch (Value.Platform) {
383 case PlatformKind::macOS:
386 case PlatformKind::iOS:
389 case PlatformKind::tvOS:
392 case PlatformKind::watchOS:
395 case PlatformKind::bridgeOS:
398 case PlatformKind::macCatalyst:
401 case PlatformKind::iOSSimulator:
402 OS <<
"ios-simulator";
404 case PlatformKind::tvOSSimulator:
405 OS <<
"tvos-simulator";
407 case PlatformKind::watchOSSimulator:
408 OS <<
"watchos-simulator";
414 auto Result = Target::create(Scalar);
416 return toString(Result.takeError());
420 return "unknown architecture";
421 if (Value.Platform == PlatformKind::unknown)
422 return "unknown platform";
431 struct NormalizedTBD {
435 UUIDs = File->
uuids();
445 Flags |= TBDFlags::NotApplicationExtensionSafe;
448 Flags |= TBDFlags::FlatNamespace;
451 Flags |= TBDFlags::InstallAPI;
453 for (
const auto &Iter : File->
umbrellas()) {
454 ParentUmbrella = Iter.second;
458 std::set<ArchitectureSet> ArchSet;
460 ArchSet.insert(Library.getArchitectures());
463 ArchSet.insert(Library.getArchitectures());
465 std::map<const Symbol *, ArchitectureSet> SymbolToArchSet;
468 SymbolToArchSet[
Symbol] = Architectures;
469 ArchSet.insert(Architectures);
472 for (
auto Architectures : ArchSet) {
474 Section.Architectures = Architectures;
477 if (Library.getArchitectures() == Architectures)
478 Section.AllowableClients.emplace_back(Library.getInstallName());
481 if (Library.getArchitectures() == Architectures)
482 Section.ReexportedLibraries.emplace_back(Library.getInstallName());
484 for (
const auto &SymArch : SymbolToArchSet) {
485 if (SymArch.second != Architectures)
488 const auto *
Symbol = SymArch.first;
490 case SymbolKind::GlobalSymbol:
498 case SymbolKind::ObjectiveCClass:
500 Section.Classes.emplace_back(
505 case SymbolKind::ObjectiveCClassEHType:
507 Section.Symbols.emplace_back(
512 case SymbolKind::ObjectiveCInstanceVariable:
514 Section.IVars.emplace_back(
521 llvm::sort(Section.Symbols.begin(), Section.Symbols.end());
522 llvm::sort(Section.Classes.begin(), Section.Classes.end());
523 llvm::sort(Section.ClassEHs.begin(), Section.ClassEHs.end());
524 llvm::sort(Section.IVars.begin(), Section.IVars.end());
526 Section.WeakDefSymbols.end());
527 llvm::sort(Section.TLVSymbols.begin(), Section.TLVSymbols.end());
528 Exports.emplace_back(std::move(Section));
532 SymbolToArchSet.clear();
536 SymbolToArchSet[
Symbol] = Architectures;
537 ArchSet.insert(Architectures);
540 for (
auto Architectures : ArchSet) {
542 Section.Architectures = Architectures;
544 for (
const auto &SymArch : SymbolToArchSet) {
545 if (SymArch.second != Architectures)
548 const auto *
Symbol = SymArch.first;
550 case SymbolKind::GlobalSymbol:
556 case SymbolKind::ObjectiveCClass:
558 Section.Classes.emplace_back(
563 case SymbolKind::ObjectiveCClassEHType:
565 Section.Symbols.emplace_back(
570 case SymbolKind::ObjectiveCInstanceVariable:
572 Section.IVars.emplace_back(
579 llvm::sort(Section.Symbols.begin(), Section.Symbols.end());
580 llvm::sort(Section.Classes.begin(), Section.Classes.end());
581 llvm::sort(Section.ClassEHs.begin(), Section.ClassEHs.end());
582 llvm::sort(Section.IVars.begin(), Section.IVars.end());
584 Section.WeakRefSymbols.end());
585 Undefineds.emplace_back(std::move(Section));
598 for (
auto Platform : Platforms) {
603 (Platform == PlatformKind::macCatalyst))
617 File->setPath(Ctx->Path);
618 File->setFileType(Ctx->FileKind);
619 File->addTargets(synthesizeTargets(Architectures, Platforms));
620 for (
auto &
ID : UUIDs)
622 File->setInstallName(InstallName);
624 File->setCompatibilityVersion(CompatibilityVersion);
625 File->setSwiftABIVersion(SwiftABIVersion);
626 File->setObjCConstraint(ObjCConstraint);
628 File->addParentUmbrella(
Target, ParentUmbrella);
631 File->setTwoLevelNamespace();
632 File->setApplicationExtensionSafe();
634 File->setTwoLevelNamespace(!(Flags & TBDFlags::FlatNamespace));
635 File->setApplicationExtensionSafe(
636 !(Flags & TBDFlags::NotApplicationExtensionSafe));
637 File->setInstallAPI(Flags & TBDFlags::InstallAPI);
640 for (
const auto &
Section : Exports) {
642 synthesizeTargets(
Section.Architectures, Platforms);
644 for (
const auto &Lib :
Section.AllowableClients)
645 for (
const auto &
Target : Targets)
648 for (
const auto &Lib :
Section.ReexportedLibraries)
649 for (
const auto &
Target : Targets)
654 Symbol.value.startswith(
"_OBJC_EHTYPE_$_"))
655 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
656 Symbol.value.drop_front(15), Targets);
658 File->addSymbol(SymbolKind::GlobalSymbol,
Symbol, Targets);
664 File->addSymbol(SymbolKind::ObjectiveCClass,
Name, Targets);
667 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
Symbol, Targets);
672 File->addSymbol(SymbolKind::ObjectiveCInstanceVariable,
Name,
676 File->addSymbol(SymbolKind::GlobalSymbol,
Symbol, Targets,
677 SymbolFlags::WeakDefined);
679 File->addSymbol(SymbolKind::GlobalSymbol,
Symbol, Targets,
680 SymbolFlags::ThreadLocalValue);
683 for (
const auto &
Section : Undefineds) {
685 synthesizeTargets(
Section.Architectures, Platforms);
688 Symbol.value.startswith(
"_OBJC_EHTYPE_$_"))
689 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
690 Symbol.value.drop_front(15), Targets,
691 SymbolFlags::Undefined);
693 File->addSymbol(SymbolKind::GlobalSymbol,
Symbol, Targets,
694 SymbolFlags::Undefined);
700 File->addSymbol(SymbolKind::ObjectiveCClass,
Name, Targets,
701 SymbolFlags::Undefined);
704 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
Symbol, Targets,
705 SymbolFlags::Undefined);
710 File->addSymbol(SymbolKind::ObjectiveCInstanceVariable,
Name, Targets,
711 SymbolFlags::Undefined);
714 File->addSymbol(SymbolKind::GlobalSymbol,
Symbol, Targets,
715 SymbolFlags::Undefined | SymbolFlags::WeakReferenced);
727 memcpy(Ptr, String.
data(), String.
size());
728 return StringRef(reinterpret_cast<const char *>(Ptr), String.
size());
737 SwiftVersion SwiftABIVersion{0};
746 if (IO.mapTag(
"!tapi-tbd",
false))
748 else if (IO.mapTag(
"!tapi-tbd-v3",
false))
750 else if (IO.mapTag(
"!tapi-tbd-v2",
false))
752 else if (IO.mapTag(
"!tapi-tbd-v1",
false) ||
753 IO.mapTag(
"tag:yaml.org,2002:map",
false))
763 assert((!Ctx || !IO.outputting() ||
765 "File type is not set in YAML context");
767 if (!IO.outputting()) {
768 setFileTypeForInput(Ctx, IO);
769 switch (Ctx->FileKind) {
773 mapKeysToValuesV4(IO, File);
776 IO.setError(
"unsupported file type");
781 switch (Ctx->FileKind) {
785 mapKeysToValuesV4(IO, File);
788 IO.mapTag(
"!tapi-tbd-v3",
true);
791 IO.mapTag(
"!tapi-tbd-v2",
true);
798 mapKeysToValues(Ctx->FileKind, IO, File);
802 struct NormalizedTBD_V4 {
807 TBDVersion = Ctx->FileKind >> 1;
808 Targets.insert(Targets.begin(), File->
targets().
begin(),
810 for (
const auto &
IT : File->
uuids())
811 UUIDs.emplace_back(
IT.first,
IT.second);
819 Flags |= TBDFlags::NotApplicationExtensionSafe;
822 Flags |= TBDFlags::FlatNamespace;
825 Flags |= TBDFlags::InstallAPI;
828 std::map<std::string, TargetList> valueToTargetList;
830 valueToTargetList[it.second].emplace_back(it.first);
832 for (
const auto &it : valueToTargetList) {
833 UmbrellaSection CurrentSection;
834 CurrentSection.Targets.insert(CurrentSection.Targets.begin(),
835 it.second.begin(), it.second.end());
836 CurrentSection.Umbrella = it.first;
837 ParentUmbrellas.emplace_back(std::move(CurrentSection));
845 [](SectionList &CurrentSections,
847 std::function<bool(const Symbol *)> Pred) {
848 std::set<TargetList> TargetSet;
849 std::map<const Symbol *, TargetList> SymbolToTargetList;
850 for (
const auto *
Symbol : Symbols) {
854 SymbolToTargetList[
Symbol] = Targets;
855 TargetSet.emplace(std::move(Targets));
857 for (
const auto &TargetIDs : TargetSet) {
858 SymbolSection CurrentSection;
859 CurrentSection.Targets.insert(CurrentSection.Targets.begin(),
860 TargetIDs.begin(), TargetIDs.end());
862 for (
const auto &
IT : SymbolToTargetList) {
863 if (
IT.second != TargetIDs)
868 case SymbolKind::GlobalSymbol:
876 case SymbolKind::ObjectiveCClass:
879 case SymbolKind::ObjectiveCClassEHType:
882 case SymbolKind::ObjectiveCInstanceVariable:
887 sort(CurrentSection.Symbols);
888 sort(CurrentSection.Classes);
889 sort(CurrentSection.ClassEHs);
890 sort(CurrentSection.Ivars);
891 sort(CurrentSection.WeakSymbols);
892 sort(CurrentSection.TlvSymbols);
893 CurrentSections.emplace_back(std::move(CurrentSection));
912 File->setPath(Ctx->Path);
913 File->setFileType(Ctx->FileKind);
914 for (
auto &
id : UUIDs)
916 File->addTargets(Targets);
917 File->setInstallName(InstallName);
919 File->setCompatibilityVersion(CompatibilityVersion);
920 File->setSwiftABIVersion(SwiftABIVersion);
921 for (
const auto &CurrentSection : ParentUmbrellas)
922 for (
const auto &target : CurrentSection.Targets)
923 File->addParentUmbrella(target, CurrentSection.Umbrella);
924 File->setTwoLevelNamespace(!(Flags & TBDFlags::FlatNamespace));
925 File->setApplicationExtensionSafe(
926 !(Flags & TBDFlags::NotApplicationExtensionSafe));
927 File->setInstallAPI(Flags & TBDFlags::InstallAPI);
929 for (
const auto &CurrentSection : AllowableClients) {
930 for (
const auto &lib : CurrentSection.Values)
931 for (
const auto &
Target : CurrentSection.Targets)
935 for (
const auto &CurrentSection : ReexportedLibraries) {
936 for (
const auto &Lib : CurrentSection.Values)
937 for (
const auto &
Target : CurrentSection.Targets)
941 auto handleSymbols = [
File](
const SectionList &CurrentSections,
943 for (
const auto &CurrentSection : CurrentSections) {
944 for (
auto &sym : CurrentSection.Symbols)
945 File->addSymbol(SymbolKind::GlobalSymbol, sym,
946 CurrentSection.Targets, Flag);
948 for (
auto &sym : CurrentSection.Classes)
949 File->addSymbol(SymbolKind::ObjectiveCClass, sym,
950 CurrentSection.Targets);
952 for (
auto &sym : CurrentSection.ClassEHs)
953 File->addSymbol(SymbolKind::ObjectiveCClassEHType, sym,
954 CurrentSection.Targets);
956 for (
auto &sym : CurrentSection.Ivars)
957 File->addSymbol(SymbolKind::ObjectiveCInstanceVariable, sym,
958 CurrentSection.Targets);
960 for (
auto &sym : CurrentSection.WeakSymbols)
961 File->addSymbol(SymbolKind::GlobalSymbol, sym,
962 CurrentSection.Targets);
963 for (
auto &sym : CurrentSection.TlvSymbols)
964 File->addSymbol(SymbolKind::GlobalSymbol, sym,
965 CurrentSection.Targets,
966 SymbolFlags::ThreadLocalValue);
970 handleSymbols(Exports);
971 handleSymbols(Reexports, SymbolFlags::Rexported);
972 handleSymbols(Undefineds, SymbolFlags::Undefined);
983 SwiftVersion SwiftABIVersion{0};
993 void assignTargetsToLibrary(
const std::vector<InterfaceFileRef> &Libraries,
994 std::vector<MetadataSection> &
Section) {
995 std::set<TargetList> targetSet;
996 std::map<const InterfaceFileRef *, TargetList> valueToTargetList;
997 for (
const auto &library : Libraries) {
999 valueToTargetList[&library] = targets;
1000 targetSet.emplace(std::move(targets));
1003 for (
const auto &targets : targetSet) {
1004 MetadataSection CurrentSection;
1005 CurrentSection.Targets.insert(CurrentSection.Targets.begin(),
1006 targets.begin(), targets.end());
1008 for (
const auto &it : valueToTargetList) {
1009 if (it.second != targets)
1012 CurrentSection.Values.emplace_back(it.first->getInstallName());
1015 Section.emplace_back(std::move(CurrentSection));
1022 MappingNormalization<NormalizedTBD, const InterfaceFile *> Keys(IO, File);
1023 IO.mapRequired(
"archs", Keys->Architectures);
1025 IO.mapOptional(
"uuids", Keys->UUIDs);
1026 IO.mapRequired(
"platform", Keys->Platforms);
1029 IO.mapRequired(
"install-name", Keys->InstallName);
1030 IO.mapOptional(
"current-version", Keys->CurrentVersion,
1032 IO.mapOptional(
"compatibility-version", Keys->CompatibilityVersion,
1035 IO.mapOptional(
"swift-version", Keys->SwiftABIVersion, SwiftVersion(0));
1037 IO.mapOptional(
"swift-abi-version", Keys->SwiftABIVersion,
1039 IO.mapOptional(
"objc-constraint", Keys->ObjCConstraint,
1042 : ObjCConstraintType::Retain_Release);
1044 IO.mapOptional(
"parent-umbrella", Keys->ParentUmbrella,
StringRef());
1045 IO.mapOptional(
"exports", Keys->Exports);
1047 IO.mapOptional(
"undefineds", Keys->Undefineds);
1051 MappingNormalization<NormalizedTBD_V4, const InterfaceFile *> Keys(IO,
1053 IO.mapTag(
"!tapi-tbd",
true);
1054 IO.mapRequired(
"tbd-version", Keys->TBDVersion);
1055 IO.mapRequired(
"targets", Keys->Targets);
1056 IO.mapOptional(
"uuids", Keys->UUIDs);
1058 IO.mapRequired(
"install-name", Keys->InstallName);
1059 IO.mapOptional(
"current-version", Keys->CurrentVersion,
1061 IO.mapOptional(
"compatibility-version", Keys->CompatibilityVersion,
1063 IO.mapOptional(
"swift-abi-version", Keys->SwiftABIVersion, SwiftVersion(0));
1064 IO.mapOptional(
"parent-umbrella", Keys->ParentUmbrellas);
1065 auto OptionKind = MetadataSection::Option::Clients;
1066 IO.mapOptionalWithContext(
"allowable-clients", Keys->AllowableClients,
1068 OptionKind = MetadataSection::Option::Libraries;
1069 IO.mapOptionalWithContext(
"reexported-libraries", Keys->ReexportedLibraries,
1071 IO.mapOptional(
"exports", Keys->Exports);
1072 IO.mapOptional(
"reexports", Keys->Reexports);
1073 IO.mapOptional(
"undefineds", Keys->Undefineds);
1078 struct DocumentListTraits<
std::vector<const MachO::InterfaceFile *>> {
1079 static size_t size(IO &IO, std::vector<const MachO::InterfaceFile *> &Seq) {
1084 if (Index >= Seq.size())
1085 Seq.resize(Index + 1);
1103 NewDiag.
print(
nullptr, S);
1104 File->ErrorMessage = (
"malformed file\n" + Message).str();
1114 std::vector<const InterfaceFile *> Files;
1119 auto File = std::unique_ptr<InterfaceFile>(
1123 return make_error<StringError>(Ctx.
ErrorMessage, YAMLIn.error());
1125 return std::move(
File);
1132 llvm::yaml::Output YAMLOut(OS, &Ctx, 80);
1134 std::vector<const InterfaceFile *> Files;
1135 Files.emplace_back(&File);
FileType getFileType() const
Get the file type.
reference emplace_back(ArgTypes &&... Args)
#define LLVM_MARK_AS_BITMASK_ENUM(LargestValue)
LLVM_MARK_AS_BITMASK_ENUM lets you opt in an individual enum type so you can perform bitwise operatio...
LLVM_NODISCARD std::string str() const
str - Get the contents as an std::string.
Defines the interface file.
This class represents lattice values for constants.
void print(const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true) const
static void bitset(IO &IO, TBDFlags &Flags)
Text-based stub file (.tbd) version 2.0.
NormalizedTBD_V4(IO &IO, const InterfaceFile *&File)
amdgpu Simplify well known AMD library false FunctionCallee Value const Twine & Name
NormalizedTBD(IO &IO, const InterfaceFile *&File)
StringRef getName() const
A raw_ostream that writes to an SmallVector or SmallString.
static size_t size(IO &IO, std::vector< const MachO::InterfaceFile *> &Seq)
const InterfaceFile * denormalize(IO &IO)
ArrayRef< SMFixIt > getFixIts() const
PackedVersion CompatibilityVersion
This file defines the MallocAllocator and BumpPtrAllocator interfaces.
const std::vector< InterfaceFileRef > & allowableClients() const
Get the list of allowable clients.
static void setFileTypeForInput(TextAPIContext *Ctx, IO &IO)
static void mapping(IO &IO, UndefinedSection &Section)
std::string toString(Error E)
Write all error messages (if any) in E to a string.
bool isWeakReferenced() const
const InterfaceFile * denormalize(IO &IO)
const std::vector< InterfaceFileRef > & reexportedLibraries() const
Get the list of re-exported libraries.
StringRef getBuffer() const
std::vector< SymbolSection > SectionList
Tagged union holding either a T or a Error.
Text-based stub file (.tbd) version 1.0.
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
PackedVersion CurrentVersion
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
StringRef getLineContents() const
PackedVersion CurrentVersion
LLVM_NODISCARD size_t size() const
size - Get the string size.
const std::vector< std::pair< Target, std::string > > & uuids() const
Get the list of Target/UUID pairs.
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
TargetList synthesizeTargets(ArchitectureSet Architectures, const PlatformSet &Platforms)
static void output(const Target &Value, void *, raw_ostream &OS)
std::vector< UmbrellaSection > ParentUmbrellas
static void mapping(IO &IO, UUIDv4 &UUID)
Flag
These should be considered private to the implementation of the MCInstrDesc class.
const_filtered_symbol_range exports() const
StringRef getPath() const
Get the path from which this file was generated (if applicable).
std::vector< MetadataSection > ReexportedLibraries
* if(!EatIfPresent(lltok::kw_thread_local)) return false
ParseOptionalThreadLocal := /*empty.
Allocate memory in an ever growing pool, as if by bump-pointer.
Instrumentation for Order File
bool isTwoLevelNamespace() const
Check if the library uses two-level namespace.
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
static void mapping(IO &IO, const InterfaceFile *&File)
uint8_t getSwiftABIVersion() const
Get the Swift ABI version of the library.
Text-based stub file (.tbd) version 3.0.
PlatformKind mapToPlatformKind(PlatformKind Platform, bool WantSim)
bool isApplicationExtensionSafe() const
Check if the library is application extension safe.
static void mapping(IO &IO, MetadataSection &Section, MetadataSection::Option &OptionKind)
bool isInstallAPI() const
Check if this file was generated during InstallAPI.
bool isThreadLocalValue() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
ObjCConstraintType
Defines a list of Objective-C constraints.
StringRef getInstallName() const
Get the install name of the library.
void sort(IteratorTy Start, IteratorTy End)
static ErrorSuccess success()
Create a success value.
FileType
Defines the file type this file represents.
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
const_target_range targets() const
static void mapping(IO &IO, ExportSection &Section)
StringRef getMessage() const
std::vector< UUIDv4 > UUIDs
std::pair< llvm::MachO::Target, std::string > UUID
std::vector< UUID > UUIDs
ArrayRef< std::pair< unsigned, unsigned > > getRanges() const
A range adaptor for a pair of iterators.
StringRef copyString(StringRef String)
Target - Wrapper for Target specific information.
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * Allocate(size_t Size, Align Alignment)
Allocate space at the specified alignment.
StringRef getBufferIdentifier() const
const std::vector< std::pair< Target, std::string > > & umbrellas() const
SourceMgr::DiagKind getKind() const
std::vector< MetadataSection > AllowableClients
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::ZeroOrMore, cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate IT block based on arch"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow deprecated IT based on ARMv8"), clEnumValN(NoRestrictedIT, "arm-no-restrict-it", "Allow IT blocks based on ARMv7")))
static void mapping(IO &IO, SymbolSection &Section)
ArchitectureSet getArchitectures() const
Get the architectures.
ObjCConstraintType getObjCConstraint() const
Get the Objective-C constraint.
ArchitectureSet getArchitectures() const
bool isReexported() const
std::vector< ExportSection > Exports
PlatformSet getPlatforms() const
Get the platforms.
PackedVersion getCompatibilityVersion() const
Get the compatibility version of the library.
static const InterfaceFile *& element(IO &IO, std::vector< const InterfaceFile *> &Seq, size_t Index)
bool isWeakDefined() const
SymbolKind getKind() const
const_target_range targets() const
LLVM_NODISCARD const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
std::vector< UndefinedSection > Undefineds
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
llvm::BumpPtrAllocator Allocator
LLVM Value Representation.
Lightweight error class with error context and mandatory checking.
PackedVersion getCurrentVersion() const
Get the current version of the library.
PackedVersion CompatibilityVersion
static void mapKeysToValuesV4(IO &IO, const InterfaceFile *&File)
This class implements an extremely fast bulk output stream that can only output to a stream...
std::vector< Architecture > Architectures
static StringRef input(StringRef Scalar, void *, Target &Value)
StringRef - Represent a constant reference to a string, i.e.
static void mapping(IO &IO, UmbrellaSection &Section)
static void mapKeysToValues(FileType FileKind, IO &IO, const InterfaceFile *&File)
Text-based stub file (.tbd) version 4.0.
const SourceMgr * getSourceMgr() const
static QuotingType mustQuote(StringRef)
const_filtered_symbol_range undefineds() const
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...