]> granicus.if.org Git - llvm/commitdiff
[llvm-cov] Move some layout logic to the right spot (NFC)
authorVedant Kumar <vsk@apple.com>
Thu, 15 Sep 2016 06:49:13 +0000 (06:49 +0000)
committerVedant Kumar <vsk@apple.com>
Thu, 15 Sep 2016 06:49:13 +0000 (06:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281590 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-cov/SourceCoverageView.cpp
tools/llvm-cov/SourceCoverageViewHTML.cpp

index 8cf17f4a0a9236d325f8f5c95c0ebb8ad6d6d29f..8b3ffe7c63a09f31236b2ca97447025ee92e295b 100644 (file)
@@ -176,7 +176,8 @@ void SourceCoverageView::print(raw_ostream &OS, bool WholeFile,
   if (ShowSourceName)
     renderSourceName(OS, WholeFile);
 
-  renderTableHeader(OS, getFirstUncoveredLineNo(), ViewDepth);
+  renderTableHeader(OS, (ViewDepth > 0) ? 0 : getFirstUncoveredLineNo(),
+                    ViewDepth);
 
   // We need the expansions and instantiations sorted so we can go through them
   // while we iterate lines.
index 31d6fd3048b82640208d0739a6dd155eb4327433..73da231b2aa73083615a438cce41780fcac4efe4 100644 (file)
@@ -609,7 +609,7 @@ void SourceCoverageViewHTML::renderTableHeader(raw_ostream &OS,
                                                unsigned FirstUncoveredLineNo,
                                                unsigned ViewDepth) {
   std::string SourceLabel;
-  if (FirstUncoveredLineNo == 0 || ViewDepth > 0) {
+  if (FirstUncoveredLineNo == 0) {
     SourceLabel = tag("td", tag("pre", "Source"));
   } else {
     std::string LinkTarget = "#L" + utostr(uint64_t(FirstUncoveredLineNo));