Skip to content

Commit 0c36127

Browse files
authored
[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)
1 parent 994493c commit 0c36127

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

clang/lib/Analysis/FlowSensitive/HTMLLogger.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,16 @@ section h2 {
2929
}
3030
#timeline {
3131
min-width: max-content;
32+
counter-reset: entry_counter;
33+
}
34+
#timeline .entry .counter::before {
35+
counter-increment: entry_counter;
36+
content: counter(entry_counter) ":";
37+
}
38+
#timeline .entry .counter {
39+
display: inline-block;
40+
min-width: 2em; /* Enough space for two digits and a colon */
41+
text-align: right;
3242
}
3343
#timeline .entry.hover {
3444
background-color: #aaa;

clang/lib/Analysis/FlowSensitive/HTMLLogger.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
<header>Timeline</header>
4343
<template data-for="entry in timeline">
4444
<div id="{{entry.block}}:{{entry.iter}}" data-bb="{{entry.block}}" class="entry">
45+
<span class="counter"></span>
4546
{{entry.block}}
4647
<template data-if="entry.post_visit">(post-visit)</template>
4748
<template data-if="!entry.post_visit">({{entry.iter}})</template>

0 commit comments

Comments
 (0)