clang: include/clang/Basic/IdentifierTable.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15#ifndef LLVM_CLANG_BASIC_IDENTIFIERTABLE_H

16#define LLVM_CLANG_BASIC_IDENTIFIERTABLE_H

17

22#include "llvm/ADT/DenseMapInfo.h"

23#include "llvm/ADT/FoldingSet.h"

24#include "llvm/ADT/PointerIntPair.h"

25#include "llvm/ADT/PointerUnion.h"

26#include "llvm/ADT/SmallString.h"

27#include "llvm/ADT/StringMap.h"

28#include "llvm/ADT/StringRef.h"

29#include "llvm/Support/Allocator.h"

30#include "llvm/Support/PointerLikeTypeTraits.h"

31#include "llvm/Support/type_traits.h"

32#include

33#include

34#include

35#include

36#include

37#include

38

40

41class DeclarationName;

42class DeclarationNameTable;

43class IdentifierInfo;

44class LangOptions;

45class MultiKeywordSelector;

46class SourceLocation;

47

55};

56

61};

62

63

64

65

68}

69

70

71

72

77}

78

79

81

82

83

84

86

88

89

90

91

92

93

95#define OBJC_AT_KEYWORD(X) objc_##X,

96#include "clang/Basic/TokenKinds.def"

98

99#define NOTABLE_IDENTIFIER(X) X,

100#include "clang/Basic/TokenKinds.def"

102

104#define BUILTIN(ID, TYPE, ATTRS) BI##ID,

105#include "clang/Basic/Builtins.inc"

107

109};

110

111

112

113

114

115

116

119

120

122 unsigned TokenID : 9;

123

126

127

128 LLVM_PREFERRED_TYPE(bool)

129 unsigned HasMacro : 1;

130

131

132 LLVM_PREFERRED_TYPE(bool)

133 unsigned HadMacro : 1;

134

135

136 LLVM_PREFERRED_TYPE(bool)

137 unsigned IsExtension : 1;

138

139

140 LLVM_PREFERRED_TYPE(bool)

141 unsigned IsFutureCompatKeyword : 1;

142

143

144 LLVM_PREFERRED_TYPE(bool)

145 unsigned IsPoisoned : 1;

146

147

148 LLVM_PREFERRED_TYPE(bool)

149 unsigned IsCPPOperatorKeyword : 1;

150

151

152

153 LLVM_PREFERRED_TYPE(bool)

154 unsigned NeedsHandleIdentifier : 1;

155

156

157 LLVM_PREFERRED_TYPE(bool)

158 unsigned IsFromAST : 1;

159

160

161

162 LLVM_PREFERRED_TYPE(bool)

163 unsigned ChangedAfterLoad : 1;

164

165

166

167 LLVM_PREFERRED_TYPE(bool)

168 unsigned FEChangedAfterLoad : 1;

169

170

171 LLVM_PREFERRED_TYPE(bool)

172 unsigned RevertedTokenID : 1;

173

174

175

176 LLVM_PREFERRED_TYPE(bool)

177 unsigned OutOfDate : 1;

178

179

180 LLVM_PREFERRED_TYPE(bool)

181 unsigned IsModulesImport : 1;

182

183

184 LLVM_PREFERRED_TYPE(bool)

185 unsigned IsMangledOpenMPVariantName : 1;

186

187

188 LLVM_PREFERRED_TYPE(bool)

189 unsigned IsDeprecatedMacro : 1;

190

191

192 LLVM_PREFERRED_TYPE(bool)

193 unsigned IsRestrictExpansion : 1;

194

195

196 LLVM_PREFERRED_TYPE(bool)

197 unsigned IsFinal : 1;

198

199

200

201

202 void *FETokenInfo = nullptr;

203

204 llvm::StringMapEntry<IdentifierInfo *> *Entry = nullptr;

205

207 : TokenID(tok::identifier),

