diff --git a/clang/include/clang/Basic/IdentifierTable.h b/clang/include/clang/Basic/IdentifierTable.h index 8512538e45cb..84c2fc910d11 100644 --- a/clang/include/clang/Basic/IdentifierTable.h +++ b/clang/include/clang/Basic/IdentifierTable.h @@ -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;