aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Hosek <phosek@google.com>2021-02-10 00:25:34 -0800
committerPetr Hosek <phosek@google.com>2021-02-18 14:34:39 -0800
commit5fbd1a333aa1a0b70903d036b98ea56c51ae5224 (patch)
tree8b8f39c2f58c6e34a840f94d1411aad6deecf151 /clang/lib/CodeGen/CoverageMappingGen.h
parentGlobalISel: Merge some AMDGPU ABI lowering code to generic code (diff)
downloadllvm-project-5fbd1a333aa1a0b70903d036b98ea56c51ae5224.tar.gz
llvm-project-5fbd1a333aa1a0b70903d036b98ea56c51ae5224.tar.bz2
llvm-project-5fbd1a333aa1a0b70903d036b98ea56c51ae5224.zip
[Coverage] Store compilation dir separately in coverage mapping
We currently always store absolute filenames in coverage mapping. This is problematic for several reasons. It poses a problem for distributed compilation as source location might vary across machines. We are also duplicating the path prefix potentially wasting space. This change modifies how we store filenames in coverage mapping. Rather than absolute paths, it stores the compilation directory and file paths as given to the compiler, either relative or absolute. Later when reading the coverage mapping information, we recombine relative paths with the working directory. This approach is similar to handling ofDW_AT_comp_dir in DWARF. Finally, we also provide a new option, -fprofile-compilation-dir akin to -fdebug-compilation-dir which can be used to manually override the compilation directory which is useful in distributed compilation cases. Differential Revision: https://reviews.llvm.org/D95753
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.h')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.h b/clang/lib/CodeGen/CoverageMappingGen.h
index b26f79be5316..abf12e58def6 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.h
+++ b/clang/lib/CodeGen/CoverageMappingGen.h
@@ -95,6 +95,7 @@ class CoverageMappingModuleGen {
std::vector<FunctionInfo> FunctionRecords;
std::map<std::string, std::string> ProfilePrefixMap;
+ std::string getCurrentDirname();
std::string normalizeFilename(StringRef Filename);
/// Emit a function record.