208 InterestingIdentifierID(llvm::to_underlying(

211 IsFutureCompatKeyword(false), IsPoisoned(false),

212 IsCPPOperatorKeyword(false), NeedsHandleIdentifier(false),

213 IsFromAST(false), ChangedAfterLoad(false), FEChangedAfterLoad(false),

214 RevertedTokenID(false), OutOfDate(false), IsModulesImport(false),

215 IsMangledOpenMPVariantName(false), IsDeprecatedMacro(false),

216 IsRestrictExpansion(false), IsFinal(false) {}

217

218public:

223

224

225

226

227 template <std::size_t StrLen>

228 bool isStr(const char (&Str)[StrLen]) const {

229 return getLength() == StrLen-1 &&

230 memcmp(getNameStart(), Str, StrLen-1) == 0;

231 }

232

233

234 bool isStr(llvm::StringRef Str) const {

235 llvm::StringRef ThisStr(getNameStart(), getLength());

236 return ThisStr == Str;

237 }

238

239

240

241 const char *getNameStart() const { return Entry->getKeyData(); }

242

243

244 unsigned getLength() const { return Entry->getKeyLength(); }

245

246

248 return StringRef(getNameStart(), getLength());

249 }

250

251

252

254 return HasMacro;

255 }

257 if (HasMacro == Val) return;

258

259 HasMacro = Val;

260 if (Val) {

261 NeedsHandleIdentifier = true;

262 HadMacro = true;

263 } else {

264

265

266 if (!IsFinal) {

267

268

269 IsDeprecatedMacro = false;

270 IsRestrictExpansion = false;

271 }

272 RecomputeNeedsHandleIdentifier();

273 }

274 }

275

276

277

279 return HadMacro;

280 }

281

283

285 if (IsDeprecatedMacro == Val)

286 return;

287 IsDeprecatedMacro = Val;

288 if (Val)

289 NeedsHandleIdentifier = true;

290 else

291 RecomputeNeedsHandleIdentifier();

292 }

293

295

297 if (IsRestrictExpansion == Val)

298 return;

299 IsRestrictExpansion = Val;

300 if (Val)

301 NeedsHandleIdentifier = true;

302 else

303 RecomputeNeedsHandleIdentifier();

304 }

305

306 bool isFinal() const { return IsFinal; }

307

309

310

311

312

314

315

317

318

319

320

321

322

323

325 assert(TokenID != tok::identifier && "Already at tok::identifier");

326 TokenID = tok::identifier;

327 RevertedTokenID = true;

328 }

330 assert(TokenID == tok::identifier && "Should be at tok::identifier");

331 TokenID = TK;

332 RevertedTokenID = false;

333 }

334

335

336

337

339

340

341

342

344 assert(0 == llvm::to_underlying(InterestingIdentifier::objc_not_keyword));

346 if (Value < InterestingIdentifier::NUM_OBJC_KEYWORDS)

348 return tok::objc_not_keyword;

349 }

351 assert(0 == llvm::to_underlying(InterestingIdentifier::objc_not_keyword));

352 InterestingIdentifierID = ID;

353 assert(getObjCKeywordID() == ID && "ID too large for field!");

354 }

355

356

360 InterestingIdentifier::NUM_OBJC_KEYWORDS_AND_NOTABLE_IDENTIFIERS &&

361 Value != InterestingIdentifier::NotInterestingIdentifier) {

362 auto FirstBuiltin =

363 llvm::to_underlying(InterestingIdentifier::NotBuiltin);

364 return static_cast<Builtin::ID>(InterestingIdentifierID - FirstBuiltin);

365 }

366 return Builtin::ID::NotBuiltin;

367 }

369 assert(ID != Builtin::ID::NotBuiltin);

370 auto FirstBuiltin = llvm::to_underlying(InterestingIdentifier::NotBuiltin);

371 InterestingIdentifierID = ID + FirstBuiltin;

372 assert(getBuiltinID() == ID && "ID too large for field!");

373 }

375 InterestingIdentifierID =

376 llvm::to_underlying(InterestingIdentifier::NotInterestingIdentifier);

377 }

378

381 if (Value > InterestingIdentifier::NUM_OBJC_KEYWORDS &&

383 InterestingIdentifier::NUM_OBJC_KEYWORDS_AND_NOTABLE_IDENTIFIERS) {

384 auto FirstNotableIdentifier =

385 1 + llvm::to_underlying(InterestingIdentifier::NUM_OBJC_KEYWORDS);

387 FirstNotableIdentifier);

388 }

389 return tok::not_notable;

