IdentifierTable.cpp 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551
  1. //===--- IdentifierTable.cpp - Hash table for identifier lookup -----------===//
  2. //
  3. // The LLVM Compiler Infrastructure
  4. //
  5. // This file is distributed under the University of Illinois Open Source
  6. // License. See LICENSE.TXT for details.
  7. //
  8. //===----------------------------------------------------------------------===//
  9. //
  10. // This file implements the IdentifierInfo, IdentifierVisitor, and
  11. // IdentifierTable interfaces.
  12. //
  13. //===----------------------------------------------------------------------===//
  14. #include "clang/Basic/IdentifierTable.h"
  15. #include "clang/Basic/LangOptions.h"
  16. #include "llvm/ADT/FoldingSet.h"
  17. #include "llvm/ADT/DenseMap.h"
  18. #include "llvm/Bitcode/Serialize.h"
  19. #include "llvm/Bitcode/Deserialize.h"
  20. #include <cstdio>
  21. using namespace clang;
  22. //===----------------------------------------------------------------------===//
  23. // IdentifierInfo Implementation
  24. //===----------------------------------------------------------------------===//
  25. IdentifierInfo::IdentifierInfo() {
  26. TokenID = tok::identifier;
  27. ObjCOrBuiltinID = 0;
  28. HasMacro = false;
  29. IsExtension = false;
  30. IsPoisoned = false;
  31. IsCPPOperatorKeyword = false;
  32. NeedsHandleIdentifier = false;
  33. FETokenInfo = 0;
  34. Entry = 0;
  35. }
  36. //===----------------------------------------------------------------------===//
  37. // IdentifierTable Implementation
  38. //===----------------------------------------------------------------------===//
  39. IdentifierInfoLookup::~IdentifierInfoLookup() {}
  40. IdentifierTable::IdentifierTable(const LangOptions &LangOpts,
  41. IdentifierInfoLookup* externalLookup)
  42. : HashTable(8192), // Start with space for 8K identifiers.
  43. ExternalLookup(externalLookup) {
  44. // Populate the identifier table with info about keywords for the current
  45. // language.
  46. AddKeywords(LangOpts);
  47. }
  48. // This cstor is intended to be used only for serialization.
  49. IdentifierTable::IdentifierTable()
  50. : HashTable(8192), ExternalLookup(0) { }
  51. //===----------------------------------------------------------------------===//
  52. // Language Keyword Implementation
  53. //===----------------------------------------------------------------------===//
  54. /// AddKeyword - This method is used to associate a token ID with specific
  55. /// identifiers because they are language keywords. This causes the lexer to
  56. /// automatically map matching identifiers to specialized token codes.
  57. ///
  58. /// The C90/C99/CPP/CPP0x flags are set to 0 if the token should be
  59. /// enabled in the specified langauge, set to 1 if it is an extension
  60. /// in the specified language, and set to 2 if disabled in the
  61. /// specified language.
  62. static void AddKeyword(const char *Keyword, unsigned KWLen,
  63. tok::TokenKind TokenCode,
  64. int C90, int C99, int CXX, int CXX0x, int BoolSupport,
  65. const LangOptions &LangOpts, IdentifierTable &Table) {
  66. int Flags = 0;
  67. if (BoolSupport != 0) {
  68. Flags = LangOpts.CPlusPlus? 0 : LangOpts.Boolean ? BoolSupport : 2;
  69. } else if (LangOpts.CPlusPlus) {
  70. Flags = LangOpts.CPlusPlus0x ? CXX0x : CXX;
  71. } else if (LangOpts.C99) {
  72. Flags = C99;
  73. } else {
  74. Flags = C90;
  75. }
  76. // Don't add this keyword if disabled in this language or if an extension
  77. // and extensions are disabled.
  78. if (Flags + LangOpts.NoExtensions >= 2) return;
  79. IdentifierInfo &Info = Table.get(Keyword, Keyword+KWLen);
  80. Info.setTokenID(TokenCode);
  81. Info.setIsExtensionToken(Flags == 1);
  82. }
  83. static void AddAlias(const char *Keyword, unsigned KWLen,
  84. tok::TokenKind AliaseeID,
  85. const char *AliaseeKeyword, unsigned AliaseeKWLen,
  86. const LangOptions &LangOpts, IdentifierTable &Table) {
  87. IdentifierInfo &AliasInfo = Table.get(Keyword, Keyword+KWLen);
  88. IdentifierInfo &AliaseeInfo = Table.get(AliaseeKeyword,
  89. AliaseeKeyword+AliaseeKWLen);
  90. AliasInfo.setTokenID(AliaseeID);
  91. AliasInfo.setIsExtensionToken(AliaseeInfo.isExtensionToken());
  92. }
  93. /// AddCXXOperatorKeyword - Register a C++ operator keyword alternative
  94. /// representations.
  95. static void AddCXXOperatorKeyword(const char *Keyword, unsigned KWLen,
  96. tok::TokenKind TokenCode,
  97. IdentifierTable &Table) {
  98. IdentifierInfo &Info = Table.get(Keyword, Keyword + KWLen);
  99. Info.setTokenID(TokenCode);
  100. Info.setIsCPlusPlusOperatorKeyword();
  101. }
  102. /// AddObjCKeyword - Register an Objective-C @keyword like "class" "selector" or
  103. /// "property".
  104. static void AddObjCKeyword(tok::ObjCKeywordKind ObjCID,
  105. const char *Name, unsigned NameLen,
  106. IdentifierTable &Table) {
  107. Table.get(Name, Name+NameLen).setObjCKeywordID(ObjCID);
  108. }
  109. /// AddKeywords - Add all keywords to the symbol table.
  110. ///
  111. void IdentifierTable::AddKeywords(const LangOptions &LangOpts) {
  112. enum {
  113. C90Shift = 0,
  114. EXTC90 = 1 << C90Shift,
  115. NOTC90 = 2 << C90Shift,
  116. C99Shift = 2,
  117. EXTC99 = 1 << C99Shift,
  118. NOTC99 = 2 << C99Shift,
  119. CPPShift = 4,
  120. EXTCPP = 1 << CPPShift,
  121. NOTCPP = 2 << CPPShift,
  122. CPP0xShift = 6,
  123. EXTCPP0x = 1 << CPP0xShift,
  124. NOTCPP0x = 2 << CPP0xShift,
  125. BoolShift = 8,
  126. BOOLSUPPORT = 1 << BoolShift,
  127. Mask = 3
  128. };
  129. // Add keywords and tokens for the current language.
  130. #define KEYWORD(NAME, FLAGS) \
  131. AddKeyword(#NAME, strlen(#NAME), tok::kw_ ## NAME, \
  132. ((FLAGS) >> C90Shift) & Mask, \
  133. ((FLAGS) >> C99Shift) & Mask, \
  134. ((FLAGS) >> CPPShift) & Mask, \
  135. ((FLAGS) >> CPP0xShift) & Mask, \
  136. ((FLAGS) >> BoolShift) & Mask, LangOpts, *this);
  137. #define ALIAS(NAME, TOK) \
  138. AddAlias(NAME, strlen(NAME), tok::kw_ ## TOK, #TOK, strlen(#TOK), \
  139. LangOpts, *this);
  140. #define CXX_KEYWORD_OPERATOR(NAME, ALIAS) \
  141. if (LangOpts.CXXOperatorNames) \
  142. AddCXXOperatorKeyword(#NAME, strlen(#NAME), tok::ALIAS, *this);
  143. #define OBJC1_AT_KEYWORD(NAME) \
  144. if (LangOpts.ObjC1) \
  145. AddObjCKeyword(tok::objc_##NAME, #NAME, strlen(#NAME), *this);
  146. #define OBJC2_AT_KEYWORD(NAME) \
  147. if (LangOpts.ObjC2) \
  148. AddObjCKeyword(tok::objc_##NAME, #NAME, strlen(#NAME), *this);
  149. #include "clang/Basic/TokenKinds.def"
  150. }
  151. tok::PPKeywordKind IdentifierInfo::getPPKeywordID() const {
  152. // We use a perfect hash function here involving the length of the keyword,
  153. // the first and third character. For preprocessor ID's there are no
  154. // collisions (if there were, the switch below would complain about duplicate
  155. // case values). Note that this depends on 'if' being null terminated.
  156. #define HASH(LEN, FIRST, THIRD) \
  157. (LEN << 5) + (((FIRST-'a') + (THIRD-'a')) & 31)
  158. #define CASE(LEN, FIRST, THIRD, NAME) \
  159. case HASH(LEN, FIRST, THIRD): \
  160. return memcmp(Name, #NAME, LEN) ? tok::pp_not_keyword : tok::pp_ ## NAME
  161. unsigned Len = getLength();
  162. if (Len < 2) return tok::pp_not_keyword;
  163. const char *Name = getName();
  164. switch (HASH(Len, Name[0], Name[2])) {
  165. default: return tok::pp_not_keyword;
  166. CASE( 2, 'i', '\0', if);
  167. CASE( 4, 'e', 'i', elif);
  168. CASE( 4, 'e', 's', else);
  169. CASE( 4, 'l', 'n', line);
  170. CASE( 4, 's', 'c', sccs);
  171. CASE( 5, 'e', 'd', endif);
  172. CASE( 5, 'e', 'r', error);
  173. CASE( 5, 'i', 'e', ident);
  174. CASE( 5, 'i', 'd', ifdef);
  175. CASE( 5, 'u', 'd', undef);
  176. CASE( 6, 'a', 's', assert);
  177. CASE( 6, 'd', 'f', define);
  178. CASE( 6, 'i', 'n', ifndef);
  179. CASE( 6, 'i', 'p', import);
  180. CASE( 6, 'p', 'a', pragma);
  181. CASE( 7, 'd', 'f', defined);
  182. CASE( 7, 'i', 'c', include);
  183. CASE( 7, 'w', 'r', warning);
  184. CASE( 8, 'u', 'a', unassert);
  185. CASE(12, 'i', 'c', include_next);
  186. #undef CASE
  187. #undef HASH
  188. }
  189. }
  190. //===----------------------------------------------------------------------===//
  191. // Stats Implementation
  192. //===----------------------------------------------------------------------===//
  193. /// PrintStats - Print statistics about how well the identifier table is doing
  194. /// at hashing identifiers.
  195. void IdentifierTable::PrintStats() const {
  196. unsigned NumBuckets = HashTable.getNumBuckets();
  197. unsigned NumIdentifiers = HashTable.getNumItems();
  198. unsigned NumEmptyBuckets = NumBuckets-NumIdentifiers;
  199. unsigned AverageIdentifierSize = 0;
  200. unsigned MaxIdentifierLength = 0;
  201. // TODO: Figure out maximum times an identifier had to probe for -stats.
  202. for (llvm::StringMap<IdentifierInfo*, llvm::BumpPtrAllocator>::const_iterator
  203. I = HashTable.begin(), E = HashTable.end(); I != E; ++I) {
  204. unsigned IdLen = I->getKeyLength();
  205. AverageIdentifierSize += IdLen;
  206. if (MaxIdentifierLength < IdLen)
  207. MaxIdentifierLength = IdLen;
  208. }
  209. fprintf(stderr, "\n*** Identifier Table Stats:\n");
  210. fprintf(stderr, "# Identifiers: %d\n", NumIdentifiers);
  211. fprintf(stderr, "# Empty Buckets: %d\n", NumEmptyBuckets);
  212. fprintf(stderr, "Hash density (#identifiers per bucket): %f\n",
  213. NumIdentifiers/(double)NumBuckets);
  214. fprintf(stderr, "Ave identifier length: %f\n",
  215. (AverageIdentifierSize/(double)NumIdentifiers));
  216. fprintf(stderr, "Max identifier length: %d\n", MaxIdentifierLength);
  217. // Compute statistics about the memory allocated for identifiers.
  218. HashTable.getAllocator().PrintStats();
  219. }
  220. //===----------------------------------------------------------------------===//
  221. // SelectorTable Implementation
  222. //===----------------------------------------------------------------------===//
  223. unsigned llvm::DenseMapInfo<clang::Selector>::getHashValue(clang::Selector S) {
  224. return DenseMapInfo<void*>::getHashValue(S.getAsOpaquePtr());
  225. }
  226. namespace clang {
  227. /// MultiKeywordSelector - One of these variable length records is kept for each
  228. /// selector containing more than one keyword. We use a folding set
  229. /// to unique aggregate names (keyword selectors in ObjC parlance). Access to
  230. /// this class is provided strictly through Selector.
  231. class MultiKeywordSelector
  232. : public DeclarationNameExtra, public llvm::FoldingSetNode {
  233. friend SelectorTable* SelectorTable::CreateAndRegister(llvm::Deserializer&);
  234. MultiKeywordSelector(unsigned nKeys) {
  235. ExtraKindOrNumArgs = NUM_EXTRA_KINDS + nKeys;
  236. }
  237. public:
  238. // Constructor for keyword selectors.
  239. MultiKeywordSelector(unsigned nKeys, IdentifierInfo **IIV) {
  240. assert((nKeys > 1) && "not a multi-keyword selector");
  241. ExtraKindOrNumArgs = NUM_EXTRA_KINDS + nKeys;
  242. // Fill in the trailing keyword array.
  243. IdentifierInfo **KeyInfo = reinterpret_cast<IdentifierInfo **>(this+1);
  244. for (unsigned i = 0; i != nKeys; ++i)
  245. KeyInfo[i] = IIV[i];
  246. }
  247. // getName - Derive the full selector name and return it.
  248. std::string getName() const;
  249. unsigned getNumArgs() const { return ExtraKindOrNumArgs - NUM_EXTRA_KINDS; }
  250. typedef IdentifierInfo *const *keyword_iterator;
  251. keyword_iterator keyword_begin() const {
  252. return reinterpret_cast<keyword_iterator>(this+1);
  253. }
  254. keyword_iterator keyword_end() const {
  255. return keyword_begin()+getNumArgs();
  256. }
  257. IdentifierInfo *getIdentifierInfoForSlot(unsigned i) const {
  258. assert(i < getNumArgs() && "getIdentifierInfoForSlot(): illegal index");
  259. return keyword_begin()[i];
  260. }
  261. static void Profile(llvm::FoldingSetNodeID &ID,
  262. keyword_iterator ArgTys, unsigned NumArgs) {
  263. ID.AddInteger(NumArgs);
  264. for (unsigned i = 0; i != NumArgs; ++i)
  265. ID.AddPointer(ArgTys[i]);
  266. }
  267. void Profile(llvm::FoldingSetNodeID &ID) {
  268. Profile(ID, keyword_begin(), getNumArgs());
  269. }
  270. };
  271. } // end namespace clang.
  272. unsigned Selector::getNumArgs() const {
  273. unsigned IIF = getIdentifierInfoFlag();
  274. if (IIF == ZeroArg)
  275. return 0;
  276. if (IIF == OneArg)
  277. return 1;
  278. // We point to a MultiKeywordSelector (pointer doesn't contain any flags).
  279. MultiKeywordSelector *SI = reinterpret_cast<MultiKeywordSelector *>(InfoPtr);
  280. return SI->getNumArgs();
  281. }
  282. IdentifierInfo *Selector::getIdentifierInfoForSlot(unsigned argIndex) const {
  283. if (IdentifierInfo *II = getAsIdentifierInfo()) {
  284. assert(argIndex == 0 && "illegal keyword index");
  285. return II;
  286. }
  287. // We point to a MultiKeywordSelector (pointer doesn't contain any flags).
  288. MultiKeywordSelector *SI = reinterpret_cast<MultiKeywordSelector *>(InfoPtr);
  289. return SI->getIdentifierInfoForSlot(argIndex);
  290. }
  291. std::string MultiKeywordSelector::getName() const {
  292. std::string Result;
  293. unsigned Length = 0;
  294. for (keyword_iterator I = keyword_begin(), E = keyword_end(); I != E; ++I) {
  295. if (*I)
  296. Length += (*I)->getLength();
  297. ++Length; // :
  298. }
  299. Result.reserve(Length);
  300. for (keyword_iterator I = keyword_begin(), E = keyword_end(); I != E; ++I) {
  301. if (*I)
  302. Result.insert(Result.end(), (*I)->getName(),
  303. (*I)->getName()+(*I)->getLength());
  304. Result.push_back(':');
  305. }
  306. return Result;
  307. }
  308. std::string Selector::getAsString() const {
  309. if (IdentifierInfo *II = getAsIdentifierInfo()) {
  310. if (getNumArgs() == 0)
  311. return II->getName();
  312. std::string Res = II->getName();
  313. Res += ":";
  314. return Res;
  315. }
  316. // We have a multiple keyword selector (no embedded flags).
  317. return reinterpret_cast<MultiKeywordSelector *>(InfoPtr)->getName();
  318. }
  319. Selector SelectorTable::getSelector(unsigned nKeys, IdentifierInfo **IIV) {
  320. if (nKeys < 2)
  321. return Selector(IIV[0], nKeys);
  322. llvm::FoldingSet<MultiKeywordSelector> *SelTab;
  323. SelTab = static_cast<llvm::FoldingSet<MultiKeywordSelector> *>(Impl);
  324. // Unique selector, to guarantee there is one per name.
  325. llvm::FoldingSetNodeID ID;
  326. MultiKeywordSelector::Profile(ID, IIV, nKeys);
  327. void *InsertPos = 0;
  328. if (MultiKeywordSelector *SI = SelTab->FindNodeOrInsertPos(ID, InsertPos))
  329. return Selector(SI);
  330. // MultiKeywordSelector objects are not allocated with new because they have a
  331. // variable size array (for parameter types) at the end of them.
  332. MultiKeywordSelector *SI =
  333. (MultiKeywordSelector*)malloc(sizeof(MultiKeywordSelector) +
  334. nKeys*sizeof(IdentifierInfo *));
  335. new (SI) MultiKeywordSelector(nKeys, IIV);
  336. SelTab->InsertNode(SI, InsertPos);
  337. return Selector(SI);
  338. }
  339. SelectorTable::SelectorTable() {
  340. Impl = new llvm::FoldingSet<MultiKeywordSelector>;
  341. }
  342. SelectorTable::~SelectorTable() {
  343. delete static_cast<llvm::FoldingSet<MultiKeywordSelector> *>(Impl);
  344. }
  345. //===----------------------------------------------------------------------===//
  346. // Serialization for IdentifierInfo and IdentifierTable.
  347. //===----------------------------------------------------------------------===//
  348. void IdentifierInfo::Emit(llvm::Serializer& S) const {
  349. S.EmitInt(getTokenID());
  350. S.EmitInt(getBuiltinID());
  351. S.EmitInt(getObjCKeywordID());
  352. S.EmitBool(hasMacroDefinition());
  353. S.EmitBool(isExtensionToken());
  354. S.EmitBool(isPoisoned());
  355. S.EmitBool(isCPlusPlusOperatorKeyword());
  356. // FIXME: FETokenInfo
  357. }
  358. void IdentifierInfo::Read(llvm::Deserializer& D) {
  359. setTokenID((tok::TokenKind) D.ReadInt());
  360. setBuiltinID(D.ReadInt());
  361. setObjCKeywordID((tok::ObjCKeywordKind) D.ReadInt());
  362. setHasMacroDefinition(D.ReadBool());
  363. setIsExtensionToken(D.ReadBool());
  364. setIsPoisoned(D.ReadBool());
  365. setIsCPlusPlusOperatorKeyword(D.ReadBool());
  366. // FIXME: FETokenInfo
  367. }
  368. void IdentifierTable::Emit(llvm::Serializer& S) const {
  369. S.EnterBlock();
  370. S.EmitPtr(this);
  371. for (iterator I=begin(), E=end(); I != E; ++I) {
  372. const char* Key = I->getKeyData();
  373. const IdentifierInfo* Info = I->getValue();
  374. bool KeyRegistered = S.isRegistered(Key);
  375. bool InfoRegistered = S.isRegistered(Info);
  376. if (KeyRegistered || InfoRegistered) {
  377. // These acrobatics are so that we don't incur the cost of registering
  378. // a pointer with the backpatcher during deserialization if nobody
  379. // references the object.
  380. S.EmitPtr(InfoRegistered ? Info : NULL);
  381. S.EmitPtr(KeyRegistered ? Key : NULL);
  382. S.EmitCStr(Key);
  383. S.Emit(*Info);
  384. }
  385. }
  386. S.ExitBlock();
  387. }
  388. IdentifierTable* IdentifierTable::CreateAndRegister(llvm::Deserializer& D) {
  389. llvm::Deserializer::Location BLoc = D.getCurrentBlockLocation();
  390. std::vector<char> buff;
  391. buff.reserve(200);
  392. IdentifierTable* t = new IdentifierTable();
  393. D.RegisterPtr(t);
  394. while (!D.FinishedBlock(BLoc)) {
  395. llvm::SerializedPtrID InfoPtrID = D.ReadPtrID();
  396. llvm::SerializedPtrID KeyPtrID = D.ReadPtrID();
  397. D.ReadCStr(buff);
  398. IdentifierInfo *II = &t->get(&buff[0], &buff[0] + buff.size());
  399. II->Read(D);
  400. if (InfoPtrID) D.RegisterRef(InfoPtrID, II);
  401. if (KeyPtrID) D.RegisterPtr(KeyPtrID, II->getName());
  402. }
  403. return t;
  404. }
  405. //===----------------------------------------------------------------------===//
  406. // Serialization for Selector and SelectorTable.
  407. //===----------------------------------------------------------------------===//
  408. void Selector::Emit(llvm::Serializer& S) const {
  409. S.EmitInt(getIdentifierInfoFlag());
  410. S.EmitPtr(reinterpret_cast<void*>(InfoPtr & ~ArgFlags));
  411. }
  412. Selector Selector::ReadVal(llvm::Deserializer& D) {
  413. unsigned flag = D.ReadInt();
  414. uintptr_t ptr;
  415. D.ReadUIntPtr(ptr,false); // No backpatching.
  416. return Selector(ptr | flag);
  417. }
  418. void SelectorTable::Emit(llvm::Serializer& S) const {
  419. typedef llvm::FoldingSet<MultiKeywordSelector>::iterator iterator;
  420. llvm::FoldingSet<MultiKeywordSelector> *SelTab;
  421. SelTab = static_cast<llvm::FoldingSet<MultiKeywordSelector> *>(Impl);
  422. S.EnterBlock();
  423. S.EmitPtr(this);
  424. for (iterator I=SelTab->begin(), E=SelTab->end(); I != E; ++I) {
  425. if (!S.isRegistered(&*I))
  426. continue;
  427. S.FlushRecord(); // Start a new record.
  428. S.EmitPtr(&*I);
  429. S.EmitInt(I->getNumArgs());
  430. for (MultiKeywordSelector::keyword_iterator KI = I->keyword_begin(),
  431. KE = I->keyword_end(); KI != KE; ++KI)
  432. S.EmitPtr(*KI);
  433. }
  434. S.ExitBlock();
  435. }
  436. SelectorTable* SelectorTable::CreateAndRegister(llvm::Deserializer& D) {
  437. llvm::Deserializer::Location BLoc = D.getCurrentBlockLocation();
  438. SelectorTable* t = new SelectorTable();
  439. D.RegisterPtr(t);
  440. llvm::FoldingSet<MultiKeywordSelector>& SelTab =
  441. *static_cast<llvm::FoldingSet<MultiKeywordSelector>*>(t->Impl);
  442. while (!D.FinishedBlock(BLoc)) {
  443. llvm::SerializedPtrID PtrID = D.ReadPtrID();
  444. unsigned nKeys = D.ReadInt();
  445. MultiKeywordSelector *SI =
  446. (MultiKeywordSelector*)malloc(sizeof(MultiKeywordSelector) +
  447. nKeys*sizeof(IdentifierInfo *));
  448. new (SI) MultiKeywordSelector(nKeys);
  449. D.RegisterPtr(PtrID,SI);
  450. IdentifierInfo **KeyInfo = reinterpret_cast<IdentifierInfo **>(SI+1);
  451. for (unsigned i = 0; i != nKeys; ++i)
  452. D.ReadPtr(KeyInfo[i],false);
  453. SelTab.GetOrInsertNode(SI);
  454. }
  455. return t;
  456. }