[clang] d3e1217 - [CodeGen] Remove unneeded CoveragePrefixMap. NFC
Fangrui Song via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 25 15:21:19 PDT 2023
Author: Fangrui Song
Date: 2023-04-25T15:21:15-07:00
New Revision: d3e121780ac2724969a030415f3092170f3c7589
URL: https://github.com/llvm/llvm-project/commit/d3e121780ac2724969a030415f3092170f3c7589
DIFF: https://github.com/llvm/llvm-project/commit/d3e121780ac2724969a030415f3092170f3c7589.diff
LOG: [CodeGen] Remove unneeded CoveragePrefixMap. NFC
Added:
Modified:
clang/lib/CodeGen/CoverageMappingGen.cpp
clang/lib/CodeGen/CoverageMappingGen.h
Removed:
################################################################################
diff --git a/clang/lib/CodeGen/CoverageMappingGen.cpp b/clang/lib/CodeGen/CoverageMappingGen.cpp
index bac01c7ff67f..273d991c16c7 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.cpp
+++ b/clang/lib/CodeGen/CoverageMappingGen.cpp
@@ -1634,9 +1634,7 @@ static void dump(llvm::raw_ostream &OS, StringRef FunctionName,
CoverageMappingModuleGen::CoverageMappingModuleGen(
CodeGenModule &CGM, CoverageSourceInfo &SourceInfo)
- : CGM(CGM), SourceInfo(SourceInfo) {
- CoveragePrefixMap = CGM.getCodeGenOpts().CoveragePrefixMap;
-}
+ : CGM(CGM), SourceInfo(SourceInfo) {}
std::string CoverageMappingModuleGen::getCurrentDirname() {
if (!CGM.getCodeGenOpts().CoverageCompilationDir.empty())
@@ -1650,7 +1648,7 @@ std::string CoverageMappingModuleGen::getCurrentDirname() {
std::string CoverageMappingModuleGen::normalizeFilename(StringRef Filename) {
llvm::SmallString<256> Path(Filename);
llvm::sys::path::remove_dots(Path, /*remove_dot_dot=*/true);
- for (const auto &Entry : CoveragePrefixMap) {
+ for (const auto &Entry : CGM.getCodeGenOpts().CoveragePrefixMap) {
if (llvm::sys::path::replace_path_prefix(Path, Entry.first, Entry.second))
break;
}
diff --git a/clang/lib/CodeGen/CoverageMappingGen.h b/clang/lib/CodeGen/CoverageMappingGen.h
index f5282601b640..eca68d9abd79 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.h
+++ b/clang/lib/CodeGen/CoverageMappingGen.h
@@ -107,7 +107,6 @@ class CoverageMappingModuleGen {
llvm::SmallDenseMap<const FileEntry *, unsigned, 8> FileEntries;
std::vector<llvm::Constant *> FunctionNames;
std::vector<FunctionInfo> FunctionRecords;
- std::map<std::string, std::string> CoveragePrefixMap;
std::string getCurrentDirname();
std::string normalizeFilename(StringRef Filename);
More information about the cfe-commits
mailing list