83using AttrToTargets = std::map<std::string, TargetList>;
84using TargetsToSymbols =
90class InOrderAttrToTargets {
91 using EntryT = std::pair<std::string, TargetList>;
94 void insert(EntryT &&Entry) {
96 Element.second =
Entry.second;
99 const EntryT *
begin() {
return Container.begin(); }
100 const EntryT *
end() {
return Container.end(); }
103 EntryT &
get(std::string &
Key) {
105 [&
Key](EntryT &Input) {
return Input.first ==
Key; });
106 if (It != Container.end())
108 Container.push_back(EntryT(
Key, {}));
109 return Container.back();
114enum TBDKey :
size_t {
126 CompatibilityVersion,
152std::array<StringRef, 64> Keys = {
164 "compatibility_versions",
172 "reexported_libraries",
176 "reexported_symbols",
191 return {
"invalid ", Keys[
Key],
" section"};
195 return {
"missing ", Keys[
Key],
" information"};
200 JSONStubError(Twine ErrMsg) : Message(ErrMsg.str()) {}
202 void log(llvm::raw_ostream &OS)
const override { OS << Message <<
"\n"; }
203 std::error_code convertToErrorCode()
const override {
211template <
typename JsonT,
typename StubT = JsonT>
214 std::function<std::optional<JsonT>(
const Object *,
StringRef)> GetValue,
215 std::function<std::optional<StubT>(JsonT)> Validate =
nullptr) {
216 std::optional<JsonT> Val = GetValue(Obj, Keys[
Key]);
220 if (Validate ==
nullptr)
221 return static_cast<StubT
>(*Val);
223 std::optional<StubT>
Result = Validate(*Val);
229template <
typename JsonT,
typename StubT = JsonT>
234 StubT DefaultValue,
function_ref<std::optional<StubT>(JsonT)> Validate) {
235 std::optional<JsonT> Val = GetValue(Obj, Keys[
Key]);
239 std::optional<StubT>
Result;
248 bool IsRequired =
false) {
249 const auto *Values =
Obj->getArray(Keys[
Key]);
256 for (
const Value &Val : *Values) {
257 auto ValStr = Val.getAsString();
258 if (!ValStr.has_value())
269 auto VersionOrErr = getRequiredValue<int64_t, FileType>(
271 [](int64_t Val) -> std::optional<FileType> {
272 unsigned Result = Val;
280 return *VersionOrErr;
287 if (!TargetOrErr->isValid())
293 const auto *Targets = Section->getArray(Keys[TBDKey::Targets]);
298 for (
const Value &JSONTarget : *Targets) {
299 auto TargetStr = JSONTarget.getAsString();
300 if (!TargetStr.has_value())
302 auto TargetOrErr = parseTargetStr(TargetStr.value());
304 return TargetOrErr.takeError();
305 if (!TargetOrErr->has_value())
309 return std::move(IFTargets);
313 const Array *Targets = Section->getArray(Keys[TBDKey::TargetInfo]);
318 for (
const Value &JSONTarget : *Targets) {
319 const auto *Obj = JSONTarget.getAsObject();
326 auto TargetOrErr = parseTargetStr(*TargetStr);
328 return TargetOrErr.takeError();
329 if (!TargetOrErr->has_value())
332 auto VersionStr = Obj->getString(Keys[TBDKey::Deployment]);
334 if (VersionStr && Version.tryParse(*VersionStr))
336 (*TargetOrErr)->MinDeployment = Version;
343 return std::move(IFTargets);
346Error collectSymbolsFromSegment(
const Object *Segment, TargetsToSymbols &Result,
348 auto Err = collectFromArray(
349 TBDKey::Globals, Segment, [&Result, &SectionFlag](
StringRef Name) {
351 Result.back().second.emplace_back(Sym);
356 Err = collectFromArray(
357 TBDKey::ObjCClass, Segment, [&Result, &SectionFlag](
StringRef Name) {
359 Result.back().second.emplace_back(Sym);
364 Err = collectFromArray(TBDKey::ObjCEHType, Segment,
365 [&Result, &SectionFlag](
StringRef Name) {
367 Name.str(), SectionFlag};
368 Result.back().second.emplace_back(Sym);
373 Err = collectFromArray(
374 TBDKey::ObjCIvar, Segment, [&Result, &SectionFlag](
StringRef Name) {
377 Result.back().second.emplace_back(Sym);
387 Err = collectFromArray(
388 TBDKey::Weak, Segment, [&Result, WeakFlag](
StringRef Name) {
390 Result.back().second.emplace_back(Sym);
395 Err = collectFromArray(
396 TBDKey::ThreadLocal, Segment, [&Result, SectionFlag](
StringRef Name) {
399 Result.back().second.emplace_back(Sym);
408 const Array *Section = File->getArray(Keys[TBDKey::InstallName]);
412 assert(!Section->empty() &&
"unexpected missing install name");
414 const auto *Obj = Section->front().getAsObject();
424 const Array *Section = File->getArray(Keys[
Key]);
426 return TargetsToSymbols();
430 case TBDKey::Reexports:
433 case TBDKey::Undefineds:
441 TargetsToSymbols Result;
443 for (
auto Val : *Section) {
444 auto *Obj = Val.getAsObject();
448 auto TargetsOrErr = getTargets(Obj);
450 MappedTargets = Targets;
453 MappedTargets = *TargetsOrErr;
456 std::make_pair(std::move(MappedTargets), std::vector<JSONSymbol>()));
458 auto *DataSection = Obj->getObject(Keys[TBDKey::Data]);
459 auto *TextSection = Obj->getObject(Keys[TBDKey::Text]);
461 if (!DataSection && !TextSection)
465 auto Err = collectSymbolsFromSegment(DataSection, Result,
468 return std::move(Err);
471 auto Err = collectSymbolsFromSegment(TextSection, Result,
474 return std::move(Err);
478 return std::move(Result);
481template <
typename ReturnT = AttrToTargets>
484 auto *Section = File->getArray(Keys[
Key]);
490 for (
auto Val : *Section) {
491 auto *Obj = Val.getAsObject();
495 auto TargetsOrErr = getTargets(Obj);
497 MappedTargets = Targets;
500 MappedTargets = *TargetsOrErr;
503 collectFromArray(SubKey, Obj, [&Result, &MappedTargets](
StringRef Key) {
504 Result.insert({
Key.str(), MappedTargets});
507 return std::move(Err);
510 return std::move(Result);
515 const auto *Umbrella = File->getArray(Keys[TBDKey::ParentUmbrella]);
517 return AttrToTargets();
519 AttrToTargets Result;
521 for (
auto Val : *Umbrella) {
522 auto *Obj = Val.getAsObject();
525 getParseErrorMsg(TBDKey::ParentUmbrella));
528 auto TargetsOrErr = getTargets(Obj);
530 MappedTargets = Targets;
533 MappedTargets = *TargetsOrErr;
539 return UmbrellaOrErr.takeError();
540 Result[UmbrellaOrErr->str()] = Targets;
542 return std::move(Result);
546 const Array *Versions = File->getArray(Keys[TBDKey::SwiftABI]);
550 for (
const auto &Val : *Versions) {
551 const auto *Obj = Val.getAsObject();
556 return getRequiredValue<int64_t, uint8_t>(TBDKey::ABI, Obj,
564 const Array *Versions = File->getArray(Keys[
Key]);
568 for (
const auto &Val : *Versions) {
569 const auto *Obj = Val.getAsObject();
573 auto ValidatePV = [](
StringRef Version) -> std::optional<PackedVersion> {
581 return getRequiredValue<StringRef, PackedVersion>(
591 const Array *Section = File->getArray(Keys[TBDKey::Flags]);
592 if (!Section || Section->empty())
595 for (
auto &Val : *Section) {
597 const auto *Obj = Val.getAsObject();
602 collectFromArray(TBDKey::Attributes, Obj, [&Flags](
StringRef Flag) {
606 .
Case(
"not_app_extension_safe",
609 .
Case(
"not_for_dyld_shared_cache",
616 return std::move(FlagsOrErr);
624using IFPtr = std::unique_ptr<InterfaceFile>;
626 auto TargetsOrErr = getTargetsSection(File);
628 return TargetsOrErr.takeError();
631 auto NameOrErr = getNameSection(File);
633 return NameOrErr.takeError();
636 auto CurrVersionOrErr = getPackedVersion(File, TBDKey::CurrentVersion);
637 if (!CurrVersionOrErr)
638 return CurrVersionOrErr.takeError();
641 auto CompVersionOrErr = getPackedVersion(File, TBDKey::CompatibilityVersion);
642 if (!CompVersionOrErr)
643 return CompVersionOrErr.takeError();
646 auto SwiftABIOrErr = getSwiftVersion(File);
648 return SwiftABIOrErr.takeError();
649 uint8_t SwiftABI = *SwiftABIOrErr;
653 return FlagsOrErr.takeError();
654 TBDFlags Flags = *FlagsOrErr;
656 auto UmbrellasOrErr = getUmbrellaSection(File, Targets);
658 return UmbrellasOrErr.takeError();
659 const AttrToTargets &Umbrellas = *UmbrellasOrErr;
662 getLibSection(File, TBDKey::AllowableClients, TBDKey::Clients, Targets);
664 return ClientsOrErr.takeError();
665 const AttrToTargets &Clients = *ClientsOrErr;
668 getLibSection(File, TBDKey::ReexportLibs, TBDKey::Names, Targets);
670 return RLOrErr.takeError();
671 AttrToTargets ReexportLibs = std::move(*RLOrErr);
673 auto RPathsOrErr = getLibSection<InOrderAttrToTargets>(
674 File, TBDKey::RPath, TBDKey::Paths, Targets);
676 return RPathsOrErr.takeError();
677 InOrderAttrToTargets RPaths = std::move(*RPathsOrErr);
679 auto ExportsOrErr = getSymbolSection(File, TBDKey::Exports, Targets);
681 return ExportsOrErr.takeError();
682 TargetsToSymbols Exports = std::move(*ExportsOrErr);
684 auto ReexportsOrErr = getSymbolSection(File, TBDKey::Reexports, Targets);
686 return ReexportsOrErr.takeError();
687 TargetsToSymbols Reexports = std::move(*ReexportsOrErr);
689 auto UndefinedsOrErr = getSymbolSection(File, TBDKey::Undefineds, Targets);
690 if (!UndefinedsOrErr)
691 return UndefinedsOrErr.takeError();
692 TargetsToSymbols Undefineds = std::move(*UndefinedsOrErr);
695 F->setInstallName(Name);
696 F->setCurrentVersion(CurrVersion);
697 F->setCompatibilityVersion(CompVersion);
698 F->setSwiftABIVersion(SwiftABI);
700 F->setApplicationExtensionSafe(
704 for (
auto &T : Targets)
706 for (
auto &[
Lib, Targets] : Clients)
707 for (
auto Target : Targets)
709 for (
auto &[
Lib, Targets] : ReexportLibs)
710 for (
auto Target : Targets)
712 for (
auto &[
Lib, Targets] : Umbrellas)
713 for (
auto Target : Targets)
715 for (
auto &[
Path, Targets] : RPaths)
716 for (
auto Target : Targets)
718 for (
auto &[Targets, Symbols] : Exports) {
721 for (
auto &Sym : Symbols)
722 F->addSymbol(Sym.Kind, Sym.Name, Targets, Sym.Flags);
724 for (
auto &[Targets, Symbols] : Reexports) {
727 for (
auto &Sym : Symbols)
728 F->addSymbol(Sym.Kind, Sym.Name, Targets, Sym.Flags);
730 for (
auto &[Targets, Symbols] : Undefineds) {
733 for (
auto &Sym : Symbols)
734 F->addSymbol(Sym.Kind, Sym.Name, Targets, Sym.Flags);
741 std::vector<IFPtr> IFs;
742 const Array *Files = File->getArray(Keys[TBDKey::Documents]);
744 return std::move(IFs);
746 for (
auto Lib : *Files) {
747 auto IFOrErr = parseToInterfaceFile(
Lib.getAsObject());
749 return IFOrErr.takeError();
750 auto IF = std::move(*IFOrErr);
751 IFs.emplace_back(std::move(IF));
753 return std::move(IFs);
761 auto ValOrErr =
parse(JSON);
763 return ValOrErr.takeError();
765 auto *Root = ValOrErr->getAsObject();
766 auto VersionOrErr = StubParser::getVersion(Root);
768 return VersionOrErr.takeError();
772 auto IFOrErr = StubParser::parseToInterfaceFile(MainLib);
774 return IFOrErr.takeError();
775 (*IFOrErr)->setFileType(
Version);
776 std::unique_ptr<InterfaceFile> IF(std::move(*IFOrErr));
778 auto IFsOrErr = StubParser::getInlinedLibs(Root);
780 return IFsOrErr.takeError();
781 for (
auto &File : *IFsOrErr) {
783 IF->addDocument(std::shared_ptr<InterfaceFile>(std::move(File)));
785 return std::move(IF);
790template <
typename ContainerT = Array>
791bool insertNonEmptyValues(
Object &Obj, TBDKey
Key, ContainerT &&Contents) {
792 if (Contents.empty())
794 Obj[Keys[
Key]] = std::move(Contents);
799 std::string PlatformStr = Targ.
Platform == PLATFORM_MACCATALYST
805template <
typename AggregateT>
806std::vector<std::string> serializeTargets(
const AggregateT Targets,
808 std::vector<std::string> TargetsStr;
809 if (Targets.size() == ActiveTargets.
size())
813 TargetsStr.emplace_back(getFormattedStr(
Target));
820 for (
const auto Targ : ActiveTargets) {
824 TargetInfo[Keys[TBDKey::Target]] = getFormattedStr(Targ);
830template <
typename ValueT,
typename EntryT = ValueT>
841using TargetsToValuesMap =
842 std::map<std::vector<std::string>, std::vector<std::string>>;
844template <
typename AggregateT = TargetsToValuesMap>
845Array serializeAttrToTargets(AggregateT &Entries, TBDKey
Key) {
847 for (
const auto &[Targets, Values] : Entries) {
849 insertNonEmptyValues(Obj, TBDKey::Targets, std::move(Targets));
858template <
typename ValueT = std::string,
859 typename AggregateT = std::vector<std::pair<MachO::Target, ValueT>>>
860Array serializeField(TBDKey
Key,
const AggregateT &Values,
861 const TargetList &ActiveTargets,
bool IsArray =
true) {
862 std::map<ValueT, std::set<MachO::Target>> Entries;
863 for (
const auto &[
Target, Val] : Values)
867 std::map<std::vector<std::string>, std::string> FinalEntries;
868 for (
const auto &[Val, Targets] : Entries)
869 FinalEntries[serializeTargets(Targets, ActiveTargets)] = Val;
870 return serializeAttrToTargets(FinalEntries,
Key);
873 TargetsToValuesMap FinalEntries;
874 for (
const auto &[Val, Targets] : Entries)
875 FinalEntries[serializeTargets(Targets, ActiveTargets)].emplace_back(Val);
876 return serializeAttrToTargets(FinalEntries,
Key);
879Array serializeField(TBDKey
Key,
const std::vector<InterfaceFileRef> &Values,
881 TargetsToValuesMap FinalEntries;
882 for (
const auto &
Ref : Values) {
884 FinalEntries[serializeTargets(Targets, ActiveTargets)].
emplace_back(
885 Ref.getInstallName());
887 return serializeAttrToTargets(FinalEntries,
Key);
891 typename AggregateT = std::vector<std::pair<MachO::Target, std::string>>>
892Array serializeFieldInInsertionOrder(TBDKey
Key,
const AggregateT &Values,
895 for (
const auto &[
Target, Val] : Values)
898 TargetsToValuesMap FinalEntries;
899 for (
const auto &[Val, Targets] : Entries)
900 FinalEntries[serializeTargets(Targets, ActiveTargets)].emplace_back(
902 return serializeAttrToTargets(FinalEntries,
Key);
907 std::vector<StringRef> Weaks;
908 std::vector<StringRef> Globals;
909 std::vector<StringRef> TLV;
910 std::vector<StringRef> ObjCClasses;
911 std::vector<StringRef> IVars;
912 std::vector<StringRef> EHTypes;
915 return Weaks.empty() && Globals.empty() && TLV.empty() &&
916 ObjCClasses.empty() && IVars.empty() && EHTypes.empty();
925 auto AssignForSymbolType = [](SymbolFields::SymbolTypes &Assignment,
927 switch (Sym->getKind()) {
929 Assignment.ObjCClasses.emplace_back(Sym->getName());
932 Assignment.EHTypes.emplace_back(Sym->getName());
935 Assignment.IVars.emplace_back(Sym->getName());
938 if (Sym->isWeakReferenced() || Sym->isWeakDefined())
939 Assignment.Weaks.emplace_back(Sym->getName());
940 else if (Sym->isThreadLocalValue())
941 Assignment.TLV.emplace_back(Sym->getName());
943 Assignment.Globals.emplace_back(Sym->getName());
949 std::map<std::vector<std::string>, SymbolFields> Entries;
950 for (
const auto *Sym : Symbols) {
951 std::set<MachO::Target> Targets{Sym->targets().begin(),
952 Sym->targets().end()};
953 auto JSONTargets = serializeTargets(Targets, ActiveTargets);
955 AssignForSymbolType(Entries[std::move(JSONTargets)].
Data, Sym);
956 else if (Sym->isText())
957 AssignForSymbolType(Entries[std::move(JSONTargets)].
Text, Sym);
962 auto InsertSymbolsToJSON = [](
Object &SymSection, TBDKey SegmentKey,
963 SymbolFields::SymbolTypes &SymField) {
964 if (SymField.empty())
973 insertNonEmptyValues(Segment, TBDKey::Globals, std::move(SymField.Globals));
974 insertNonEmptyValues(Segment, TBDKey::ThreadLocal, std::move(SymField.TLV));
975 insertNonEmptyValues(Segment, TBDKey::Weak, std::move(SymField.Weaks));
976 insertNonEmptyValues(Segment, TBDKey::ObjCClass,
977 std::move(SymField.ObjCClasses));
978 insertNonEmptyValues(Segment, TBDKey::ObjCEHType,
979 std::move(SymField.EHTypes));
980 insertNonEmptyValues(Segment, TBDKey::ObjCIvar, std::move(SymField.IVars));
981 insertNonEmptyValues(SymSection, SegmentKey, std::move(Segment));
985 for (
auto &[Targets, Fields] : Entries) {
987 insertNonEmptyValues(AllSyms, TBDKey::Targets, std::move(Targets));
988 InsertSymbolsToJSON(AllSyms, TBDKey::Data, Fields.Data);
989 InsertSymbolsToJSON(AllSyms, TBDKey::Text, Fields.Text);
990 SymbolSection.emplace_back(std::move(AllSyms));
993 return SymbolSection;
999 if (!
File->isTwoLevelNamespace())
1001 if (!
File->isApplicationExtensionSafe())
1002 Flags.emplace_back(
"not_app_extension_safe");
1003 if (
File->hasSimulatorSupport())
1004 Flags.emplace_back(
"sim_support");
1005 if (
File->isOSLibNotForSharedCache())
1006 Flags.emplace_back(
"not_for_dyld_shared_cache");
1007 return serializeScalar(TBDKey::Attributes, std::move(Flags));
1015 if (!insertNonEmptyValues(Library, TBDKey::TargetInfo,
1016 serializeTargetInfo(ActiveTargets)))
1019 Array Name = serializeScalar<StringRef>(TBDKey::Name,
File->getInstallName());
1020 if (!insertNonEmptyValues(Library, TBDKey::InstallName, std::move(Name)))
1024 Array Flags = serializeFlags(File);
1025 insertNonEmptyValues(Library, TBDKey::Flags, std::move(Flags));
1027 Array CurrentV = serializeScalar<PackedVersion, std::string>(
1029 insertNonEmptyValues(Library, TBDKey::CurrentVersion, std::move(CurrentV));
1031 Array CompatV = serializeScalar<PackedVersion, std::string>(
1033 insertNonEmptyValues(Library, TBDKey::CompatibilityVersion,
1034 std::move(CompatV));
1036 Array SwiftABI = serializeScalar<uint8_t, int64_t>(
1037 TBDKey::ABI,
File->getSwiftABIVersion(), 0u);
1038 insertNonEmptyValues(Library, TBDKey::SwiftABI, std::move(SwiftABI));
1040 Array RPaths = serializeFieldInInsertionOrder(TBDKey::Paths,
File->rpaths(),
1042 insertNonEmptyValues(Library, TBDKey::RPath, std::move(RPaths));
1044 Array Umbrellas = serializeField(TBDKey::Umbrella,
File->umbrellas(),
1045 ActiveTargets,
false);
1046 insertNonEmptyValues(Library, TBDKey::ParentUmbrella, std::move(Umbrellas));
1049 serializeField(TBDKey::Clients,
File->allowableClients(), ActiveTargets);
1050 insertNonEmptyValues(Library, TBDKey::AllowableClients, std::move(Clients));
1052 Array ReexportLibs =
1053 serializeField(TBDKey::Names,
File->reexportedLibraries(), ActiveTargets);
1054 insertNonEmptyValues(Library, TBDKey::ReexportLibs, std::move(ReexportLibs));
1057 Array Exports = serializeSymbols(
File->exports(), ActiveTargets);
1058 insertNonEmptyValues(Library, TBDKey::Exports, std::move(Exports));
1060 Array Reexports = serializeSymbols(
File->reexports(), ActiveTargets);
1061 insertNonEmptyValues(Library, TBDKey::Reexports, std::move(Reexports));
1063 if (!
File->isTwoLevelNamespace()) {
1064 Array Undefineds = serializeSymbols(
File->undefineds(), ActiveTargets);
1065 insertNonEmptyValues(Library, TBDKey::Undefineds, std::move(Undefineds));
1068 return std::move(Library);
1075 auto MainLibOrErr = serializeIF(File);
1077 return MainLibOrErr;
1078 Root[Keys[TBDKey::MainLibrary]] = std::move(*MainLibOrErr);
1080 for (
const auto &Doc :
File->documents()) {
1081 auto LibOrErr = serializeIF(Doc.get());
1087 Root[Keys[TBDKey::TBDVersion]] = 5;
1088 insertNonEmptyValues(Root, TBDKey::Documents, std::move(Documents));
1089 return std::move(Root);
1098 auto TextFile = getJSON(&File, FileKind);
1100 return TextFile.takeError();
1102 OS <<
formatv(
"{0}",
Value(std::move(*TextFile))) <<
"\n";
1104 OS <<
formatv(
"{0:2}",
Value(std::move(*TextFile))) <<
"\n";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file supports working with JSON data.
This file implements the StringSwitch template, which mimics a switch() statement whose cases are str...
static uint32_t getFlags(const Symbol *Sym)
@ NotApplicationExtensionSafe
Base class for user error types.
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.
Error takeError()
Take ownership of the stored error.
Defines the interface file.
SymbolSet::const_filtered_symbol_range const_filtered_symbol_range
LLVM_ABI std::pair< bool, bool > parse64(StringRef Str)
static LLVM_ABI llvm::Expected< Target > create(StringRef Target)
VersionTuple MinDeployment
This class implements a map that also provides access to all stored values in a deterministic order.
std::pair< iterator, bool > insert(const std::pair< KeyT, ValueT > &KV)
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
void push_back(const T &Elt)
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
A switch()-like statement whose cases are string literals.
StringSwitch & Case(StringLiteral S, T Value)
Target - Wrapper for Target specific information.
Triple - Helper class for working with autoconf configuration names.
LLVM Value Representation.
Represents a version number in the form major[.minor[.subminor[.build]]].
LLVM_ABI std::string getAsString() const
Retrieve a string representation of the version number.
bool empty() const
Determine whether this version information is empty (e.g., all version components are zero).
An efficient, type-erasing, non-owning reference to a callable.
An Array is a JSON array, which contains heterogeneous JSON values.
void emplace_back(Args &&...A)
iterator insert(const_iterator P, const Value &E)
An Object is a JSON object, which maps strings to heterogenous JSON values.
LLVM_ABI const json::Object * getObject(StringRef K) const
LLVM_ABI std::optional< llvm::StringRef > getString(StringRef K) const
LLVM_ABI std::optional< int64_t > getInteger(StringRef K) const
A "cursor" marking a position within a Value.
This class implements an extremely fast bulk output stream that can only output to a stream.
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
LLVM_ABI std::string getTargetTripleName(const Target &Targ)
FileType
Defines the file type TextAPI files can represent.
@ TBD_V5
Text-based stub file (.tbd) version 5.0.
LLVM_ABI StringRef getArchitectureName(Architecture Arch)
Convert an architecture slice to a string.
LLVM_ABI std::string getOSAndEnvironmentName(PlatformType Platform, std::string Version="")
Error serializeInterfaceFileToJSON(raw_ostream &OS, const InterfaceFile &File, const FileType FileKind, bool Compact)
Expected< std::unique_ptr< InterfaceFile > > getInterfaceFileFromJSON(StringRef JSON)
EncodeKind
Mapping of entry types in TextStubs.
@ ObjectiveCInstanceVariable
@ ThreadLocalValue
Thread-local value symbol.
@ WeakReferenced
Weak referenced symbol.
@ WeakDefined
Weak defined symbol.
SmallVector< Target, 5 > TargetList
LLVM_ABI llvm::Expected< Value > parse(llvm::StringRef JSON)
Parses the provided JSON source, or returns a ParseError.
LLVM_ABI iterator begin() const
This is an optimization pass for GlobalISel generic memory operations.
FunctionAddr VTableAddr Value
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
FunctionAddr VTableAddr uintptr_t uintptr_t Version
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
void sort(IteratorTy Start, IteratorTy End)
class LLVM_GSL_OWNER SmallVector
Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference s...
LLVM_ATTRIBUTE_VISIBILITY_DEFAULT AnalysisKey InnerAnalysisManagerProxy< AnalysisManagerT, IRUnitT, ExtraArgTs... >::Key
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
@ Ref
The access may reference the value stored in memory.
FunctionAddr VTableAddr uintptr_t uintptr_t Data
auto find_if(R &&Range, UnaryPredicate P)
Provide wrappers to std::find_if which take ranges instead of having to pass begin/end explicitly.
LogicalResult success(bool IsSuccess=true)
Utility function to generate a LogicalResult.
void consumeError(Error Err)
Consume a Error without doing anything.