[clang] [clang][dataflow] Various formatting tweaks to HTMLLogger. (PR #68392)

via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 6 00:26:11 PDT 2023


https://github.com/martinboehme created https://github.com/llvm/llvm-project/pull/68392

*  Ensure timeline entries don't have linebreaks by setting
   `min-width: max-content`.

*  Give the timeline header some padding on the right so it doesn't run into the
   "Function" header.

*  Put some padding around the iteration choosers so they don't run into each
   other.

*  Eliminate the "Iteration" text from the iteration choosers, which took up a
   lot of space. It should be clear what these are without the "Iteration"
   text. (This makes the above problem of iteration choosers running into each
   other less likely, but also add the padding nonetheless.)


>From c67f864f371469ca77df57b91b4dd8e012c274a4 Mon Sep 17 00:00:00 2001
From: Martin Braenne <mboehme at google.com>
Date: Fri, 6 Oct 2023 07:24:12 +0000
Subject: [PATCH] [clang][dataflow] Various formatting tweaks to HTMLLogger.

*  Ensure timeline entries don't have linebreaks by setting
   `min-width: max-content`.

*  Give the timeline header some padding on the right so it doesn't run into the
   "Function" header.

*  Put some padding around the iteration choosers so they don't run into each
   other.

*  Eliminate the "Iteration" text from the iteration choosers, which took up a
   lot of space. It should be clear what these are without the "Iteration"
   text. (This makes the above problem of iteration choosers running into each
   other less likely, but also add the padding nonetheless.)
---
 clang/lib/Analysis/FlowSensitive/HTMLLogger.css  | 7 ++++++-
 clang/lib/Analysis/FlowSensitive/HTMLLogger.html | 2 +-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
index 4de1d1ccc2b08ee..5da8db8fa87bf2f 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
@@ -19,6 +19,7 @@ section header {
   color: white;
   font-weight: bold;
   font-size: large;
+  padding-right: 0.5em;
 }
 section h2 {
   font-size: medium;
@@ -27,7 +28,7 @@ section h2 {
   border-top: 1px solid #aaa;
 }
 #timeline {
-  min-width: 0;
+  min-width: max-content;
 }
 #timeline .entry.hover {
   background-color: #aaa;
@@ -62,6 +63,10 @@ section h2 {
 #iterations .chooser {
   flex-grow: 1;
   text-align: center;
+  padding-left: 0.2em;
+}
+#iterations .chooser :last-child {
+  padding-right: 0.2em;
 }
 #iterations .chooser:not(.iter-select).hover {
   background-color: #ddd;
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
index ec9d74c71d35d98..b9f76c5074c7539 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
@@ -62,7 +62,7 @@
   <template data-for="iter in cfg[selection.bb].iters">
     <a class="chooser {{selection.bb}}:{{iter.iter}}" data-iter="{{selection.bb}}:{{iter.iter}}">
       <template data-if="iter.post_visit">Post-visit</template>
-      <template data-if="!iter.post_visit">Iteration {{iter.iter}}</template>
+      <template data-if="!iter.post_visit">{{iter.iter}}</template>
       <template data-if="iter.converged"> &#x2192;&#x7c;<!--Rightwards arrow, vertical line--></template>
     </a>
   </template>



More information about the cfe-commits mailing list