390 }

392 assert(ID != tok::not_notable);

393 auto FirstNotableIdentifier =

394 1 + llvm::to_underlying(InterestingIdentifier::NUM_OBJC_KEYWORDS);

395 InterestingIdentifierID = ID + FirstNotableIdentifier;

396 assert(getNotableIdentifierID() == ID && "ID too large for field!");

397 }

398

401

402

403

404

407 IsExtension = Val;

408 if (Val)

409 NeedsHandleIdentifier = true;

410 else

411 RecomputeNeedsHandleIdentifier();

412 }

413

414

415

416

417

418

421 IsFutureCompatKeyword = Val;

422 if (Val)

423 NeedsHandleIdentifier = true;

424 else

425 RecomputeNeedsHandleIdentifier();

426 }

427

428

429

431 IsPoisoned = Value;

433 NeedsHandleIdentifier = true;

434 else

435 RecomputeNeedsHandleIdentifier();

436 }

437

438

440

441

442

444 IsCPPOperatorKeyword = Val;

445 }

447

448

449 bool isKeyword(const LangOptions &LangOpts) const;

450

451

452

453 bool isCPlusPlusKeyword(const LangOptions &LangOpts) const;

454

455

456

459

460

461

462

463

464

466

467

468

470

472

473

474

476 return ChangedAfterLoad;

477 }

478

479

480

482 ChangedAfterLoad = true;

483 }

484

485

486

488 return FEChangedAfterLoad;

489 }

490

491

492

494 FEChangedAfterLoad = true;

495 }

496

497

498

500

501

502

504 OutOfDate = OOD;

505 if (OOD)

506 NeedsHandleIdentifier = true;

507 else

508 RecomputeNeedsHandleIdentifier();

509 }

510

511

513

514

516 IsModulesImport = I;

517 if (I)

518 NeedsHandleIdentifier = true;

519 else

520 RecomputeNeedsHandleIdentifier();

521 }

522

523

525

526

528

529

530

531

532

533

534

535

536

537

539 return getName().starts_with("<#") && getName().ends_with("#>");

540 }

541

542

543

545

546

547

549

550

551

552 StringRef deuglifiedName() const;

554 return getLength() == 1 && getNameStart()[0] == '_';

555 }

556

557

560 }

561

562private:

563

564

565

566

567

568

569 void RecomputeNeedsHandleIdentifier() {

570 NeedsHandleIdentifier = isPoisoned() || hasMacroDefinition() ||

571 isExtensionToken() || isFutureCompatKeyword() ||

572 isOutOfDate() || isModulesImport();

573 }

574};

575

576

577

578

579

582 const bool OldValue;

583

584public:

586 : II(II), OldValue(II ? II->isPoisoned() : false) {

587 if(II)

589 }

590

592 if(II)

594 }

595};

596

597

598

599

600

601

602

603

604

605

606

608protected:

610

611public:

614

616

617

618

619

620

621

622 virtual StringRef Next() = 0;

623};

624

625

627public:

629

630

631

632

633

634

636

637

638

639

640

641

642

643

644

645

646

648};

649

650

651

652

653

654

656

657

658 using HashTableTy = llvm::StringMap<IdentifierInfo *, llvm::BumpPtrAllocator>;

659 HashTableTy HashTable;

660

662

663public:

664

666

667

668

671

672

674 ExternalLookup = IILookup;

675 }

676

677

679 return ExternalLookup;

680 }

681

683 return HashTable.getAllocator();

684 }

685

686

687

689 auto &Entry = *HashTable.try_emplace(Name, nullptr).first;

690

692 if (II) return *II;

693

694

695 if (ExternalLookup) {

696 II = ExternalLookup->get(Name);

697 if (II)

698 return *II;

699 }

700

701

702 void *Mem = getAllocator().Allocate<IdentifierInfo>();

704

705

706

707 II->Entry = &Entry;

708

709 return *II;

710 }

711

714 II.TokenID = TokenCode;

715 assert(II.TokenID == (unsigned) TokenCode && "TokenCode too large");

716 return II;

717 }

718

719

720

721

722

723

724

726 auto &Entry = *HashTable.insert(std::make_pair(Name, nullptr)).first;

727

729 if (II)

