summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartinboehme <mboehme@google.com>2024-02-01 05:33:03 +0100
committerGitHub <noreply@github.com>2024-02-01 05:33:03 +0100
commit0c361270afff83cd6433cf865ed5a410dadfb33f (patch)
tree438690926bd0d0ce4c98c2aad5be13c65311c604
parent994493ce05ab7351cd92d30fb1bd23985b292851 (diff)
[clang][dataflow] Display line numbers in the HTML logger timeline. (#80130)
This makes it easier to count how many iterations an analysis takes to complete. It also makes it easier to compare how a change to the analysis code affects the timeline. Here's a sample screenshot: ![image](https://github.com/llvm/llvm-project/assets/29098113/b3f44b4d-7037-4f28-9532-5418663250e1)
-rw-r--r--clang/lib/Analysis/FlowSensitive/HTMLLogger.css10
-rw-r--r--clang/lib/Analysis/FlowSensitive/HTMLLogger.html1
2 files changed, 11 insertions, 0 deletions
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
index 5da8db8fa87b..e25270430efc 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.css
@@ -29,6 +29,16 @@ section h2 {
}
#timeline {
min-width: max-content;
+ counter-reset: entry_counter;
+}
+#timeline .entry .counter::before {
+ counter-increment: entry_counter;
+ content: counter(entry_counter) ":";
+}
+#timeline .entry .counter {
+ display: inline-block;
+ min-width: 2em; /* Enough space for two digits and a colon */
+ text-align: right;
}
#timeline .entry.hover {
background-color: #aaa;
diff --git a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
index b9f76c5074c7..be173e8b2854 100644
--- a/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
+++ b/clang/lib/Analysis/FlowSensitive/HTMLLogger.html
@@ -42,6 +42,7 @@
<header>Timeline</header>
<template data-for="entry in timeline">
<div id="{{entry.block}}:{{entry.iter}}" data-bb="{{entry.block}}" class="entry">
+ <span class="counter"></span>
{{entry.block}}
<template data-if="entry.post_visit">(post-visit)</template>
<template data-if="!entry.post_visit">({{entry.iter}})</template>