Simplify code with a StringRef.

llvm-svn: 82308
This commit is contained in:
Benjamin Kramer 2009-09-19 08:02:46 +00:00
parent b5c738b434
commit dad401dbc1
1 changed files with 2 additions and 7 deletions

View File

@ -334,13 +334,8 @@ public:
return *II;
}
IdentifierInfo &get(const char *Name) {
return get(Name, Name+strlen(Name));
}
IdentifierInfo &get(const std::string &Name) {
// Don't use c_str() here: no need to be null terminated.
const char *NameBytes = Name.data();
return get(NameBytes, NameBytes+Name.size());
IdentifierInfo &get(const llvm::StringRef& Name) {
return get(Name.begin(), Name.end());
}
typedef HashTableTy::const_iterator iterator;