730 return *II;

731

732

733 void *Mem = getAllocator().Allocate<IdentifierInfo>();

735

736

737

738 II->Entry = &Entry;

739

740

741 if (Name == "import")

743

744 return *II;

745 }

746

747 using iterator = HashTableTy::const_iterator;

749

752 unsigned size() const { return HashTable.size(); }

753

754 iterator find(StringRef Name) const { return HashTable.find(Name); }

755

756

757

758 void PrintStats() const;

759

760

761

762 void AddKeywords(const LangOptions &LangOpts);

763

764

765

766

769};

770

771

772

773

774

775

776

777

778

779

780

781

782

783

784

785

786

787

789

791

792

793

794

795

801

802

803

812

813

816

817

818

820

821

823

824

825

826

827

836

842

843namespace detail {

844

845

846

847

848

849

850

851

852

856

857protected:

858

859

860

861

862

867 ObjCMultiArgSelector

869

870

871

872

873

874

875

876

877

878

879

881

884 : ExtraKindOrNumArgs(ObjCMultiArgSelector + NumArgs) {}

885

886

888 return static_cast<ExtraKind>(ExtraKindOrNumArgs >

889 (unsigned)ObjCMultiArgSelector

890 ? (unsigned)ObjCMultiArgSelector

891 : ExtraKindOrNumArgs);

892 }

893

894

895

897 assert(ExtraKindOrNumArgs >= (unsigned)ObjCMultiArgSelector &&

898 "getNumArgs called but this is not an ObjC selector!");

899 return ExtraKindOrNumArgs - (unsigned)ObjCMultiArgSelector;

900 }

901};

902

903}

904

905

906

907

908

911 public llvm::FoldingSetNode {

913

914public:

915

917 : DeclarationNameExtra(nKeys) {

918 assert((nKeys > 1) && "not a multi-keyword selector");

919

920

923 for (unsigned i = 0; i != nKeys; ++i)

924 KeyInfo[i] = IIV[i];

925 }

926

927

928 std::string getName() const;

929

930 using DeclarationNameExtra::getNumArgs;

931

933

936 }

937

939 return keyword_begin() + getNumArgs();

940 }

941

943 assert(i < getNumArgs() && "getIdentifierInfoForSlot(): illegal index");

944 return keyword_begin()[i];

945 }

946

948 unsigned NumArgs) {

949 ID.AddInteger(NumArgs);

950 for (unsigned i = 0; i != NumArgs; ++i)

951 ID.AddPointer(ArgTys[i]);

952 }

953

955 Profile(ID, keyword_begin(), getNumArgs());

956 }

957};

958

959

960

961

962

963

964

965

968 friend class SelectorTable;

970

971 enum IdentifierInfoFlag {

972

973

974 ZeroArg = 0x01,

975 OneArg = 0x02,

976

977

978 MultiArg = 0x07,

979 };

980

981

982

983

984

985

986

987

988

989

990

991

992

993

994 llvm::PointerIntPair<

995 llvm::PointerUnion<const IdentifierInfo *, MultiKeywordSelector *>, 2>

996 InfoPtr;

997

999 assert(nArgs < 2 && "nArgs not equal to 0/1");

1000 InfoPtr.setPointerAndInt(II, nArgs + 1);

1001 }

1002

1003 Selector(MultiKeywordSelector *SI) {

1004

1005

1006

1007 InfoPtr.setPointerAndInt(SI, MultiArg & 0b11);

1008 }

1009

1010 const IdentifierInfo *getAsIdentifierInfo() const {

1011 return InfoPtr.getPointer().dyn_cast<const IdentifierInfo *>();

1012 }

1013

1014 MultiKeywordSelector *getMultiKeywordSelector() const {

1015 return cast<MultiKeywordSelector *>(InfoPtr.getPointer());

1016 }

1017

1018 unsigned getIdentifierInfoFlag() const {

1019 unsigned new_flags = InfoPtr.getInt();

1020

1021

1022

1023 if (isa<MultiKeywordSelector *>(InfoPtr.getPointer()))

1024 new_flags |= MultiArg;

1025 return new_flags;

1026 }

1027

1029

1031

1032public:

1033

1034

