3 <!-- HTMLLogger.cpp ----------------------------------------------------
5 Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6 See https://llvm.org/LICENSE.txt for license information.
7 SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
9 //===------------------------------------------------------------------------>
14 <template id=
"value-template">
15 <details class=
"value" open
>
18 <template data-if=
"v.value_id"><span class=
"address">#{{v.value_id}}
</span></template>
20 <template data-if=
"v.location">
21 <span class=
"location">{{v.type}}
<span class=
"address">@{{v.location}}
</span></span>
25 data-for=
"kv in Object.entries(v)"
26 data-if=
"['kind', 'value_id', 'type', 'location'].indexOf(kv[0]) < 0">
27 <div class=
"property"><span class=
"key">{{kv[
0]}}
</span>
28 <template data-if=
"typeof(kv[1]) != 'object'">{{kv[
1]}}
</template>
29 <template data-if=
"typeof(kv[1]) == 'object'" data-let=
"v = kv[1]">
30 <template data-use=
"value-template"></template>
41 <section id=
"timeline" data-selection=
"">
42 <header>Timeline
</header>
43 <template data-for=
"entry in timeline">
44 <div id=
"{{entry.block}}:{{entry.iter}}" data-bb=
"{{entry.block}}" class=
"entry">
46 <template data-if=
"entry.post_visit">(post-visit)
</template>
47 <template data-if=
"!entry.post_visit">({{entry.iter}})
</template>
48 <template data-if=
"entry.converged"> →|<!--Rightwards arrow, vertical line--></template>
53 <section id=
"function" data-selection=
"">
54 <header>Function
</header>
59 <section id=
"block" data-selection=
"bb">
60 <header><template>Block {{selection.bb}}
</template></header>
62 <template data-for=
"iter in cfg[selection.bb].iters">
63 <a class=
"chooser {{selection.bb}}:{{iter.iter}}" data-iter=
"{{selection.bb}}:{{iter.iter}}">
64 <template data-if=
"iter.post_visit">Post-visit
</template>
65 <template data-if=
"!iter.post_visit">{{iter.iter}}
</template>
66 <template data-if=
"iter.converged"> →|<!--Rightwards arrow, vertical line--></template>
70 <table id=
"bb-elements">
72 <tr id=
"{{selection.bb}}.0">
73 <td class=
"{{selection.bb}}">{{selection.bb}}
.0</td>
74 <td>(initial state)
</td>
77 <template data-for=
"elt in cfg[selection.bb].elements">
78 <tr id=
"{{selection.bb}}.{{elt_index+1}}">
79 <td class=
"{{selection.bb}}">{{selection.bb}}.{{elt_index+
1}}
</td>
86 <section id=
"element" data-selection=
"iter,elt">
87 <template data-let=
"state = states[selection.iter + '_' + selection.elt]">
89 <template data-if=
"state.element == 0">{{state.block}} initial state
</template>
90 <template data-if=
"state.element != 0">Element {{selection.elt}}
</template>
91 <template data-if=
"state.post_visit"> (post-visit)
</template>
92 <template data-if=
"!state.post_visit"> (iteration {{state.iter}})
</template>
94 <template data-if=
"state.value" data-let=
"v = state.value">
96 <template data-use=
"value-template"></template>
98 <template data-if=
"state.logs">
100 <pre>{{state.logs}}
</pre>
102 <h2>Built-in lattice
</h2>
103 <pre>{{state.builtinLattice}}
</pre>
108 addBBColors(Object
.keys(HTMLLoggerData
.cfg
).length
);
109 watchSelection(HTMLLoggerData
);
110 updateSelection({}, HTMLLoggerData
);
111 // Copy code and cfg from <template>s into the body.
112 for (tmpl
of document
.querySelectorAll('template[data-copy]'))
113 document
.getElementById(tmpl
.dataset
.copy
).replaceChildren(
114 ...tmpl
.content
.cloneNode(/*deep=*/true).childNodes
);