209struct ExportSection {
210 std::vector<Architecture> Architectures;
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;
221struct 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;
231struct 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;
241struct MetadataSection {
244 std::vector<FlowStringRef> Values;
247struct UmbrellaSection {
258 UUIDv4(
const Target &TargetID,
const std::string &
Value)
277 static void mapping(IO &IO, ExportSection &Section) {
278 const auto *Ctx =
reinterpret_cast<TextAPIContext *
>(IO.getContext());
279 assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
280 "File type is not set in YAML context");
282 IO.mapRequired(
"archs", Section.Architectures);
283 if (Ctx->FileKind == FileType::TBD_V1)
284 IO.mapOptional(
"allowed-clients", Section.AllowableClients);
286 IO.mapOptional(
"allowable-clients", Section.AllowableClients);
287 IO.mapOptional(
"re-exports", Section.ReexportedLibraries);
288 IO.mapOptional(
"symbols", Section.Symbols);
289 IO.mapOptional(
"objc-classes", Section.Classes);
290 if (Ctx->FileKind == FileType::TBD_V3)
291 IO.mapOptional(
"objc-eh-types", Section.ClassEHs);
292 IO.mapOptional(
"objc-ivars", Section.IVars);
293 IO.mapOptional(
"weak-def-symbols", Section.WeakDefSymbols);
294 IO.mapOptional(
"thread-local-symbols", Section.TLVSymbols);
299 static void mapping(IO &IO, UndefinedSection &Section) {
300 const auto *Ctx =
reinterpret_cast<TextAPIContext *
>(IO.getContext());
301 assert((!Ctx || (Ctx && Ctx->FileKind != FileType::Invalid)) &&
302 "File type is not set in YAML context");
304 IO.mapRequired(
"archs", Section.Architectures);
305 IO.mapOptional(
"symbols", Section.Symbols);
306 IO.mapOptional(
"objc-classes", Section.Classes);
307 if (Ctx->FileKind == FileType::TBD_V3)
308 IO.mapOptional(
"objc-eh-types", Section.ClassEHs);
309 IO.mapOptional(
"objc-ivars", Section.IVars);
310 IO.mapOptional(
"weak-ref-symbols", Section.WeakRefSymbols);
315 static void mapping(IO &IO, SymbolSection &Section) {
316 IO.mapRequired(
"targets", Section.Targets);
317 IO.mapOptional(
"symbols", Section.Symbols);
318 IO.mapOptional(
"objc-classes", Section.Classes);
319 IO.mapOptional(
"objc-eh-types", Section.ClassEHs);
320 IO.mapOptional(
"objc-ivars", Section.Ivars);
321 IO.mapOptional(
"weak-symbols", Section.WeakSymbols);
322 IO.mapOptional(
"thread-local-symbols", Section.TlvSymbols);
327 static void mapping(IO &IO, UmbrellaSection &Section) {
328 IO.mapRequired(
"targets", Section.Targets);
329 IO.mapRequired(
"umbrella", Section.Umbrella);
335 IO.mapRequired(
"target",
UUID.TargetID);
336 IO.mapRequired(
"value",
UUID.Value);
341struct MappingContextTraits<MetadataSection, MetadataSection::Option> {
342 static void mapping(IO &IO, MetadataSection &Section,
343 MetadataSection::Option &OptionKind) {
344 IO.mapRequired(
"targets", Section.Targets);
345 switch (OptionKind) {
346 case MetadataSection::Option::Clients:
347 IO.mapRequired(
"clients", Section.Values);
349 case MetadataSection::Option::Libraries:
350 IO.mapRequired(
"libraries", Section.Values);
359 IO.bitSetCase(
Flags,
"flat_namespace", TBDFlags::FlatNamespace);
360 IO.bitSetCase(
Flags,
"not_app_extension_safe",
361 TBDFlags::NotApplicationExtensionSafe);
362 IO.bitSetCase(
Flags,
"installapi", TBDFlags::InstallAPI);
369 switch (
Value.Platform) {
392 OS <<
"ios-simulator";
395 OS <<
"tvos-simulator";
398 OS <<
"watchos-simulator";
410 return "unparsable target";
415 return "unknown architecture";
417 return "unknown platform";
426 struct NormalizedTBD {
429 Architectures = File->getArchitectures();
430 UUIDs = File->uuids();
431 Platforms = File->getPlatforms();
435 SwiftABIVersion = File->getSwiftABIVersion();
436 ObjCConstraint = File->getObjCConstraint();
438 Flags = TBDFlags::None;
439 if (!File->isApplicationExtensionSafe())
440 Flags |= TBDFlags::NotApplicationExtensionSafe;
442 if (!File->isTwoLevelNamespace())
443 Flags |= TBDFlags::FlatNamespace;
445 if (File->isInstallAPI())
446 Flags |= TBDFlags::InstallAPI;
448 if (!File->umbrellas().empty())
451 std::set<ArchitectureSet> ArchSet;
452 for (
const auto &Library : File->allowableClients())
453 ArchSet.insert(Library.getArchitectures());
455 for (
const auto &Library : File->reexportedLibraries())
456 ArchSet.insert(Library.getArchitectures());
458 std::map<const Symbol *, ArchitectureSet> SymbolToArchSet;
459 for (
const auto *
Symbol : File->symbols()) {
461 SymbolToArchSet[
Symbol] = Architectures;
462 ArchSet.insert(Architectures);
465 for (
auto Architectures : ArchSet) {
466 ExportSection Section;
467 Section.Architectures = Architectures;
469 for (
const auto &Library : File->allowableClients())
470 if (Library.getArchitectures() == Architectures)
471 Section.AllowableClients.emplace_back(Library.getInstallName());
473 for (
const auto &Library : File->reexportedLibraries())
474 if (Library.getArchitectures() == Architectures)
475 Section.ReexportedLibraries.emplace_back(Library.getInstallName());
477 for (
const auto &SymArch : SymbolToArchSet) {
478 if (SymArch.second != Architectures)
481 const auto *
Symbol = SymArch.first;
483 case SymbolKind::GlobalSymbol:
491 case SymbolKind::ObjectiveCClass:
492 if (File->getFileType() != FileType::TBD_V3)
493 Section.Classes.emplace_back(
498 case SymbolKind::ObjectiveCClassEHType:
499 if (File->getFileType() != FileType::TBD_V3)
500 Section.Symbols.emplace_back(
505 case SymbolKind::ObjectiveCInstanceVariable:
506 if (File->getFileType() != FileType::TBD_V3)
507 Section.IVars.emplace_back(
520 Exports.emplace_back(std::move(Section));
524 SymbolToArchSet.clear();
526 for (
const auto *
Symbol : File->undefineds()) {
528 SymbolToArchSet[
Symbol] = Architectures;
529 ArchSet.insert(Architectures);
532 for (
auto Architectures : ArchSet) {
533 UndefinedSection Section;
534 Section.Architectures = Architectures;
536 for (
const auto &SymArch : SymbolToArchSet) {
537 if (SymArch.second != Architectures)
540 const auto *
Symbol = SymArch.first;
542 case SymbolKind::GlobalSymbol:
548 case SymbolKind::ObjectiveCClass:
549 if (File->getFileType() != FileType::TBD_V3)
550 Section.Classes.emplace_back(
555 case SymbolKind::ObjectiveCClassEHType:
556 if (File->getFileType() != FileType::TBD_V3)
557 Section.Symbols.emplace_back(
562 case SymbolKind::ObjectiveCInstanceVariable:
563 if (File->getFileType() != FileType::TBD_V3)
564 Section.IVars.emplace_back(
589 for (
auto Platform : Platforms) {
607 File->setPath(Ctx->Path);
608 File->setFileType(Ctx->FileKind);
609 File->addTargets(synthesizeTargets(Architectures, Platforms));
610 for (
auto &
ID : UUIDs)
611 File->addUUID(
ID.first,
ID.second);
615 File->setSwiftABIVersion(SwiftABIVersion);
616 File->setObjCConstraint(ObjCConstraint);
617 for (
const auto &
Target : File->targets())
620 if (Ctx->FileKind == FileType::TBD_V1) {
621 File->setTwoLevelNamespace();
622 File->setApplicationExtensionSafe();
624 File->setTwoLevelNamespace(!(
Flags & TBDFlags::FlatNamespace));
625 File->setApplicationExtensionSafe(
626 !(
Flags & TBDFlags::NotApplicationExtensionSafe));
627 File->setInstallAPI(
Flags & TBDFlags::InstallAPI);
630 for (
const auto &Section :
Exports) {
632 synthesizeTargets(Section.Architectures, Platforms);
634 for (
const auto &
Lib : Section.AllowableClients)
638 for (
const auto &
Lib : Section.ReexportedLibraries)
642 for (
const auto &
Symbol : Section.Symbols) {
643 if (Ctx->FileKind != FileType::TBD_V3 &&
644 Symbol.value.startswith(
"_OBJC_EHTYPE_$_"))
645 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
650 for (
auto &
Symbol : Section.Classes) {
652 if (Ctx->FileKind != FileType::TBD_V3)
654 File->addSymbol(SymbolKind::ObjectiveCClass,
Name,
Targets);
656 for (
auto &
Symbol : Section.ClassEHs)
657 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
Symbol,
Targets);
658 for (
auto &
Symbol : Section.IVars) {
660 if (Ctx->FileKind != FileType::TBD_V3)
662 File->addSymbol(SymbolKind::ObjectiveCInstanceVariable,
Name,
665 for (
auto &
Symbol : Section.WeakDefSymbols)
667 SymbolFlags::WeakDefined);
668 for (
auto &
Symbol : Section.TLVSymbols)
670 SymbolFlags::ThreadLocalValue);
675 synthesizeTargets(Section.Architectures, Platforms);
676 for (
auto &
Symbol : Section.Symbols) {
677 if (Ctx->FileKind != FileType::TBD_V3 &&
678 Symbol.value.startswith(
"_OBJC_EHTYPE_$_"))
679 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
681 SymbolFlags::Undefined);
684 SymbolFlags::Undefined);
686 for (
auto &
Symbol : Section.Classes) {
688 if (Ctx->FileKind != FileType::TBD_V3)
690 File->addSymbol(SymbolKind::ObjectiveCClass,
Name,
Targets,
691 SymbolFlags::Undefined);
693 for (
auto &
Symbol : Section.ClassEHs)
694 File->addSymbol(SymbolKind::ObjectiveCClassEHType,
Symbol,
Targets,
695 SymbolFlags::Undefined);
696 for (
auto &
Symbol : Section.IVars) {
698 if (Ctx->FileKind != FileType::TBD_V3)
700 File->addSymbol(SymbolKind::ObjectiveCInstanceVariable,
Name,
Targets,
701 SymbolFlags::Undefined);
703 for (
auto &
Symbol : Section.WeakRefSymbols)
705 SymbolFlags::Undefined | SymbolFlags::WeakReferenced);
727 SwiftVersion SwiftABIVersion{0};
736 if (IO.mapTag(
"!tapi-tbd",
false))
738 else if (IO.mapTag(
"!tapi-tbd-v3",
false))
740 else if (IO.mapTag(
"!tapi-tbd-v2",
false))
742 else if (IO.mapTag(
"!tapi-tbd-v1",
false) ||
743 IO.mapTag(
"tag:yaml.org,2002:map",
false))
753 assert((!Ctx || !IO.outputting() ||
754 (Ctx && Ctx->FileKind != FileType::Invalid)) &&
755 "File type is not set in YAML context");
757 if (!IO.outputting()) {
758 setFileTypeForInput(Ctx, IO);
759 switch (Ctx->FileKind) {
762 case FileType::TBD_V4:
763 mapKeysToValuesV4(IO, File);
765 case FileType::Invalid:
766 IO.setError(
"unsupported file type");
771 switch (Ctx->FileKind) {
774 case FileType::TBD_V4:
775 mapKeysToValuesV4(IO, File);
777 case FileType::TBD_V3:
778 IO.mapTag(
"!tapi-tbd-v3",
true);
780 case FileType::TBD_V2:
781 IO.mapTag(
"!tapi-tbd-v2",
true);
783 case FileType::TBD_V1:
788 mapKeysToValues(Ctx->FileKind, IO, File);
792 struct NormalizedTBD_V4 {
799 File->targets().end());
800 for (
const auto &
IT : File->uuids())
801 UUIDs.emplace_back(
IT.first,
IT.second);
805 SwiftABIVersion = File->getSwiftABIVersion();
807 Flags = TBDFlags::None;
808 if (!File->isApplicationExtensionSafe())
809 Flags |= TBDFlags::NotApplicationExtensionSafe;
811 if (!File->isTwoLevelNamespace())
812 Flags |= TBDFlags::FlatNamespace;
814 if (File->isInstallAPI())
815 Flags |= TBDFlags::InstallAPI;
818 std::map<std::string, TargetList> valueToTargetList;
819 for (
const auto &it : File->umbrellas())
820 valueToTargetList[it.second].emplace_back(it.first);
822 for (
const auto &it : valueToTargetList) {
823 UmbrellaSection CurrentSection;
824 CurrentSection.Targets.insert(CurrentSection.Targets.begin(),
825 it.second.begin(), it.second.end());
826 CurrentSection.Umbrella = it.first;
827 ParentUmbrellas.emplace_back(std::move(CurrentSection));
832 assignTargetsToLibrary(File->reexportedLibraries(), ReexportedLibraries);
837 std::set<TargetList> TargetSet;
838 std::map<const Symbol *, TargetList> SymbolToTargetList;
839 for (
const auto *
Symbol : Symbols) {
842 TargetSet.emplace(std::move(
Targets));
844 for (
const auto &TargetIDs : TargetSet) {
845 SymbolSection CurrentSection;
846 CurrentSection.Targets.insert(CurrentSection.Targets.begin(),
847 TargetIDs.begin(), TargetIDs.end());
849 for (
const auto &
IT : SymbolToTargetList) {
850 if (
IT.second != TargetIDs)
855 case SymbolKind::GlobalSymbol:
863 case SymbolKind::ObjectiveCClass:
866 case SymbolKind::ObjectiveCClassEHType:
869 case SymbolKind::ObjectiveCInstanceVariable:
874 sort(CurrentSection.Symbols);
875 sort(CurrentSection.Classes);
876 sort(CurrentSection.ClassEHs);
877 sort(CurrentSection.Ivars);
878 sort(CurrentSection.WeakSymbols);
879 sort(CurrentSection.TlvSymbols);
880 CurrentSections.emplace_back(std::move(CurrentSection));
884 handleSymbols(
Exports, File->exports());
885 handleSymbols(
Reexports, File->reexports());
886 handleSymbols(
Undefineds, File->undefineds());
894 File->setPath(Ctx->Path);
895 File->setFileType(Ctx->FileKind);
896 for (
auto &
id : UUIDs)
897 File->addUUID(
id.TargetID,
id.
Value);
902 File->setSwiftABIVersion(SwiftABIVersion);
903 for (
const auto &CurrentSection : ParentUmbrellas)
904 for (
const auto &target : CurrentSection.Targets)
905 File->addParentUmbrella(target, CurrentSection.Umbrella);
906 File->setTwoLevelNamespace(!(
Flags & TBDFlags::FlatNamespace));
907 File->setApplicationExtensionSafe(
908 !(
Flags & TBDFlags::NotApplicationExtensionSafe));
909 File->setInstallAPI(
Flags & TBDFlags::InstallAPI);
912 for (
const auto &lib : CurrentSection.Values)
913 for (
const auto &
Target : CurrentSection.Targets)
914 File->addAllowableClient(lib,
Target);
917 for (
const auto &CurrentSection : ReexportedLibraries) {
918 for (
const auto &
Lib : CurrentSection.Values)
919 for (
const auto &
Target : CurrentSection.Targets)
923 auto handleSymbols = [File](
const SectionList &CurrentSections,
925 for (
const auto &CurrentSection : CurrentSections) {
926 for (
auto &sym : CurrentSection.Symbols)
927 File->addSymbol(SymbolKind::GlobalSymbol, sym,
928 CurrentSection.Targets, Flag);
930 for (
auto &sym : CurrentSection.Classes)
931 File->addSymbol(SymbolKind::ObjectiveCClass, sym,
932 CurrentSection.Targets, Flag);
934 for (
auto &sym : CurrentSection.ClassEHs)
935 File->addSymbol(SymbolKind::ObjectiveCClassEHType, sym,
936 CurrentSection.Targets, Flag);
938 for (
auto &sym : CurrentSection.Ivars)
939 File->addSymbol(SymbolKind::ObjectiveCInstanceVariable, sym,
940 CurrentSection.Targets, Flag);
942 SymbolFlags SymFlag = (Flag == SymbolFlags::Undefined)
943 ? SymbolFlags::WeakReferenced
944 : SymbolFlags::WeakDefined;
945 for (
auto &sym : CurrentSection.WeakSymbols) {
946 File->addSymbol(SymbolKind::GlobalSymbol, sym,
947 CurrentSection.Targets, Flag | SymFlag);
950 for (
auto &sym : CurrentSection.TlvSymbols)
951 File->addSymbol(SymbolKind::GlobalSymbol, sym,
952 CurrentSection.Targets,
953 Flag | SymbolFlags::ThreadLocalValue);
958 handleSymbols(
Reexports, SymbolFlags::Rexported);
959 handleSymbols(
Undefineds, SymbolFlags::Undefined);
970 SwiftVersion SwiftABIVersion{0};
980 void assignTargetsToLibrary(
const std::vector<InterfaceFileRef> &Libraries,
981 std::vector<MetadataSection> &Section) {
982 std::set<TargetList> targetSet;
983 std::map<const InterfaceFileRef *, TargetList> valueToTargetList;
984 for (
const auto &
library : Libraries) {
986 valueToTargetList[&
library] = targets;
987 targetSet.emplace(std::move(targets));
990 for (
const auto &targets : targetSet) {
991 MetadataSection CurrentSection;
992 CurrentSection.Targets.
insert(CurrentSection.Targets.begin(),
993 targets.begin(), targets.end());
995 for (
const auto &it : valueToTargetList) {
996 if (it.second != targets)
999 CurrentSection.Values.emplace_back(it.first->getInstallName());
1002 Section.emplace_back(std::move(CurrentSection));
1009 MappingNormalization<NormalizedTBD, const InterfaceFile *>
Keys(IO, File);
1010 IO.mapRequired(
"archs",
Keys->Architectures);
1011 if (FileKind != FileType::TBD_V1)
1012 IO.mapOptional(
"uuids",
Keys->UUIDs);
1013 IO.mapRequired(
"platform",
Keys->Platforms);
1014 if (FileKind != FileType::TBD_V1)
1015 IO.mapOptional(
"flags",
Keys->Flags, TBDFlags::None);
1016 IO.mapRequired(
"install-name",
Keys->InstallName);
1017 IO.mapOptional(
"current-version",
Keys->CurrentVersion,
1019 IO.mapOptional(
"compatibility-version",
Keys->CompatibilityVersion,
1021 if (FileKind != FileType::TBD_V3)
1022 IO.mapOptional(
"swift-version",
Keys->SwiftABIVersion, SwiftVersion(0));
1024 IO.mapOptional(
"swift-abi-version",
Keys->SwiftABIVersion,
1026 IO.mapOptional(
"objc-constraint",
Keys->ObjCConstraint,
1027 (FileKind == FileType::TBD_V1)
1028 ? ObjCConstraintType::None
1029 : ObjCConstraintType::Retain_Release);
1030 if (FileKind != FileType::TBD_V1)
1031 IO.mapOptional(
"parent-umbrella",
Keys->ParentUmbrella,
StringRef());
1032 IO.mapOptional(
"exports",
Keys->Exports);
1033 if (FileKind != FileType::TBD_V1)
1034 IO.mapOptional(
"undefineds",
Keys->Undefineds);
1038 MappingNormalization<NormalizedTBD_V4, const InterfaceFile *>
Keys(IO,
1040 IO.mapTag(
"!tapi-tbd",
true);
1041 IO.mapRequired(
"tbd-version",
Keys->TBDVersion);
1042 IO.mapRequired(
"targets",
Keys->Targets);
1043 IO.mapOptional(
"uuids",
Keys->UUIDs);
1044 IO.mapOptional(
"flags",
Keys->Flags, TBDFlags::None);
1045 IO.mapRequired(
"install-name",
Keys->InstallName);
1046 IO.mapOptional(
"current-version",
Keys->CurrentVersion,
1048 IO.mapOptional(
"compatibility-version",
Keys->CompatibilityVersion,
1050 IO.mapOptional(
"swift-abi-version",
Keys->SwiftABIVersion, SwiftVersion(0));
1051 IO.mapOptional(
"parent-umbrella",
Keys->ParentUmbrellas);
1052 auto OptionKind = MetadataSection::Option::Clients;
1053 IO.mapOptionalWithContext(
"allowable-clients",
Keys->AllowableClients,
1055 OptionKind = MetadataSection::Option::Libraries;
1056 IO.mapOptionalWithContext(
"reexported-libraries",
Keys->ReexportedLibraries,
1058 IO.mapOptional(
"exports",
Keys->Exports);
1059 IO.mapOptional(
"reexports",
Keys->Reexports);
1060 IO.mapOptional(
"undefineds",
Keys->Undefineds);
1065struct DocumentListTraits<
std::vector<const MachO::InterfaceFile *>> {
1066 static size_t size(IO &IO, std::vector<const MachO::InterfaceFile *> &Seq) {
1071 if (
Index >= Seq.size())
1072 Seq.resize(
Index + 1);
1090 NewDiag.
print(
nullptr, S);
1091 File->ErrorMessage = (
"malformed file\n" + Message).str();
1098 if (TAPIFile.startswith(
"{") && TAPIFile.endswith(
"}"))
1099 return FileType::TBD_V5;
1101 if (!TAPIFile.endswith(
"..."))
1104 if (TAPIFile.startswith(
"--- !tapi-tbd\n"))
1105 return FileType::TBD_V4;
1107 if (TAPIFile.startswith(
"--- !tapi-tbd-v3\n"))
1108 return FileType::TBD_V3;
1110 if (TAPIFile.startswith(
"--- !tapi-tbd-v2\n"))
1111 return FileType::TBD_V2;
1113 if (TAPIFile.startswith(
"--- !tapi-tbd-v1\n") ||
1114 TAPIFile.startswith(
"---\narchs:"))
1115 return FileType::TBD_V1;
1125 if (
auto FTOrErr = canReadFileType(InputBuffer))
1128 return FTOrErr.takeError();
1134 return FileOrErr.takeError();
1135 return std::move(*FileOrErr);
1140 std::vector<const InterfaceFile *> Files;
1145 auto File = std::unique_ptr<InterfaceFile>(
1150 std::shared_ptr<InterfaceFile>(
const_cast<InterfaceFile *
>(FI)));
1153 return make_error<StringError>(Ctx.
ErrorMessage, YAMLIn.error());
1155 return std::move(File);
1161 Ctx.
Path = std::string(File.getPath());
1169 llvm::yaml::Output YAMLOut(
OS, &Ctx, 80);
1171 std::vector<const InterfaceFile *> Files;
1172 Files.emplace_back(&File);
1174 for (
auto Document : File.documents())
1175 Files.emplace_back(
Document.get());
static cl::opt< ITMode > IT(cl::desc("IT block support"), cl::Hidden, cl::init(DefaultIT), cl::values(clEnumValN(DefaultIT, "arm-default-it", "Generate any type of IT block"), clEnumValN(RestrictedIT, "arm-restrict-it", "Disallow complex IT blocks")))
This file defines the BumpPtrAllocator interface.
Replace intrinsics with calls to vector library
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallString class.
std::pair< llvm::MachO::Target, std::string > UUID
std::array< StringRef, 64 > Keys
static void DiagHandler(const SMDiagnostic &Diag, void *Context)
#define LLVM_YAML_IS_SEQUENCE_VECTOR(type)
#define LLVM_YAML_IS_FLOW_SEQUENCE_VECTOR(type)
Allocate memory in an ever growing pool, as if by bump-pointer.
Lightweight error class with error context and mandatory checking.
static ErrorSuccess success()
Create a success value.
Tagged union holding either a T or a Error.
Defines the interface file.
bool isWeakDefined() const
const_target_range targets() const
bool isThreadLocalValue() const
SymbolKind getKind() const
ArchitectureSet getArchitectures() const
StringRef getName() const
bool isWeakReferenced() const
static llvm::Expected< Target > create(StringRef Target)
static Expected< std::unique_ptr< InterfaceFile > > get(MemoryBufferRef InputBuffer)
static Error writeToStream(raw_ostream &OS, const InterfaceFile &File, bool Compact=false)
StringRef getBufferIdentifier() const
StringRef getBuffer() const
Instances of this class encapsulate one diagnostic report, allowing printing to a raw_ostream as a ca...
SourceMgr::DiagKind getKind() const
StringRef getLineContents() const
StringRef getMessage() const
ArrayRef< SMFixIt > getFixIts() const
ArrayRef< std::pair< unsigned, unsigned > > getRanges() const
const SourceMgr * getSourceMgr() const
void print(const char *ProgName, raw_ostream &S, bool ShowColors=true, bool ShowKindLabel=true) const
SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
iterator insert(iterator I, T &&Elt)
StringRef - Represent a constant reference to a string, i.e.
std::string str() const
str - Get the contents as an std::string.
StringRef trim(char Char) const
Return string with consecutive Char characters starting from the left and right removed.
Target - Wrapper for Target specific information.
LLVM Value Representation.
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
A raw_ostream that writes to an SmallVector or SmallString.
A YAML Stream is a sequence of Documents.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
FileType
Defines the file type this file represents.
@ TBD_V5
Text-based stub file (.tbd) version 5.0.
@ PLATFORM_WATCHOSSIMULATOR
ObjCConstraintType
Defines a list of Objective-C constraints.
Architecture
Defines the architecture slices that are supported by Text-based Stub files.
PlatformType mapToPlatformType(PlatformType Platform, bool WantSim)
Error serializeInterfaceFileToJSON(raw_ostream &OS, const InterfaceFile &File, bool Compact)
Expected< std::unique_ptr< InterfaceFile > > getInterfaceFileFromJSON(StringRef JSON)
This is an optimization pass for GlobalISel generic memory operations.
auto drop_begin(T &&RangeOrContainer, size_t N=1)
Return a range covering RangeOrContainer with the first N elements excluded.
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
void sort(IteratorTy Start, IteratorTy End)
void consumeError(Error Err)
Consume a Error without doing anything.
static const InterfaceFile *& element(IO &IO, std::vector< const InterfaceFile * > &Seq, size_t Index)
static size_t size(IO &IO, std::vector< const MachO::InterfaceFile * > &Seq)
static void mapping(IO &IO, MetadataSection &Section, MetadataSection::Option &OptionKind)
static void mapping(IO &IO, ExportSection &Section)
static void mapping(IO &IO, SymbolSection &Section)
static void mapping(IO &IO, UUIDv4 &UUID)
static void mapping(IO &IO, UmbrellaSection &Section)
static void mapping(IO &IO, UndefinedSection &Section)
std::vector< UmbrellaSection > ParentUmbrellas
PackedVersion CurrentVersion
std::vector< UUIDv4 > UUIDs
std::vector< MetadataSection > AllowableClients
PackedVersion CompatibilityVersion
std::vector< MetadataSection > ReexportedLibraries
const InterfaceFile * denormalize(IO &IO)
NormalizedTBD_V4(IO &IO, const InterfaceFile *&File)
std::vector< UndefinedSection > Undefineds
NormalizedTBD(IO &IO, const InterfaceFile *&File)
StringRef copyString(StringRef String)
TargetList synthesizeTargets(ArchitectureSet Architectures, const PlatformSet &Platforms)
std::vector< UUID > UUIDs
const InterfaceFile * denormalize(IO &IO)
std::vector< Architecture > Architectures
llvm::BumpPtrAllocator Allocator
PackedVersion CurrentVersion
std::vector< ExportSection > Exports
PackedVersion CompatibilityVersion
static void mapKeysToValuesV4(IO &IO, const InterfaceFile *&File)
static void setFileTypeForInput(TextAPIContext *Ctx, IO &IO)
std::vector< SymbolSection > SectionList
static void mapping(IO &IO, const InterfaceFile *&File)
static void mapKeysToValues(FileType FileKind, IO &IO, const InterfaceFile *&File)
static void bitset(IO &IO, TBDFlags &Flags)
static StringRef input(StringRef Scalar, void *, Target &Value)
static void output(const Target &Value, void *, raw_ostream &OS)
static QuotingType mustQuote(StringRef)