aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CoverageMappingGen.cpp
diff options
context:
space:
mode:
authorJan Svoboda <jan_svoboda@apple.com>2023-09-06 11:15:23 -0700
committerJan Svoboda <jan@svoboda.ai>2023-09-06 11:15:51 -0700
commite75ecaa190613bb4936be14dfb595fc2736e052e (patch)
tree2f9b7853db78527bcdbc6089e098d683f02ded94 /clang/lib/CodeGen/CoverageMappingGen.cpp
parent06d2db25aaa71a8bb9f1cfb3bcb5ea007ab435ee (diff)
downloadllvm-e75ecaa190613bb4936be14dfb595fc2736e052e.zip
llvm-e75ecaa190613bb4936be14dfb595fc2736e052e.tar.gz
llvm-e75ecaa190613bb4936be14dfb595fc2736e052e.tar.bz2
[clang] NFCI: Use `FileEntryRef` in `CoverageMappingGen`
This removes some uses of the deprecated `FileEntry::getName()`.
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.cpp')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index bb4c6f5..dd81be6 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -322,12 +322,12 @@ public:
for (const auto &FL : FileLocs) {
SourceLocation Loc = FL.first;
FileID SpellingFile = SM.getDecomposedSpellingLoc(Loc).first;
- auto Entry = SM.getFileEntryForID(SpellingFile);
+ auto Entry = SM.getFileEntryRefForID(SpellingFile);
if (!Entry)
continue;
FileIDMapping[SM.getFileID(Loc)] = std::make_pair(Mapping.size(), Loc);
- Mapping.push_back(CVM.getFileID(Entry));
+ Mapping.push_back(CVM.getFileID(*Entry));
}
}
@@ -1740,7 +1740,7 @@ void CoverageMappingModuleGen::addFunctionMappingRecord(
FilenameStrs[0] = normalizeFilename(getCurrentDirname());
for (const auto &Entry : FileEntries) {
auto I = Entry.second;
- FilenameStrs[I] = normalizeFilename(Entry.first->getName());
+ FilenameStrs[I] = normalizeFilename(Entry.first.getName());
}
ArrayRef<std::string> FilenameRefs = llvm::ArrayRef(FilenameStrs);
RawCoverageMappingReader Reader(CoverageMapping, FilenameRefs, Filenames,
@@ -1764,7 +1764,7 @@ void CoverageMappingModuleGen::emit() {
FilenameStrs[0] = normalizeFilename(getCurrentDirname());
for (const auto &Entry : FileEntries) {
auto I = Entry.second;
- FilenameStrs[I] = normalizeFilename(Entry.first->getName());
+ FilenameStrs[I] = normalizeFilename(Entry.first.getName());
}
std::string Filenames;
@@ -1823,7 +1823,7 @@ void CoverageMappingModuleGen::emit() {
}
}
-unsigned CoverageMappingModuleGen::getFileID(const FileEntry *File) {
+unsigned CoverageMappingModuleGen::getFileID(FileEntryRef File) {
auto It = FileEntries.find(File);
if (It != FileEntries.end())
return It->second;