Add IdentifierTable::get() overload and start using it
llvm-svn: 98343
This commit is contained in:
parent
4cbc8bd1bc
commit
a3b09590e6
|
|
@ -311,6 +311,14 @@ public:
|
||||||
return *II;
|
return *II;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
IdentifierInfo &get(llvm::StringRef Name) {
|
||||||
|
return get(Name.begin(), Name.end());
|
||||||
|
}
|
||||||
|
|
||||||
|
IdentifierInfo &get(const char *Name, size_t NameLen) {
|
||||||
|
return get(llvm::StringRef(Name, NameLen));
|
||||||
|
}
|
||||||
|
|
||||||
/// \brief Creates a new IdentifierInfo from the given string.
|
/// \brief Creates a new IdentifierInfo from the given string.
|
||||||
///
|
///
|
||||||
/// This is a lower-level version of get() that requires that this
|
/// This is a lower-level version of get() that requires that this
|
||||||
|
|
@ -342,10 +350,6 @@ public:
|
||||||
return CreateIdentifierInfo(Name.begin(), Name.end());
|
return CreateIdentifierInfo(Name.begin(), Name.end());
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentifierInfo &get(llvm::StringRef Name) {
|
|
||||||
return get(Name.begin(), Name.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef HashTableTy::const_iterator iterator;
|
typedef HashTableTy::const_iterator iterator;
|
||||||
typedef HashTableTy::const_iterator const_iterator;
|
typedef HashTableTy::const_iterator const_iterator;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2628,7 +2628,7 @@ IdentifierInfo *PCHReader::DecodeIdentifierInfo(unsigned ID) {
|
||||||
unsigned StrLen = (((unsigned) StrLenPtr[0])
|
unsigned StrLen = (((unsigned) StrLenPtr[0])
|
||||||
| (((unsigned) StrLenPtr[1]) << 8)) - 1;
|
| (((unsigned) StrLenPtr[1]) << 8)) - 1;
|
||||||
IdentifiersLoaded[ID - 1]
|
IdentifiersLoaded[ID - 1]
|
||||||
= &PP->getIdentifierTable().get(Str, Str + StrLen);
|
= &PP->getIdentifierTable().get(Str, StrLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
return IdentifiersLoaded[ID - 1];
|
return IdentifiersLoaded[ID - 1];
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue