[llvm] r282020 - [llvm-cov] Demangle names for hidden instantiation views
Vedant Kumar via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 20 14:27:48 PDT 2016
Author: vedantk
Date: Tue Sep 20 16:27:48 2016
New Revision: 282020
URL: http://llvm.org/viewvc/llvm-project?rev=282020&view=rev
Log:
[llvm-cov] Demangle names for hidden instantiation views
Modified:
llvm/trunk/test/tools/llvm-cov/demangle.test
llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
Modified: llvm/trunk/test/tools/llvm-cov/demangle.test
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/tools/llvm-cov/demangle.test?rev=282020&r1=282019&r2=282020&view=diff
==============================================================================
--- llvm/trunk/test/tools/llvm-cov/demangle.test (original)
+++ llvm/trunk/test/tools/llvm-cov/demangle.test Tue Sep 20 16:27:48 2016
@@ -1,4 +1,8 @@
-// RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -Xdemangler sed -Xdemangler 's/_/X/g' -filename-equivalence %S/showTemplateInstantiations.cpp | FileCheck %s
+RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %S/Inputs/templateInstantiations.profdata -Xdemangler sed -Xdemangler 's/_/X/g' -filename-equivalence %S/showTemplateInstantiations.cpp | FileCheck %s
-// CHECK-DAG: XZ4funcIbEiTX
-// CHECK-DAG: XZ4funcIiEiTX
+// Check that we demangle names even if the sub-view will be hidden.
+RUN: llvm-profdata merge %S/Inputs/hideUnexecutedSubviews.proftext -o %t.profdata
+RUN: llvm-cov show %S/Inputs/templateInstantiations.covmapping -instr-profile %t.profdata -Xdemangler sed -Xdemangler 's/_/X/g' -filename-equivalence %S/showTemplateInstantiations.cpp | FileCheck %s
+
+CHECK-DAG: XZ4funcIbEiTX
+CHECK-DAG: XZ4funcIiEiTX
Modified: llvm/trunk/tools/llvm-cov/CodeCoverage.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-cov/CodeCoverage.cpp?rev=282020&r1=282019&r2=282020&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-cov/CodeCoverage.cpp (original)
+++ llvm/trunk/tools/llvm-cov/CodeCoverage.cpp Tue Sep 20 16:27:48 2016
@@ -236,12 +236,13 @@ CodeCoverageTool::createSourceFileView(S
for (const auto *Function : Coverage.getInstantiations(SourceFile)) {
std::unique_ptr<SourceCoverageView> SubView{nullptr};
+ StringRef Funcname = getSymbolForHumans(Function->Name);
+
if (Function->ExecutionCount > 0) {
auto SubViewCoverage = Coverage.getCoverageForFunction(*Function);
auto SubViewExpansions = SubViewCoverage.getExpansions();
SubView = SourceCoverageView::create(
- getSymbolForHumans(Function->Name), SourceBuffer.get(), ViewOpts,
- std::move(SubViewCoverage));
+ Funcname, SourceBuffer.get(), ViewOpts, std::move(SubViewCoverage));
attachExpansionSubViews(*SubView, SubViewExpansions, Coverage);
}
@@ -250,7 +251,7 @@ CodeCoverageTool::createSourceFileView(S
for (const auto &CR : Function->CountedRegions)
if (CR.FileID == FileID)
Line = std::max(CR.LineEnd, Line);
- View->addInstantiation(Function->Name, Line, std::move(SubView));
+ View->addInstantiation(Funcname, Line, std::move(SubView));
}
return View;
}
More information about the llvm-commits
mailing list