Add IdentifierTable::get() overload and start using it

llvm-svn: 98343
This commit is contained in:
Kovarththanan Rajaratnam 2010-03-12 10:32:27 +00:00
parent 4cbc8bd1bc
commit a3b09590e6
2 changed files with 9 additions and 5 deletions

View File

@ -311,6 +311,14 @@ public:
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.
///
/// This is a lower-level version of get() that requires that this
@ -342,10 +350,6 @@ public:
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 const_iterator;

View File

@ -2628,7 +2628,7 @@ IdentifierInfo *PCHReader::DecodeIdentifierInfo(unsigned ID) {
unsigned StrLen = (((unsigned) StrLenPtr[0])
| (((unsigned) StrLenPtr[1]) << 8)) - 1;
IdentifiersLoaded[ID - 1]
= &PP->getIdentifierTable().get(Str, Str + StrLen);
= &PP->getIdentifierTable().get(Str, StrLen);
}
return IdentifiersLoaded[ID - 1];