aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2010-03-12 08:23:34 +0000
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>2010-03-12 08:23:34 +0000
commit700030ebddb987936d4fee14d9412821d96e4840 (patch)
tree6417c29ed239dd6ddacc1d8354efb9a87d740cb3 /lib/Lex/PTHLexer.cpp
parent0faede6f31b07bcec7b776f2b420c3ea9bb3e58c (diff)
Switch over IdentifierInfoLookup to StringRef
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98337 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r--lib/Lex/PTHLexer.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index a64008ab18..3b949d0ab4 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/lib/Lex/PTHLexer.cpp
@@ -549,12 +549,12 @@ IdentifierInfo* PTHManager::LazilyCreateIdentifierInfo(unsigned PersistentID) {
return II;
}
-IdentifierInfo* PTHManager::get(const char *NameStart, const char *NameEnd) {
+IdentifierInfo* PTHManager::get(llvm::StringRef Name) {
PTHStringIdLookup& SL = *((PTHStringIdLookup*)StringIdLookup);
// Double check our assumption that the last character isn't '\0'.
- assert(NameEnd==NameStart || NameStart[NameEnd-NameStart-1] != '\0');
- PTHStringIdLookup::iterator I = SL.find(std::make_pair(NameStart,
- NameEnd - NameStart));
+ assert(Name.empty() || Name.data()[Name.size()-1] != '\0');
+ PTHStringIdLookup::iterator I = SL.find(std::make_pair(Name.data(),
+ Name.size()));
if (I == SL.end()) // No identifier found?
return 0;
@@ -662,7 +662,7 @@ public:
CacheTy::iterator I = Cache.find(path);
// If we don't get a hit in the PTH file just forward to 'stat'.
- if (I == Cache.end())
+ if (I == Cache.end())
return StatSysCallCache::stat(path, buf);
const PTHStatData& Data = *I;