diff options
author | Reid Kleckner <rnk@google.com> | 2019-10-10 00:54:33 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-10-10 00:54:33 +0000 |
commit | f6777964bde28c349d3e289ea37ecf5f5eeedbc4 (patch) | |
tree | c5b1c50f5e004f83f1975a74c11ea126c5ac4e42 /clang/lib/CodeGen/CoverageMappingGen.h | |
parent | b577efe4567f1f6a711ad36e1d17280dd1c4f009 (diff) | |
download | bcm5719-llvm-f6777964bde28c349d3e289ea37ecf5f5eeedbc4.tar.gz bcm5719-llvm-f6777964bde28c349d3e289ea37ecf5f5eeedbc4.zip |
Use -fdebug-compilation-dir to form absolute paths in coverage mappings
This allows users to explicitly request relative paths with
`-fdebug-compilation-dir .`.
Fixes PR43614
Reviewers: vsk, arphaman
Differential Revision: https://reviews.llvm.org/D68733
llvm-svn: 374266
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.h')
-rw-r--r-- | clang/lib/CodeGen/CoverageMappingGen.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.h b/clang/lib/CodeGen/CoverageMappingGen.h index 3bf51f59047..2bdc00e2566 100644 --- a/clang/lib/CodeGen/CoverageMappingGen.h +++ b/clang/lib/CodeGen/CoverageMappingGen.h @@ -54,10 +54,14 @@ class CoverageMappingModuleGen { std::vector<llvm::Constant *> FunctionNames; llvm::StructType *FunctionRecordTy; std::vector<std::string> CoverageMappings; + SmallString<256> CWD; + + /// Make the filename absolute, remove dots, and normalize slashes to local + /// path style. + std::string normalizeFilename(StringRef Filename); public: - CoverageMappingModuleGen(CodeGenModule &CGM, CoverageSourceInfo &SourceInfo) - : CGM(CGM), SourceInfo(SourceInfo), FunctionRecordTy(nullptr) {} + CoverageMappingModuleGen(CodeGenModule &CGM, CoverageSourceInfo &SourceInfo); CoverageSourceInfo &getSourceInfo() const { return SourceInfo; |