aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinliang David Li <davidxl@google.com>2016-01-07 20:05:55 +0000
committerXinliang David Li <davidxl@google.com>2016-01-07 20:05:55 +0000
commit2129ae53ee56277198c36f2a2f66cb53f6a3bdfa (patch)
tree1f37d8079a9d0e95e3674049f1d9b750a1aa3759 /clang/lib/CodeGen/CoverageMappingGen.h
parent[PGO] Simplify coverage mapping lowering (diff)
downloadllvm-project-2129ae53ee56277198c36f2a2f66cb53f6a3bdfa.tar.gz
llvm-project-2129ae53ee56277198c36f2a2f66cb53f6a3bdfa.tar.bz2
llvm-project-2129ae53ee56277198c36f2a2f66cb53f6a3bdfa.zip
[PGO] Simplify coverage mapping lowering
Coverage mapping data may reference names of functions that are skipped by FE (e.g, unused inline functions). Since those functions are skipped, normal instr-prof function lowering pass won't put those names in the right section, so special handling is needed to walk through coverage mapping structure and recollect the references. With this patch, only names that are skipped are processed. This simplifies the lowering code and it no longer needs to make assumptions coverage mapping data layout. It should also be more efficient. llvm-svn: 257092
Diffstat (limited to 'clang/lib/CodeGen/CoverageMappingGen.h')
-rw-r--r--clang/lib/CodeGen/CoverageMappingGen.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CoverageMappingGen.h b/clang/lib/CodeGen/CoverageMappingGen.h
index 0d1bf6d975c9..9ae2bcffe4ca 100644
--- a/clang/lib/CodeGen/CoverageMappingGen.h
+++ b/clang/lib/CodeGen/CoverageMappingGen.h
@@ -54,6 +54,7 @@ class CoverageMappingModuleGen {
CoverageSourceInfo &SourceInfo;
llvm::SmallDenseMap<const FileEntry *, unsigned, 8> FileEntries;
std::vector<llvm::Constant *> FunctionRecords;
+ std::vector<llvm::Constant *> FunctionNames;
llvm::StructType *FunctionRecordTy;
std::string CoverageMappings;
@@ -70,7 +71,8 @@ public:
void addFunctionMappingRecord(llvm::GlobalVariable *FunctionName,
StringRef FunctionNameValue,
uint64_t FunctionHash,
- const std::string &CoverageMapping);
+ const std::string &CoverageMapping,
+ bool isUsed = true);
/// \brief Emit the coverage mapping data for a translation unit.
void emit();