diff options
author | Jay Foad <jay.foad@gmail.com> | 2011-06-21 15:13:30 +0000 |
---|---|---|
committer | Jay Foad <jay.foad@gmail.com> | 2011-06-21 15:13:30 +0000 |
commit | 65aa6885818d4b4eea2e5a9d12085b2398148662 (patch) | |
tree | 7bd303c20cc28939158f9db96576f2b39316d55f /lib/Basic/SourceManager.cpp | |
parent | 468eb7ddd69b5d545139fc46a3b730268c458f38 (diff) |
Make more use of llvm::StringRef in various APIs. In particular, don't
use the deprecated forms of llvm::StringMap::GetOrCreateValue().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133515 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/SourceManager.cpp')
-rw-r--r-- | lib/Basic/SourceManager.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/Basic/SourceManager.cpp b/lib/Basic/SourceManager.cpp index 2de8ab7528..23ebb4fd5c 100644 --- a/lib/Basic/SourceManager.cpp +++ b/lib/Basic/SourceManager.cpp @@ -169,11 +169,11 @@ const llvm::MemoryBuffer *ContentCache::getBuffer(Diagnostic &Diag, return Buffer.getPointer(); } -unsigned LineTableInfo::getLineTableFilenameID(const char *Ptr, unsigned Len) { +unsigned LineTableInfo::getLineTableFilenameID(llvm::StringRef Name) { // Look up the filename in the string table, returning the pre-existing value // if it exists. llvm::StringMapEntry<unsigned> &Entry = - FilenameIDs.GetOrCreateValue(Ptr, Ptr+Len, ~0U); + FilenameIDs.GetOrCreateValue(Name, ~0U); if (Entry.getValue() != ~0U) return Entry.getValue(); @@ -277,10 +277,10 @@ void LineTableInfo::AddEntry(unsigned FID, /// getLineTableFilenameID - Return the uniqued ID for the specified filename. /// -unsigned SourceManager::getLineTableFilenameID(const char *Ptr, unsigned Len) { +unsigned SourceManager::getLineTableFilenameID(llvm::StringRef Name) { if (LineTable == 0) LineTable = new LineTableInfo(); - return LineTable->getLineTableFilenameID(Ptr, Len); + return LineTable->getLineTableFilenameID(Name); } |