1037 InfoPtr.setFromOpaqueValue(reinterpret_cast<void *>(V));

1038 }

1039

1040

1042 return InfoPtr.getOpaqueValue() == RHS.InfoPtr.getOpaqueValue();

1043 }

1045 return InfoPtr.getOpaqueValue() != RHS.InfoPtr.getOpaqueValue();

1046 }

1047

1049

1050

1051 bool isNull() const { return InfoPtr.getOpaqueValue() == nullptr; }

1052

1053

1055

1057

1058

1060

1061

1062 bool isUnarySelector(StringRef Name) const;

1063

1064 unsigned getNumArgs() const;

1065

1066

1067

1068

1069

1070

1071

1072

1073

1074

1075

1076

1077

1078

1079 const IdentifierInfo *getIdentifierInfoForSlot(unsigned argIndex) const;

1080

1081

1082

1083

1084

1085

1086

1087

1088

1089 StringRef getNameForSlot(unsigned argIndex) const;

1090

1091

1092

1094

1095

1096 void print(llvm::raw_ostream &OS) const;

1097

1098 void dump() const;

1099

1100

1102 return getMethodFamilyImpl(*this);

1103 }

1104

1106 return getStringFormatFamilyImpl(*this);

1107 }

1108

1111 }

1112

1115 }

1116

1118};

1119

1120

1121

1123

1124 void *Impl;

1125

1126public:

1131

1132

1133

1134

1135

1137

1140 }

1141

1144 }

1145

1146

1147 size_t getTotalMemory() const;

1148

1149

1150

1151

1152

1153 static SmallString<64> constructSetterName(StringRef Name);

1154

1155

1156

1157

1158

1162

1163

1164 static std::string getPropertyNameFromSetterSelector(Selector Sel);

1165};

1166

1167}

1168

1169namespace llvm {

1170

1171

1172

1173template <>

1174struct DenseMapInfo<clang::Selector> {

1177 }

1178

1181 }

1182

1184

1186 return LHS == RHS;

1187 }

1188};

1189

1190template<>

1193 return P.getAsOpaquePtr();

1194 }

1195

1198 }

1199

1200 static constexpr int NumLowBitsAvailable = 0;

1201};

1202

1203}

1204

1205#endif

Defines enum values for all the target-independent builtin functions.

enum clang::sema::@1725::IndirectLocalPathEntry::EntryKind Kind

static void dump(llvm::raw_ostream &OS, StringRef FunctionName, ArrayRef< CounterExpression > Expressions, ArrayRef< CounterMappingRegion > Regions)

Defines the Diagnostic IDs-related interfaces.

static void print(llvm::raw_ostream &OS, const T &V, ASTContext &ASTCtx, QualType Ty)

Forward-declares and imports various common LLVM datatypes that clang wants to use unqualified.

static std::string getName(const CallEvent &Call)

Defines the clang::TokenKind enum and support functions.

The name of a declaration.

