17#include "llvm/ADT/Hashing.h"
18#include "llvm/ADT/StringExtras.h"
19#include "llvm/Bitstream/BitstreamReader.h"
20#include "llvm/Support/DJB.h"
21#include "llvm/Support/EndianStream.h"
22#include "llvm/Support/OnDiskHashTable.h"
26using namespace llvm::support;
30llvm::VersionTuple ReadVersionTuple(
const uint8_t *&
Data) {
31 uint8_t NumVersions = (*
Data++) & 0x03;
33 unsigned Major = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
35 return llvm::VersionTuple(Major);
37 unsigned Minor = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
39 return llvm::VersionTuple(Major, Minor);
42 endian::readNext<uint32_t, llvm::endianness::little>(
Data);
44 return llvm::VersionTuple(Major, Minor, Subminor);
46 unsigned Build = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
47 return llvm::VersionTuple(Major, Minor, Subminor, Build);
51template <
typename Derived,
typename KeyType,
typename UnversionedDataType>
52class VersionedTableInfo {
54 using internal_key_type = KeyType;
55 using external_key_type = KeyType;
58 using hash_value_type =
size_t;
61 internal_key_type GetInternalKey(external_key_type Key) {
return Key; }
63 external_key_type GetExternalKey(internal_key_type Key) {
return Key; }
65 static bool EqualKey(internal_key_type LHS, internal_key_type RHS) {
69 static std::pair<unsigned, unsigned> ReadKeyDataLength(
const uint8_t *&
Data) {
71 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
73 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
74 return {KeyLength, DataLength};
77 static data_type ReadData(internal_key_type Key,
const uint8_t *
Data,
79 unsigned NumElements =
80 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
82 Result.reserve(NumElements);
83 for (
unsigned i = 0; i != NumElements; ++i) {
84 auto version = ReadVersionTuple(
Data);
85 const auto *DataBefore =
Data;
87 auto UnversionedData = Derived::readUnversioned(Key,
Data);
88 assert(
Data != DataBefore &&
89 "Unversioned data reader didn't move pointer");
90 Result.push_back({version, UnversionedData});
97void ReadCommonEntityInfo(
const uint8_t *&
Data, CommonEntityInfo &Info) {
98 uint8_t UnavailableBits = *
Data++;
99 Info.Unavailable = (UnavailableBits >> 1) & 0x01;
100 Info.UnavailableInSwift = UnavailableBits & 0x01;
101 if ((UnavailableBits >> 2) & 0x01)
102 Info.setSwiftPrivate(
static_cast<bool>((UnavailableBits >> 3) & 0x01));
105 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
106 Info.UnavailableMsg =
107 std::string(
reinterpret_cast<const char *
>(
Data),
108 reinterpret_cast<const char *
>(
Data) + MsgLength);
111 unsigned SwiftNameLength =
112 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
114 std::string(
reinterpret_cast<const char *
>(
Data),
115 reinterpret_cast<const char *
>(
Data) + SwiftNameLength);
116 Data += SwiftNameLength;
120void ReadCommonTypeInfo(
const uint8_t *&
Data, CommonTypeInfo &Info) {
121 ReadCommonEntityInfo(
Data, Info);
123 unsigned SwiftBridgeLength =
124 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
125 if (SwiftBridgeLength > 0) {
126 Info.setSwiftBridge(std::string(
reinterpret_cast<const char *
>(
Data),
127 SwiftBridgeLength - 1));
128 Data += SwiftBridgeLength - 1;
131 unsigned ErrorDomainLength =
132 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
133 if (ErrorDomainLength > 0) {
134 Info.setNSErrorDomain(std::optional<std::string>(std::string(
135 reinterpret_cast<const char *
>(
Data), ErrorDomainLength - 1)));
136 Data += ErrorDomainLength - 1;
141class IdentifierTableInfo {
143 using internal_key_type = llvm::StringRef;
144 using external_key_type = llvm::StringRef;
146 using hash_value_type = uint32_t;
149 internal_key_type GetInternalKey(external_key_type Key) {
return Key; }
151 external_key_type GetExternalKey(internal_key_type Key) {
return Key; }
153 hash_value_type
ComputeHash(internal_key_type Key) {
154 return llvm::djbHash(Key);
157 static bool EqualKey(internal_key_type LHS, internal_key_type RHS) {
161 static std::pair<unsigned, unsigned> ReadKeyDataLength(
const uint8_t *&
Data) {
163 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
164 unsigned DataLength =
165 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
166 return {KeyLength, DataLength};
169 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
170 return llvm::StringRef(
reinterpret_cast<const char *
>(
Data), Length);
173 static data_type ReadData(internal_key_type key,
const uint8_t *
Data,
175 return endian::readNext<uint32_t, llvm::endianness::little>(
Data);
181class ContextIDTableInfo {
183 using internal_key_type = ContextTableKey;
184 using external_key_type = internal_key_type;
186 using hash_value_type =
size_t;
189 internal_key_type GetInternalKey(external_key_type Key) {
return Key; }
191 external_key_type GetExternalKey(internal_key_type Key) {
return Key; }
193 hash_value_type
ComputeHash(internal_key_type Key) {
194 return static_cast<size_t>(Key.hashValue());
197 static bool EqualKey(internal_key_type LHS, internal_key_type RHS) {
201 static std::pair<unsigned, unsigned> ReadKeyDataLength(
const uint8_t *&
Data) {
203 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
204 unsigned DataLength =
205 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
206 return {KeyLength, DataLength};
209 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
211 endian::readNext<uint32_t, llvm::endianness::little>(
Data);
213 endian::readNext<uint8_t, llvm::endianness::little>(
Data);
214 auto NameID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
218 static data_type ReadData(internal_key_type Key,
const uint8_t *
Data,
220 return endian::readNext<uint32_t, llvm::endianness::little>(
Data);
225class ContextInfoTableInfo
226 :
public VersionedTableInfo<ContextInfoTableInfo, unsigned, ContextInfo> {
228 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
229 return endian::readNext<uint32_t, llvm::endianness::little>(
Data);
232 hash_value_type
ComputeHash(internal_key_type Key) {
236 static ContextInfo readUnversioned(internal_key_type Key,
237 const uint8_t *&
Data) {
239 ReadCommonTypeInfo(
Data, Info);
240 uint8_t Payload = *
Data++;
243 Info.setHasDesignatedInits(
true);
244 Payload = Payload >> 1;
247 Info.setDefaultNullability(
static_cast<NullabilityKind>(Payload & 0x03));
250 if (Payload & (1 << 1))
251 Info.setSwiftObjCMembers(Payload & 1);
254 if (Payload & (1 << 1))
255 Info.setSwiftImportAsNonGeneric(Payload & 1);
262void ReadVariableInfo(
const uint8_t *&
Data, VariableInfo &Info) {
263 ReadCommonEntityInfo(
Data, Info);
269 auto TypeLen = endian::readNext<uint16_t, llvm::endianness::little>(
Data);
270 Info.setType(std::string(
Data,
Data + TypeLen));
275class ObjCPropertyTableInfo
276 :
public VersionedTableInfo<ObjCPropertyTableInfo,
277 std::tuple<uint32_t, uint32_t, uint8_t>,
280 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
281 auto ClassID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
282 auto NameID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
283 char IsInstance = endian::readNext<uint8_t, llvm::endianness::little>(
Data);
284 return {ClassID, NameID, IsInstance};
287 hash_value_type
ComputeHash(internal_key_type Key) {
291 static ObjCPropertyInfo readUnversioned(internal_key_type Key,
292 const uint8_t *&
Data) {
293 ObjCPropertyInfo Info;
294 ReadVariableInfo(
Data, Info);
295 uint8_t Flags = *
Data++;
296 if (Flags & (1 << 0))
297 Info.setSwiftImportAsAccessors(Flags & (1 << 1));
303void ReadParamInfo(
const uint8_t *&
Data, ParamInfo &Info) {
304 ReadVariableInfo(
Data, Info);
306 uint8_t Payload = endian::readNext<uint8_t, llvm::endianness::little>(
Data);
307 if (
auto RawConvention = Payload & 0x7) {
309 Info.setRetainCountConvention(Convention);
313 Info.setNoEscape(Payload & 0x02);
315 assert(Payload == 0 &&
"Bad API notes");
319void ReadFunctionInfo(
const uint8_t *&
Data, FunctionInfo &Info) {
320 ReadCommonEntityInfo(
Data, Info);
322 uint8_t Payload = endian::readNext<uint8_t, llvm::endianness::little>(
Data);
323 if (
auto RawConvention = Payload & 0x7) {
325 Info.setRetainCountConvention(Convention);
328 Info.NullabilityAudited = Payload & 0x1;
330 assert(Payload == 0 &&
"Bad API notes");
332 Info.NumAdjustedNullable =
333 endian::readNext<uint8_t, llvm::endianness::little>(
Data);
334 Info.NullabilityPayload =
335 endian::readNext<uint64_t, llvm::endianness::little>(
Data);
338 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
339 while (NumParams > 0) {
341 ReadParamInfo(
Data, pi);
342 Info.Params.push_back(pi);
346 unsigned ResultTypeLen =
347 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
348 Info.ResultType = std::string(
Data,
Data + ResultTypeLen);
349 Data += ResultTypeLen;
353class ObjCMethodTableInfo
354 :
public VersionedTableInfo<ObjCMethodTableInfo,
355 std::tuple<uint32_t, uint32_t, uint8_t>,
358 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
359 auto ClassID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
361 endian::readNext<uint32_t, llvm::endianness::little>(
Data);
362 auto IsInstance = endian::readNext<uint8_t, llvm::endianness::little>(
Data);
366 hash_value_type
ComputeHash(internal_key_type Key) {
370 static ObjCMethodInfo readUnversioned(internal_key_type Key,
371 const uint8_t *&
Data) {
373 uint8_t Payload = *
Data++;
374 Info.RequiredInit = Payload & 0x01;
376 Info.DesignatedInit = Payload & 0x01;
379 ReadFunctionInfo(
Data, Info);
385class ObjCSelectorTableInfo {
387 using internal_key_type = StoredObjCSelector;
388 using external_key_type = internal_key_type;
393 internal_key_type GetInternalKey(external_key_type Key) {
return Key; }
395 external_key_type GetExternalKey(internal_key_type Key) {
return Key; }
397 hash_value_type
ComputeHash(internal_key_type Key) {
398 return llvm::DenseMapInfo<StoredObjCSelector>::getHashValue(Key);
401 static bool EqualKey(internal_key_type LHS, internal_key_type RHS) {
402 return llvm::DenseMapInfo<StoredObjCSelector>::isEqual(LHS, RHS);
405 static std::pair<unsigned, unsigned> ReadKeyDataLength(
const uint8_t *&
Data) {
407 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
408 unsigned DataLength =
409 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
410 return {KeyLength, DataLength};
413 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
414 internal_key_type Key;
415 Key.NumArgs = endian::readNext<uint16_t, llvm::endianness::little>(
Data);
416 unsigned NumIdents = (Length -
sizeof(uint16_t)) /
sizeof(uint32_t);
417 for (
unsigned i = 0; i != NumIdents; ++i) {
418 Key.Identifiers.push_back(
419 endian::readNext<uint32_t, llvm::endianness::little>(
Data));
424 static data_type ReadData(internal_key_type Key,
const uint8_t *
Data,
426 return endian::readNext<uint32_t, llvm::endianness::little>(
Data);
431class GlobalVariableTableInfo
432 :
public VersionedTableInfo<GlobalVariableTableInfo, SingleDeclTableKey,
433 GlobalVariableInfo> {
435 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
436 auto CtxID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
437 auto NameID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
438 return {CtxID, NameID};
441 hash_value_type
ComputeHash(internal_key_type Key) {
442 return static_cast<size_t>(Key.hashValue());
445 static GlobalVariableInfo readUnversioned(internal_key_type Key,
446 const uint8_t *&
Data) {
447 GlobalVariableInfo Info;
448 ReadVariableInfo(
Data, Info);
454class GlobalFunctionTableInfo
455 :
public VersionedTableInfo<GlobalFunctionTableInfo, SingleDeclTableKey,
456 GlobalFunctionInfo> {
458 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
459 auto CtxID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
460 auto NameID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
461 return {CtxID, NameID};
464 hash_value_type
ComputeHash(internal_key_type Key) {
465 return static_cast<size_t>(Key.hashValue());
468 static GlobalFunctionInfo readUnversioned(internal_key_type Key,
469 const uint8_t *&
Data) {
470 GlobalFunctionInfo Info;
471 ReadFunctionInfo(
Data, Info);
477class CXXMethodTableInfo
478 :
public VersionedTableInfo<CXXMethodTableInfo, SingleDeclTableKey,
481 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
482 auto CtxID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
483 auto NameID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
484 return {CtxID, NameID};
487 hash_value_type
ComputeHash(internal_key_type Key) {
488 return static_cast<size_t>(Key.hashValue());
491 static CXXMethodInfo readUnversioned(internal_key_type Key,
492 const uint8_t *&
Data) {
494 ReadFunctionInfo(
Data, Info);
500class EnumConstantTableInfo
501 :
public VersionedTableInfo<EnumConstantTableInfo, uint32_t,
504 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
505 auto NameID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
509 hash_value_type
ComputeHash(internal_key_type Key) {
513 static EnumConstantInfo readUnversioned(internal_key_type Key,
514 const uint8_t *&
Data) {
515 EnumConstantInfo Info;
516 ReadCommonEntityInfo(
Data, Info);
523 :
public VersionedTableInfo<TagTableInfo, SingleDeclTableKey, TagInfo> {
525 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
526 auto CtxID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
528 endian::readNext<IdentifierID, llvm::endianness::little>(
Data);
529 return {CtxID, NameID};
532 hash_value_type
ComputeHash(internal_key_type Key) {
533 return static_cast<size_t>(Key.hashValue());
536 static TagInfo readUnversioned(internal_key_type Key,
const uint8_t *&
Data) {
539 uint8_t Payload = *
Data++;
541 Info.setFlagEnum(Payload & 2);
544 Info.EnumExtensibility =
548 endian::readNext<uint8_t, llvm::endianness::little>(
Data);
550 Info.setSwiftCopyable(std::optional(
false));
552 Info.setSwiftCopyable(std::optional(
true));
554 unsigned ImportAsLength =
555 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
556 if (ImportAsLength > 0) {
558 std::string(
reinterpret_cast<const char *
>(
Data), ImportAsLength - 1);
559 Data += ImportAsLength - 1;
561 unsigned RetainOpLength =
562 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
563 if (RetainOpLength > 0) {
565 std::string(
reinterpret_cast<const char *
>(
Data), RetainOpLength - 1);
566 Data += RetainOpLength - 1;
568 unsigned ReleaseOpLength =
569 endian::readNext<uint16_t, llvm::endianness::little>(
Data);
570 if (ReleaseOpLength > 0) {
571 Info.SwiftReleaseOp = std::string(
reinterpret_cast<const char *
>(
Data),
572 ReleaseOpLength - 1);
573 Data += ReleaseOpLength - 1;
575 if (
unsigned ConformanceLength =
576 endian::readNext<uint16_t, llvm::endianness::little>(
Data)) {
577 Info.SwiftConformance = std::string(
reinterpret_cast<const char *
>(
Data),
578 ConformanceLength - 1);
579 Data += ConformanceLength - 1;
582 ReadCommonTypeInfo(
Data, Info);
588class TypedefTableInfo
589 :
public VersionedTableInfo<TypedefTableInfo, SingleDeclTableKey,
592 static internal_key_type ReadKey(
const uint8_t *
Data,
unsigned Length) {
593 auto CtxID = endian::readNext<uint32_t, llvm::endianness::little>(
Data);
595 endian::readNext<IdentifierID, llvm::endianness::little>(
Data);
596 return {CtxID, nameID};
599 hash_value_type
ComputeHash(internal_key_type Key) {
600 return static_cast<size_t>(Key.hashValue());
603 static TypedefInfo readUnversioned(internal_key_type Key,
604 const uint8_t *&
Data) {
607 uint8_t Payload = *
Data++;
611 ReadCommonTypeInfo(
Data, Info);
633 llvm::OnDiskIterableChainedHashTable<IdentifierTableInfo>;
639 llvm::OnDiskIterableChainedHashTable<ContextIDTableInfo>;
645 llvm::OnDiskIterableChainedHashTable<ContextInfoTableInfo>;
651 llvm::OnDiskIterableChainedHashTable<ObjCPropertyTableInfo>;
657 llvm::OnDiskIterableChainedHashTable<ObjCMethodTableInfo>;
663 llvm::OnDiskIterableChainedHashTable<CXXMethodTableInfo>;
669 llvm::OnDiskIterableChainedHashTable<ObjCSelectorTableInfo>;
675 llvm::OnDiskIterableChainedHashTable<GlobalVariableTableInfo>;
681 llvm::OnDiskIterableChainedHashTable<GlobalFunctionTableInfo>;
687 llvm::OnDiskIterableChainedHashTable<EnumConstantTableInfo>;
698 llvm::OnDiskIterableChainedHashTable<TypedefTableInfo>;
705 std::optional<IdentifierID>
getIdentifier(llvm::StringRef Str);
737std::optional<IdentifierID>
752std::optional<SelectorID>
760 for (
auto Ident :
Selector.Identifiers) {
768 auto Known = ObjCSelectorTable->find(Key);
769 if (Known == ObjCSelectorTable->end())
780 bool SawMetadata =
false;
785 consumeError(MaybeNext.takeError());
788 llvm::BitstreamEntry Next = MaybeNext.get();
790 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
791 if (Next.Kind == llvm::BitstreamEntry::Error)
794 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
797 if (Cursor.SkipBlock())
800 MaybeNext = Cursor.advance();
803 consumeError(MaybeNext.takeError());
806 Next = MaybeNext.get();
811 llvm::StringRef BlobData;
813 Cursor.readRecord(Next.ID, Scratch, &BlobData);
816 consumeError(MaybeKind.takeError());
819 unsigned Kind = MaybeKind.get();
834 ModuleName = BlobData.str();
841 SourceFileSizeAndModTime = {Scratch[0], Scratch[1]};
850 MaybeNext = Cursor.advance();
853 consumeError(MaybeNext.takeError());
856 Next = MaybeNext.get();
870 consumeError(MaybeNext.takeError());
873 llvm::BitstreamEntry Next = MaybeNext.get();
875 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
876 if (Next.Kind == llvm::BitstreamEntry::Error)
879 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
882 if (Cursor.SkipBlock())
885 MaybeNext = Cursor.advance();
888 consumeError(MaybeNext.takeError());
891 Next = MaybeNext.get();
896 llvm::StringRef BlobData;
898 Cursor.readRecord(Next.ID, Scratch, &BlobData);
901 consumeError(MaybeKind.takeError());
904 unsigned Kind = MaybeKind.get();
911 uint32_t tableOffset;
912 identifier_block::IdentifierDataLayout::readRecord(Scratch, tableOffset);
913 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
916 base + tableOffset, base +
sizeof(uint32_t), base));
926 MaybeNext = Cursor.advance();
929 consumeError(MaybeNext.takeError());
932 Next = MaybeNext.get();
946 consumeError(MaybeNext.takeError());
949 llvm::BitstreamEntry Next = MaybeNext.get();
951 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
952 if (Next.Kind == llvm::BitstreamEntry::Error)
955 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
958 if (Cursor.SkipBlock())
961 MaybeNext = Cursor.advance();
964 consumeError(MaybeNext.takeError());
967 Next = MaybeNext.get();
972 llvm::StringRef BlobData;
974 Cursor.readRecord(Next.ID, Scratch, &BlobData);
977 consumeError(MaybeKind.takeError());
980 unsigned Kind = MaybeKind.get();
987 uint32_t tableOffset;
988 context_block::ContextIDLayout::readRecord(Scratch, tableOffset);
989 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
991 ContextIDTable.reset(SerializedContextIDTable::Create(
992 base + tableOffset, base +
sizeof(uint32_t), base));
998 if (ContextInfoTable)
1001 uint32_t tableOffset;
1002 context_block::ContextInfoLayout::readRecord(Scratch, tableOffset);
1003 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1005 ContextInfoTable.reset(SerializedContextInfoTable::Create(
1006 base + tableOffset, base +
sizeof(uint32_t), base));
1016 MaybeNext = Cursor.advance();
1019 consumeError(MaybeNext.takeError());
1022 Next = MaybeNext.get();
1036 consumeError(MaybeNext.takeError());
1039 llvm::BitstreamEntry Next = MaybeNext.get();
1041 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1042 if (Next.Kind == llvm::BitstreamEntry::Error)
1045 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1048 if (Cursor.SkipBlock())
1051 MaybeNext = Cursor.advance();
1054 consumeError(MaybeNext.takeError());
1057 Next = MaybeNext.get();
1062 llvm::StringRef BlobData;
1064 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1067 consumeError(MaybeKind.takeError());
1070 unsigned Kind = MaybeKind.get();
1074 if (ObjCPropertyTable)
1077 uint32_t tableOffset;
1078 objc_property_block::ObjCPropertyDataLayout::readRecord(Scratch,
1080 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1082 ObjCPropertyTable.reset(SerializedObjCPropertyTable::Create(
1083 base + tableOffset, base +
sizeof(uint32_t), base));
1093 MaybeNext = Cursor.advance();
1096 consumeError(MaybeNext.takeError());
1099 Next = MaybeNext.get();
1113 consumeError(MaybeNext.takeError());
1116 llvm::BitstreamEntry Next = MaybeNext.get();
1117 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1118 if (Next.Kind == llvm::BitstreamEntry::Error)
1121 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1124 if (Cursor.SkipBlock())
1127 MaybeNext = Cursor.advance();
1130 consumeError(MaybeNext.takeError());
1133 Next = MaybeNext.get();
1138 llvm::StringRef BlobData;
1140 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1143 consumeError(MaybeKind.takeError());
1146 unsigned Kind = MaybeKind.get();
1150 if (ObjCMethodTable)
1153 uint32_t tableOffset;
1154 objc_method_block::ObjCMethodDataLayout::readRecord(Scratch, tableOffset);
1155 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1157 ObjCMethodTable.reset(SerializedObjCMethodTable::Create(
1158 base + tableOffset, base +
sizeof(uint32_t), base));
1168 MaybeNext = Cursor.advance();
1171 consumeError(MaybeNext.takeError());
1174 Next = MaybeNext.get();
1188 consumeError(MaybeNext.takeError());
1191 llvm::BitstreamEntry Next = MaybeNext.get();
1192 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1193 if (Next.Kind == llvm::BitstreamEntry::Error)
1196 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1199 if (Cursor.SkipBlock())
1202 MaybeNext = Cursor.advance();
1205 consumeError(MaybeNext.takeError());
1208 Next = MaybeNext.get();
1213 llvm::StringRef BlobData;
1215 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1218 consumeError(MaybeKind.takeError());
1221 unsigned Kind = MaybeKind.get();
1228 uint32_t tableOffset;
1229 cxx_method_block::CXXMethodDataLayout::readRecord(Scratch, tableOffset);
1230 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1232 CXXMethodTable.reset(SerializedCXXMethodTable::Create(
1233 base + tableOffset, base +
sizeof(uint32_t), base));
1243 MaybeNext = Cursor.advance();
1246 consumeError(MaybeNext.takeError());
1249 Next = MaybeNext.get();
1263 consumeError(MaybeNext.takeError());
1266 llvm::BitstreamEntry Next = MaybeNext.get();
1267 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1268 if (Next.Kind == llvm::BitstreamEntry::Error)
1271 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1274 if (Cursor.SkipBlock())
1277 MaybeNext = Cursor.advance();
1280 consumeError(MaybeNext.takeError());
1283 Next = MaybeNext.get();
1288 llvm::StringRef BlobData;
1290 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1293 consumeError(MaybeKind.takeError());
1296 unsigned Kind = MaybeKind.get();
1300 if (ObjCSelectorTable)
1303 uint32_t tableOffset;
1304 objc_selector_block::ObjCSelectorDataLayout::readRecord(Scratch,
1306 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1308 ObjCSelectorTable.reset(SerializedObjCSelectorTable::Create(
1309 base + tableOffset, base +
sizeof(uint32_t), base));
1319 MaybeNext = Cursor.advance();
1322 consumeError(MaybeNext.takeError());
1325 Next = MaybeNext.get();
1339 consumeError(MaybeNext.takeError());
1342 llvm::BitstreamEntry Next = MaybeNext.get();
1343 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1344 if (Next.Kind == llvm::BitstreamEntry::Error)
1347 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1350 if (Cursor.SkipBlock())
1353 MaybeNext = Cursor.advance();
1356 consumeError(MaybeNext.takeError());
1359 Next = MaybeNext.get();
1364 llvm::StringRef BlobData;
1366 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1369 consumeError(MaybeKind.takeError());
1372 unsigned Kind = MaybeKind.get();
1376 if (GlobalVariableTable)
1379 uint32_t tableOffset;
1380 global_variable_block::GlobalVariableDataLayout::readRecord(Scratch,
1382 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1384 GlobalVariableTable.reset(SerializedGlobalVariableTable::Create(
1385 base + tableOffset, base +
sizeof(uint32_t), base));
1395 MaybeNext = Cursor.advance();
1398 consumeError(MaybeNext.takeError());
1401 Next = MaybeNext.get();
1415 consumeError(MaybeNext.takeError());
1418 llvm::BitstreamEntry Next = MaybeNext.get();
1419 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1420 if (Next.Kind == llvm::BitstreamEntry::Error)
1423 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1426 if (Cursor.SkipBlock())
1429 MaybeNext = Cursor.advance();
1432 consumeError(MaybeNext.takeError());
1435 Next = MaybeNext.get();
1440 llvm::StringRef BlobData;
1442 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1445 consumeError(MaybeKind.takeError());
1448 unsigned Kind = MaybeKind.get();
1452 if (GlobalFunctionTable)
1455 uint32_t tableOffset;
1456 global_function_block::GlobalFunctionDataLayout::readRecord(Scratch,
1458 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1460 GlobalFunctionTable.reset(SerializedGlobalFunctionTable::Create(
1461 base + tableOffset, base +
sizeof(uint32_t), base));
1471 MaybeNext = Cursor.advance();
1474 consumeError(MaybeNext.takeError());
1477 Next = MaybeNext.get();
1491 consumeError(MaybeNext.takeError());
1494 llvm::BitstreamEntry Next = MaybeNext.get();
1495 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1496 if (Next.Kind == llvm::BitstreamEntry::Error)
1499 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1502 if (Cursor.SkipBlock())
1505 MaybeNext = Cursor.advance();
1508 consumeError(MaybeNext.takeError());
1511 Next = MaybeNext.get();
1516 llvm::StringRef BlobData;
1518 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1521 consumeError(MaybeKind.takeError());
1524 unsigned Kind = MaybeKind.get();
1528 if (EnumConstantTable)
1531 uint32_t tableOffset;
1532 enum_constant_block::EnumConstantDataLayout::readRecord(Scratch,
1534 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1536 EnumConstantTable.reset(SerializedEnumConstantTable::Create(
1537 base + tableOffset, base +
sizeof(uint32_t), base));
1547 MaybeNext = Cursor.advance();
1550 consumeError(MaybeNext.takeError());
1553 Next = MaybeNext.get();
1567 consumeError(MaybeNext.takeError());
1570 llvm::BitstreamEntry Next = MaybeNext.get();
1571 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1572 if (Next.Kind == llvm::BitstreamEntry::Error)
1575 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1578 if (Cursor.SkipBlock())
1581 MaybeNext = Cursor.advance();
1584 consumeError(MaybeNext.takeError());
1587 Next = MaybeNext.get();
1592 llvm::StringRef BlobData;
1594 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1597 consumeError(MaybeKind.takeError());
1600 unsigned Kind = MaybeKind.get();
1607 uint32_t tableOffset;
1608 tag_block::TagDataLayout::readRecord(Scratch, tableOffset);
1609 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1611 TagTable.reset(SerializedTagTable::Create(base + tableOffset,
1612 base +
sizeof(uint32_t), base));
1622 MaybeNext = Cursor.advance();
1625 consumeError(MaybeNext.takeError());
1628 Next = MaybeNext.get();
1642 consumeError(MaybeNext.takeError());
1645 llvm::BitstreamEntry Next = MaybeNext.get();
1646 while (Next.Kind != llvm::BitstreamEntry::EndBlock) {
1647 if (Next.Kind == llvm::BitstreamEntry::Error)
1650 if (Next.Kind == llvm::BitstreamEntry::SubBlock) {
1653 if (Cursor.SkipBlock())
1656 MaybeNext = Cursor.advance();
1659 consumeError(MaybeNext.takeError());
1662 Next = MaybeNext.get();
1667 llvm::StringRef BlobData;
1669 Cursor.readRecord(Next.ID, Scratch, &BlobData);
1672 consumeError(MaybeKind.takeError());
1675 unsigned Kind = MaybeKind.get();
1682 uint32_t tableOffset;
1683 typedef_block::TypedefDataLayout::readRecord(Scratch, tableOffset);
1684 auto base =
reinterpret_cast<const uint8_t *
>(BlobData.data());
1686 TypedefTable.reset(SerializedTypedefTable::Create(
1687 base + tableOffset, base +
sizeof(uint32_t), base));
1697 MaybeNext = Cursor.advance();
1700 consumeError(MaybeNext.takeError());
1703 Next = MaybeNext.get();
1709APINotesReader::APINotesReader(llvm::MemoryBuffer *InputBuffer,
1710 llvm::VersionTuple SwiftVersion,
bool &Failed)
1721 if (Cursor.AtEndOfStream()) {
1727 if (maybeRead.get() !=
byte) {
1733 consumeError(maybeRead.takeError());
1740 bool HasValidControlBlock =
false;
1742 while (!
Cursor.AtEndOfStream()) {
1744 if (!MaybeTopLevelEntry) {
1746 consumeError(MaybeTopLevelEntry.takeError());
1750 llvm::BitstreamEntry TopLevelEntry = MaybeTopLevelEntry.get();
1752 if (TopLevelEntry.Kind != llvm::BitstreamEntry::SubBlock)
1755 switch (TopLevelEntry.ID) {
1756 case llvm::bitc::BLOCKINFO_BLOCK_ID:
1757 if (!
Cursor.ReadBlockInfoBlock()) {
1765 if (HasValidControlBlock ||
1766 Implementation->readControlBlock(Cursor, Scratch)) {
1771 HasValidControlBlock =
true;
1775 if (!HasValidControlBlock ||
1776 Implementation->readIdentifierBlock(Cursor, Scratch)) {
1783 if (!HasValidControlBlock ||
1784 Implementation->readContextBlock(Cursor, Scratch)) {
1792 if (!HasValidControlBlock ||
1793 Implementation->readObjCPropertyBlock(Cursor, Scratch)) {
1800 if (!HasValidControlBlock ||
1801 Implementation->readObjCMethodBlock(Cursor, Scratch)) {
1808 if (!HasValidControlBlock ||
1809 Implementation->readCXXMethodBlock(Cursor, Scratch)) {
1816 if (!HasValidControlBlock ||
1817 Implementation->readObjCSelectorBlock(Cursor, Scratch)) {
1824 if (!HasValidControlBlock ||
1825 Implementation->readGlobalVariableBlock(Cursor, Scratch)) {
1832 if (!HasValidControlBlock ||
1833 Implementation->readGlobalFunctionBlock(Cursor, Scratch)) {
1840 if (!HasValidControlBlock ||
1841 Implementation->readEnumConstantBlock(Cursor, Scratch)) {
1848 if (!HasValidControlBlock ||
1849 Implementation->readTagBlock(Cursor, Scratch)) {
1856 if (!HasValidControlBlock ||
1857 Implementation->readTypedefBlock(Cursor, Scratch)) {
1866 if (
Cursor.SkipBlock()) {
1874 if (!
Cursor.AtEndOfStream()) {
1882std::unique_ptr<APINotesReader>
1884 llvm::VersionTuple SwiftVersion) {
1885 bool Failed =
false;
1886 std::unique_ptr<APINotesReader> Reader(
1887 new APINotesReader(InputBuffer.release(), SwiftVersion, Failed));
1894template <
typename T>
1896 llvm::VersionTuple Version,
1898 : Results(
std::move(R)) {
1900 assert(!Results.empty());
1901 assert(std::is_sorted(
1902 Results.begin(), Results.end(),
1903 [](
const std::pair<llvm::VersionTuple, T> &left,
1904 const std::pair<llvm::VersionTuple, T> &right) ->
bool {
1905 assert(left.first != right.first &&
"two entries for the same version");
1906 return left.first < right.first;
1909 Selected = std::nullopt;
1910 for (
unsigned i = 0, n = Results.size(); i != n; ++i) {
1911 if (!Version.empty() && Results[i].first >= Version) {
1923 if (!Selected && Results[0].first.empty())
1928 -> std::optional<ContextID> {
1930 return std::nullopt;
1934 return std::nullopt;
1941 return std::nullopt;
1949 return std::nullopt;
1953 return std::nullopt;
1957 return std::nullopt;
1963 -> std::optional<ContextID> {
1965 return std::nullopt;
1969 return std::nullopt;
1976 return std::nullopt;
1984 return std::nullopt;
1988 return std::nullopt;
1992 return std::nullopt;
2001 return std::nullopt;
2005 return std::nullopt;
2008 std::make_tuple(CtxID.Value, *PropertyID, (
char)IsInstance));
2010 return std::nullopt;
2016 bool IsInstanceMethod)
2019 return std::nullopt;
2023 return std::nullopt;
2026 ObjCMethodTableInfo::internal_key_type{CtxID.Value, *SelID,
2029 return std::nullopt;
2037 return std::nullopt;
2041 return std::nullopt;
2046 return std::nullopt;
2052 std::optional<Context> Ctx)
2055 return std::nullopt;
2059 return std::nullopt;
2065 return std::nullopt;
2071 std::optional<Context> Ctx)
2074 return std::nullopt;
2078 return std::nullopt;
2084 return std::nullopt;
2092 return std::nullopt;
2096 return std::nullopt;
2100 return std::nullopt;
2106 std::optional<Context> ParentCtx)
2107 -> std::optional<ContextID> {
2109 return std::nullopt;
2113 return std::nullopt;
2118 return std::nullopt;
2126 return std::nullopt;
2130 return std::nullopt;
2136 return std::nullopt;
2142 std::optional<Context> Ctx)
2145 return std::nullopt;
2149 return std::nullopt;
2155 return std::nullopt;
2161 llvm::StringRef Name, std::optional<ContextID> ParentNamespaceID)
2162 -> std::optional<ContextID> {
2164 return std::nullopt;
2168 return std::nullopt;
2170 uint32_t RawParentNamespaceID =
2171 ParentNamespaceID ? ParentNamespaceID->Value : -1;
2175 return std::nullopt;
static StringRef getIdentifier(const Token &Tok)
Implements an efficient mapping from strings to IdentifierInfo nodes.
iterator find(StringRef Name) const
Smart pointer class that efficiently represents Objective-C method names.
llvm::OnDiskIterableChainedHashTable< GlobalVariableTableInfo > SerializedGlobalVariableTable
std::unique_ptr< SerializedContextIDTable > ContextIDTable
The Objective-C / C++ context ID table.
bool readEnumConstantBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
std::string ModuleName
The name of the module that we read from the control block.
std::optional< std::pair< off_t, time_t > > SourceFileSizeAndModTime
std::unique_ptr< SerializedIdentifierTable > IdentifierTable
The identifier table.
llvm::OnDiskIterableChainedHashTable< TagTableInfo > SerializedTagTable
std::unique_ptr< SerializedGlobalFunctionTable > GlobalFunctionTable
The global function table.
std::unique_ptr< SerializedObjCPropertyTable > ObjCPropertyTable
The Objective-C property table.
bool readObjCMethodBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
std::unique_ptr< SerializedGlobalVariableTable > GlobalVariableTable
The global variable table.
bool readTagBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
std::unique_ptr< SerializedTypedefTable > TypedefTable
The typedef table.
llvm::OnDiskIterableChainedHashTable< ObjCSelectorTableInfo > SerializedObjCSelectorTable
bool readGlobalFunctionBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
bool readTypedefBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
llvm::MemoryBuffer * InputBuffer
The input buffer for the API notes data.
std::unique_ptr< SerializedObjCSelectorTable > ObjCSelectorTable
The Objective-C selector table.
bool readControlBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
std::unique_ptr< SerializedCXXMethodTable > CXXMethodTable
The C++ method table.
bool readObjCPropertyBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
bool readObjCSelectorBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
llvm::OnDiskIterableChainedHashTable< IdentifierTableInfo > SerializedIdentifierTable
std::unique_ptr< SerializedEnumConstantTable > EnumConstantTable
The enumerator table.
std::optional< IdentifierID > getIdentifier(llvm::StringRef Str)
Retrieve the identifier ID for the given string, or an empty optional if the string is unknown.
bool readGlobalVariableBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
llvm::OnDiskIterableChainedHashTable< ObjCPropertyTableInfo > SerializedObjCPropertyTable
std::unique_ptr< SerializedTagTable > TagTable
The tag table.
llvm::OnDiskIterableChainedHashTable< CXXMethodTableInfo > SerializedCXXMethodTable
std::optional< SelectorID > getSelector(ObjCSelectorRef Selector)
Retrieve the selector ID for the given selector, or an empty optional if the string is unknown.
llvm::OnDiskIterableChainedHashTable< ObjCMethodTableInfo > SerializedObjCMethodTable
bool readCXXMethodBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
bool readIdentifierBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
llvm::VersionTuple SwiftVersion
The Swift version to use for filtering.
bool readContextBlock(llvm::BitstreamCursor &Cursor, llvm::SmallVectorImpl< uint64_t > &Scratch)
llvm::OnDiskIterableChainedHashTable< EnumConstantTableInfo > SerializedEnumConstantTable
std::unique_ptr< SerializedObjCMethodTable > ObjCMethodTable
The Objective-C method table.
std::unique_ptr< SerializedContextInfoTable > ContextInfoTable
The Objective-C context info table.
llvm::OnDiskIterableChainedHashTable< TypedefTableInfo > SerializedTypedefTable
llvm::OnDiskIterableChainedHashTable< GlobalFunctionTableInfo > SerializedGlobalFunctionTable
llvm::OnDiskIterableChainedHashTable< ContextInfoTableInfo > SerializedContextInfoTable
llvm::OnDiskIterableChainedHashTable< ContextIDTableInfo > SerializedContextIDTable
Captures the completed versioned information for a particular part of API notes, including both unver...
VersionedInfo(std::nullopt_t)
Form an empty set of versioned information.
A class that reads API notes data from a binary file that was written by the APINotesWriter.
VersionedInfo< ContextInfo > lookupObjCClassInfo(llvm::StringRef Name)
Look for information regarding the given Objective-C class.
VersionedInfo< CXXMethodInfo > lookupCXXMethod(ContextID CtxID, llvm::StringRef Name)
Look for information regarding the given C++ method in the given C++ tag context.
VersionedInfo< TagInfo > lookupTag(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given tag (struct/union/enum/C++ class).
VersionedInfo< GlobalFunctionInfo > lookupGlobalFunction(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given global function.
VersionedInfo< ObjCPropertyInfo > lookupObjCProperty(ContextID CtxID, llvm::StringRef Name, bool IsInstance)
Look for information regarding the given Objective-C property in the given context.
VersionedInfo< ObjCMethodInfo > lookupObjCMethod(ContextID CtxID, ObjCSelectorRef Selector, bool IsInstanceMethod)
Look for information regarding the given Objective-C method in the given context.
VersionedInfo< GlobalVariableInfo > lookupGlobalVariable(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given global variable.
std::optional< ContextID > lookupNamespaceID(llvm::StringRef Name, std::optional< ContextID > ParentNamespaceID=std::nullopt)
Look for the context ID of the given C++ namespace.
std::optional< ContextID > lookupTagID(llvm::StringRef Name, std::optional< Context > ParentCtx=std::nullopt)
Look for the context ID of the given C++ tag.
VersionedInfo< TypedefInfo > lookupTypedef(llvm::StringRef Name, std::optional< Context > Ctx=std::nullopt)
Look for information regarding the given typedef.
std::optional< ContextID > lookupObjCClassID(llvm::StringRef Name)
Look for the context ID of the given Objective-C class.
static std::unique_ptr< APINotesReader > Create(std::unique_ptr< llvm::MemoryBuffer > InputBuffer, llvm::VersionTuple SwiftVersion)
Create a new API notes reader from the given member buffer, which contains the contents of a binary A...
VersionedInfo< ContextInfo > lookupObjCProtocolInfo(llvm::StringRef Name)
Look for information regarding the given Objective-C protocol.
std::optional< ContextID > lookupObjCProtocolID(llvm::StringRef Name)
Look for the context ID of the given Objective-C protocol.
VersionedInfo< EnumConstantInfo > lookupEnumConstant(llvm::StringRef Name)
Look for information regarding the given enumerator.
Opaque context ID used to refer to an Objective-C class or protocol or a C++ namespace.
llvm::PointerEmbeddedInt< unsigned, 31 > SelectorID
const uint8_t kSwiftCopyable
RetainCountConventionKind
llvm::PointerEmbeddedInt< unsigned, 31 > IdentifierID
SwiftNewTypeKind
The kind of a swift_wrapper/swift_newtype.
const uint8_t kSwiftNonCopyable
EnumExtensibilityKind
The payload for an enum_extensibility attribute.
const uint16_t VERSION_MAJOR
API notes file major version number.
const unsigned char API_NOTES_SIGNATURE[]
Magic number for API notes files.
const uint16_t VERSION_MINOR
API notes file minor version number.
@ OBJC_CONTEXT_BLOCK_ID
The Objective-C context data block, which contains information about Objective-C classes and protocol...
@ TYPEDEF_BLOCK_ID
The typedef data block, which maps typedef names to information about the typedefs.
@ OBJC_PROPERTY_BLOCK_ID
The Objective-C property data block, which maps Objective-C (class name, property name) pairs to info...
@ ENUM_CONSTANT_BLOCK_ID
The enum constant data block, which maps enumerator names to information about the enumerators.
@ TAG_BLOCK_ID
The tag data block, which maps tag names to information about the tags.
@ OBJC_METHOD_BLOCK_ID
The Objective-C property data block, which maps Objective-C (class name, selector,...
@ OBJC_SELECTOR_BLOCK_ID
The Objective-C selector data block, which maps Objective-C selector names (# of pieces,...
@ CXX_METHOD_BLOCK_ID
The C++ method data block, which maps C++ (context id, method name) pairs to information about the me...
@ GLOBAL_FUNCTION_BLOCK_ID
The (global) functions data block, which maps global function names to information about the global f...
@ CONTROL_BLOCK_ID
The control block, which contains all of the information that needs to be validated prior to committi...
@ IDENTIFIER_BLOCK_ID
The identifier data block, which maps identifier strings to IDs.
@ GLOBAL_VARIABLE_BLOCK_ID
The global variables data block, which maps global variable names to information about the global var...
unsigned ComputeHash(Selector Sel)
The JSON file list parser is used to communicate input to InstallAPI.
NullabilityKind
Describes the nullability of a particular type.
@ Result
The result type of a method or function.
hash_code hash_value(const clang::tooling::dependencies::ModuleID &ID)
A stored Objective-C or C++ context, represented by the ID of its parent context, the kind of this co...
A temporary reference to an Objective-C selector, suitable for referencing selector data on the stack...
A stored Objective-C or C++ declaration, represented by the ID of its parent context,...
A stored Objective-C selector.
llvm::SmallVector< IdentifierID, 2 > Identifiers