summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6ba12f9)
raw | patch | inline | side by side (parent: 6ba12f9)
author | Justin Bogner <mail@justinbogner.com> | |
Wed, 17 Sep 2014 21:48:52 +0000 (21:48 +0000) | ||
committer | Justin Bogner <mail@justinbogner.com> | |
Wed, 17 Sep 2014 21:48:52 +0000 (21:48 +0000) |
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@217984 91177308-0d34-0410-b5e6-96231b3b80d8
test/tools/llvm-cov/showExpansions.cpp | patch | blob | history | |
tools/llvm-cov/CodeCoverage.cpp | patch | blob | history | |
tools/llvm-cov/SourceCoverageView.cpp | patch | blob | history |
index 52d33e99c6c8701bea60019ca460468b2a6db1f6..610d50095319ab71de0c0fa15a574904972230d0 100644 (file)
return 0;
}
-// CHECK: Expansion of {{[0-9]+}}:13 -> 18 @ {{[0-9]+}}, 22:5
-// CHECK: Expansion of {{[0-9]+}}:4 -> 5 @ {{[0-9]+}}, 15:7
-// CHECK: Expansion of {{[0-9]+}}:7 -> 10 @ {{[0-9]+}}, 17:7
+// CHECK: Expansion at line 22, 5 -> 17
+// CHECK: Expansion at line 15, 7 -> 24
+// CHECK: Expansion at line 17, 7 -> 20
// llvm-cov doesn't work on big endian yet
// XFAIL: powerpc64-, s390x, mips-, mips64-, sparc
index eef4185522e5486db4ca9834c42a89df9348a7aa..73ab317025c5b373c6cfb6dbc328f6b0b365a3d2 100644 (file)
return *LoadedSourceFiles.back().second;
}
-/// \brief Return a line start - line end range which contains
-/// all the mapping regions of a given function with a particular file id.
-std::pair<unsigned, unsigned>
-findExpandedFileInterestingLineRange(unsigned FileID,
- const FunctionCoverageMapping &Function) {
- unsigned LineStart = std::numeric_limits<unsigned>::max();
- unsigned LineEnd = 0;
- for (const auto &CR : Function.CountedRegions) {
- if (CR.FileID != FileID)
- continue;
- LineStart = std::min(CR.LineStart, LineStart);
- LineEnd = std::max(CR.LineEnd, LineEnd);
- }
- return std::make_pair(LineStart, LineEnd);
-}
-
bool CodeCoverageTool::equivalentFiles(StringRef A, StringRef B) {
if (CompareFilenamesOnly)
return sys::path::filename(A).equals_lower(sys::path::filename(B));
void CodeCoverageTool::createExpansionSubView(
const CountedRegion &ExpandedRegion,
const FunctionCoverageMapping &Function, SourceCoverageView &Parent) {
- auto ExpandedLines = findExpandedFileInterestingLineRange(
- ExpandedRegion.ExpandedFileID, Function);
- if (ViewOpts.Debug)
- llvm::errs() << "Expansion of " << ExpandedRegion.ExpandedFileID << ":"
- << ExpandedLines.first << " -> " << ExpandedLines.second
- << " @ " << ExpandedRegion.FileID << ", "
- << ExpandedRegion.LineStart << ":"
- << ExpandedRegion.ColumnStart << "\n";
auto SourceBuffer =
getSourceFile(Function.Filenames[ExpandedRegion.ExpandedFileID]);
if (!SourceBuffer)
index 2a212e5173d4fe854f66ef85a8fb17636f3b51f3..2ad3e145198cfc56254b071b02a4b2f8113d9005 100644 (file)
OS << "\n";
}
// Render the child subview
+ if (Options.Debug)
+ errs() << "Expansion at line " << NextESV->getLine() << ", "
+ << NextESV->getStartCol() << " -> " << NextESV->getEndCol()
+ << "\n";
NextESV->View->render(OS, false, NestedIndent);
RenderedSubView = true;
}