xref: /freebsd/contrib/llvm-project/clang/lib/Analysis/FlowSensitive/HTMLLogger.html (revision b64c5a0ace59af62eff52bfe110a521dc73c937b)
1<!doctype html>
2<html>
3<!-- HTMLLogger.cpp ----------------------------------------------------
4
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
8
9//===------------------------------------------------------------------------>
10
11<head>
12<?INJECT?>
13
14<template id="value-template">
15  <details class="value" open>
16    <summary>
17      <span>{{v.kind}}
18        <template data-if="v.value_id"><span class="address">#{{v.value_id}}</span></template>
19      </span>
20      <template data-if="v.location">
21        <span class="location">{{v.type}} <span class="address">@{{v.location}}</span></span>
22      </template>
23    </summary>
24    <template
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>
31        </template>
32      </div>
33    </template>
34  </details>
35</template>
36
37</head>
38
39<body>
40
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">
45    <span class="counter"></span>
46    {{entry.block}}
47    <template data-if="entry.post_visit">(post-visit)</template>
48    <template data-if="!entry.post_visit">({{entry.iter}})</template>
49    <template data-if="entry.converged"> &#x2192;&#x7c;<!--Rightwards arrow, vertical line--></template>
50  </div>
51</template>
52</section>
53
54<section id="function" data-selection="">
55<header>Function</header>
56<div id="code"></div>
57<div id="cfg"></div>
58</section>
59
60<section id="block" data-selection="bb">
61<header><template>Block {{selection.bb}}</template></header>
62<div id="iterations">
63  <template data-for="iter in cfg[selection.bb].iters">
64    <a class="chooser {{selection.bb}}:{{iter.iter}}" data-iter="{{selection.bb}}:{{iter.iter}}">
65      <template data-if="iter.post_visit">Post-visit</template>
66      <template data-if="!iter.post_visit">{{iter.iter}}</template>
67      <template data-if="iter.converged"> &#x2192;&#x7c;<!--Rightwards arrow, vertical line--></template>
68    </a>
69  </template>
70</div>
71<table id="bb-elements">
72<template>
73  <tr id="{{selection.bb}}.0">
74    <td class="{{selection.bb}}">{{selection.bb}}.0</td>
75    <td>(initial state)</td>
76  </tr>
77</template>
78<template data-for="elt in cfg[selection.bb].elements">
79  <tr id="{{selection.bb}}.{{elt_index+1}}">
80    <td class="{{selection.bb}}">{{selection.bb}}.{{elt_index+1}}</td>
81    <td>{{elt}}</td>
82  </tr>
83</template>
84</table>
85</section>
86
87<section id="element" data-selection="iter,elt">
88<template data-let="state = states[selection.iter + '_' + selection.elt]">
89<header>
90  <template data-if="state.element == 0">{{state.block}} initial state</template>
91  <template data-if="state.element != 0">Element {{selection.elt}}</template>
92  <template data-if="state.post_visit"> (post-visit)</template>
93  <template data-if="!state.post_visit"> (iteration {{state.iter}})</template>
94</header>
95<template data-if="state.value" data-let="v = state.value">
96  <h2>Value</h2>
97  <template data-use="value-template"></template>
98</template>
99<template data-if="state.logs">
100  <h2>Logs</h2>
101  <pre>{{state.logs}}</pre>
102</template>
103<h2>Built-in lattice</h2>
104<pre>{{state.builtinLattice}}</pre>
105</template>
106</section>
107
108<script>
109addBBColors(Object.keys(HTMLLoggerData.cfg).length);
110watchSelection(HTMLLoggerData);
111updateSelection({}, HTMLLoggerData);
112// Copy code and cfg from <template>s into the body.
113for (tmpl of document.querySelectorAll('template[data-copy]'))
114  document.getElementById(tmpl.dataset.copy).replaceChildren(
115      ...tmpl.content.cloneNode(/*deep=*/true).childNodes);
116</script>
117
118</body>
119</html>
120