A little helper class (which is basically a smart pointer that forwards info from DiagnosticsEngine a...

Provides lookups to, and iteration over, IdentiferInfo objects.

virtual ~IdentifierInfoLookup()

virtual IdentifierInfo * get(StringRef Name)=0

Return the IdentifierInfo for the specified named identifier.

One of these records is kept for each identifier that is lexed.

bool isHandleIdentifierCase() const

Return true if the Preprocessor::HandleIdentifier must be called on a token of this identifier.

IdentifierInfo(const IdentifierInfo &)=delete

IdentifierInfo(IdentifierInfo &&)=delete

bool isModulesImport() const

Determine whether this is the contextual keyword import.

void revertIdentifierToTokenID(tok::TokenKind TK)

unsigned getLength() const

Efficiently return the length of this identifier info.

unsigned getBuiltinID() const

Return a value indicating whether this is a builtin function.

void setModulesImport(bool I)

Set whether this identifier is the contextual keyword import.

void setNotableIdentifierID(unsigned ID)

void setIsExtensionToken(bool Val)

void setIsRestrictExpansion(bool Val)

void setFETokenInfo(void *T)

bool hasChangedSinceDeserialization() const

Determine whether this identifier has changed since it was loaded from an AST file.

bool isCPlusPlusOperatorKeyword() const

IdentifierInfo & operator=(const IdentifierInfo &)=delete

void setIsDeprecatedMacro(bool Val)

bool hasFETokenInfoChangedSinceDeserialization() const

Determine whether the frontend token information for this identifier has changed since it was loaded ...

void setMangledOpenMPVariantName(bool I)

Set whether this is the mangled name of an OpenMP variant.

tok::TokenKind getTokenID() const

If this is a source-language token (e.g.

bool hadMacroDefinition() const

Returns true if this identifier was #defined to some value at any moment.

void setIsPoisoned(bool Value=true)

setIsPoisoned - Mark this identifier as poisoned.

void setObjCKeywordID(tok::ObjCKeywordKind ID)

void setIsFinal(bool Val)

IdentifierInfo & operator=(IdentifierInfo &&)=delete

bool hasMacroDefinition() const

Return true if this identifier is #defined to some other value.

bool isFromAST() const

Return true if the identifier in its current state was loaded from an AST file.

bool isPoisoned() const

Return true if this token has been poisoned.

bool hasRevertedTokenIDToIdentifier() const

True if revertTokenIDToIdentifier() was called.

const char * getNameStart() const

Return the beginning of the actual null-terminated string for this identifier.

tok::NotableIdentifierKind getNotableIdentifierID() const

bool isMangledOpenMPVariantName() const

Determine whether this is the mangled name of an OpenMP variant.

void setOutOfDate(bool OOD)

Set whether the information for this identifier is out of date with respect to the external source.

void setHasMacroDefinition(bool Val)

bool isStr(llvm::StringRef Str) const

Return true if this is the identifier for the specified StringRef.

unsigned getObjCOrBuiltinID() const

tok::ObjCKeywordKind getObjCKeywordID() const

Return the Objective-C keyword ID for the this identifier.

void setObjCOrBuiltinID(unsigned ID)

bool isStr(const char(&Str)[StrLen]) const

Return true if this is the identifier for the specified string.

bool isEditorPlaceholder() const

Return true if this identifier is an editor placeholder.

void setIsCPlusPlusOperatorKeyword(bool Val=true)

isCPlusPlusOperatorKeyword/setIsCPlusPlusOperatorKeyword controls whether this identifier is a C++ al...

void setBuiltinID(unsigned ID)

void setFETokenInfoChangedSinceDeserialization()

Note that the frontend token information for this identifier has changed since it was loaded from an ...

bool operator<(const IdentifierInfo &RHS) const

Provide less than operator for lexicographical sorting.

void revertTokenIDToIdentifier()

Revert TokenID to tok::identifier; used for GNU libstdc++ 4.2 compatibility.

bool isDeprecatedMacro() const

bool isOutOfDate() const

Determine whether the information for this identifier is out of date with respect to the external sou...

void setIsFutureCompatKeyword(bool Val)

void setChangedSinceDeserialization()

Note that this identifier has changed since it was loaded from an AST file.

void * getFETokenInfo() const

Get and set FETokenInfo.

bool isPlaceholder() const

StringRef getName() const

Return the actual identifier string.

bool isFutureCompatKeyword() const

is/setIsFutureCompatKeyword - Initialize information about whether or not this language token is a ke...

bool isExtensionToken() const

get/setExtension - Initialize information about whether or not this language token is an extension.

bool isRestrictExpansion() const

An iterator that walks over all of the known identifiers in the lookup table.

virtual StringRef Next()=0

Retrieve the next string in the identifier table and advances the iterator for the following string.

IdentifierIterator & operator=(const IdentifierIterator &)=delete

IdentifierIterator(const IdentifierIterator &)=delete

virtual ~IdentifierIterator()

IdentifierIterator()=default

Implements an efficient mapping from strings to IdentifierInfo nodes.

IdentifierInfo & getOwn(StringRef Name)

Gets an IdentifierInfo for the given name without consulting external sources.

iterator find(StringRef Name) const

IdentifierInfo & get(StringRef Name)

Return the identifier token info for the specified named identifier.

IdentifierInfo & get(StringRef Name, tok::TokenKind TokenCode)

IdentifierInfoLookup * getExternalIdentifierLookup() const

Retrieve the external identifier lookup object, if any.

HashTableTy::const_iterator iterator

HashTableTy::const_iterator const_iterator

llvm::BumpPtrAllocator & getAllocator()

void setExternalIdentifierLookup(IdentifierInfoLookup *IILookup)

Set the external identifier lookup mechanism.

Keeps track of the various options that can be enabled, which controls the dialect of C or C++ that i...

One of these variable length records is kept for each selector containing more than one keyword.

keyword_iterator keyword_end() const

const IdentifierInfo *const * keyword_iterator

MultiKeywordSelector(unsigned nKeys, const IdentifierInfo **IIV)

void Profile(llvm::FoldingSetNodeID &ID)

static void Profile(llvm::FoldingSetNodeID &ID, keyword_iterator ArgTys, unsigned NumArgs)

keyword_iterator keyword_begin() const

const IdentifierInfo * getIdentifierInfoForSlot(unsigned i) const

An RAII object for [un]poisoning an identifier within a scope.

~PoisonIdentifierRAIIObject()

PoisonIdentifierRAIIObject(IdentifierInfo *II, bool NewValue)

This table allows us to fully hide how we implement multi-keyword caching.

SelectorTable(const SelectorTable &)=delete

Selector getNullarySelector(const IdentifierInfo *ID)

Selector getUnarySelector(const IdentifierInfo *ID)

SelectorTable & operator=(const SelectorTable &)=delete

Smart pointer class that efficiently represents Objective-C method names.

Selector()=default

The default ctor should only be used when creating data structures that will contain selectors.

static Selector getEmptyMarker()

static Selector getTombstoneMarker()

void * getAsOpaquePtr() const

bool isKeywordSelector() const

ObjCMethodFamily getMethodFamily() const

Derive the conventional family of this method.

bool operator==(Selector RHS) const

operator==/!= - Indicate whether the specified selectors are identical.

bool isUnarySelector() const

bool operator!=(Selector RHS) const

bool isNull() const

Determine whether this is the empty selector.

ObjCStringFormatFamily getStringFormatFamily() const

NotableIdentifierKind

Provides a namespace for notable identifers such as float_t and double_t.

ObjCKeywordKind

Provides a namespace for Objective-C keywords which start with an '@'.

TokenKind

Provides a simple uniform namespace for tokens from all C languages.

PPKeywordKind

Provides a namespace for preprocessor keywords which start with a '#' at the beginning of the line.

The JSON file list parser is used to communicate input to InstallAPI.

@ InvalidObjCMethodFamily

bool isReservedInAllContexts(ReservedIdentifierStatus Status)

Determine whether an identifier is reserved in all contexts.

InterestingIdentifier

The "layout" of InterestingIdentifier is:

@ NUM_OBJC_KEYWORDS_AND_NOTABLE_IDENTIFIERS

@ NotInterestingIdentifier

@ ObjCMethodFamilyBitWidth

ObjCMethodFamily

A family of Objective-C methods.

@ OMF_None

No particular method family.

ObjCInstanceTypeFamily

A family of Objective-C methods.

ReservedLiteralSuffixIdStatus

@ NotStartsWithUnderscore

static constexpr int InterestingIdentifierBits

const FunctionProtoType * T

bool isReservedAtGlobalScope(ReservedIdentifierStatus Status)

Determine whether an identifier is reserved for use as a name at global scope.

@ IdentifierInfoAlignment

llvm::StringRef getAsString(SyncScope S)

std::pair< IdentifierInfo *, SourceLocation > IdentifierLocPair

A simple pair of identifier info and location.

@ StartsWithDoubleUnderscore

@ StartsWithUnderscoreFollowedByCapitalLetter

@ ContainsDoubleUnderscore

@ StartsWithUnderscoreAtGlobalScope

@ StartsWithUnderscoreAndIsExternC

Diagnostic wrappers for TextAPI types for error reporting.

__UINTPTR_TYPE__ uintptr_t

An unsigned integer type with the property that any valid pointer to void can be converted to this ty...

static clang::Selector getEmptyKey()

static bool isEqual(clang::Selector LHS, clang::Selector RHS)

static clang::Selector getTombstoneKey()

static clang::Selector getFromVoidPointer(const void *P)

static const void * getAsVoidPointer(clang::Selector P)