aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/SourceManager.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-09-29 17:04:34 +0200
committerGitHub <noreply@github.com>2023-09-29 08:04:34 -0700
commit8a2fb1391bbf8e432b5e1cf1ae8b870446371031 (patch)
treeadccc04e6d4b5436ba0fbbca894fbb7f378949d2 /clang/lib/Basic/SourceManager.cpp
parentcd03d970431e9aa5d7df1bbef85353c4f2a21d40 (diff)
downloadllvm-8a2fb1391bbf8e432b5e1cf1ae8b870446371031.zip
llvm-8a2fb1391bbf8e432b5e1cf1ae8b870446371031.tar.gz
llvm-8a2fb1391bbf8e432b5e1cf1ae8b870446371031.tar.bz2
[clang] NFCI: Use `FileEntryRef` in `SourceManager::FileInfos` (#67742)
Diffstat (limited to 'clang/lib/Basic/SourceManager.cpp')
-rw-r--r--clang/lib/Basic/SourceManager.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/clang/lib/Basic/SourceManager.cpp b/clang/lib/Basic/SourceManager.cpp
index a630743..75855ad 100644
--- a/clang/lib/Basic/SourceManager.cpp
+++ b/clang/lib/Basic/SourceManager.cpp
@@ -324,8 +324,7 @@ SourceManager::~SourceManager() {
ContentCacheAlloc.Deallocate(MemBufferInfos[i]);
}
}
- for (llvm::DenseMap<const FileEntry*, SrcMgr::ContentCache*>::iterator
- I = FileInfos.begin(), E = FileInfos.end(); I != E; ++I) {
+ for (auto I = FileInfos.begin(), E = FileInfos.end(); I != E; ++I) {
if (I->second) {
I->second->~ContentCache();
ContentCacheAlloc.Deallocate(I->second);
@@ -702,7 +701,7 @@ void SourceManager::overrideFileContents(const FileEntry *SourceFile,
assert(SourceFile->getSize() == NewFile.getSize() &&
"Different sizes, use the FileManager to create a virtual file with "
"the correct size");
- assert(FileInfos.count(SourceFile) == 0 &&
+ assert(FileInfos.find_as(SourceFile) == FileInfos.end() &&
"This function should be called at the initialization stage, before "
"any parsing occurs.");
// FileEntryRef is not default-constructible.