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 {{entry.block}} 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> 49 </div> 50</template> 51</section> 52 53<section id="function" data-selection=""> 54<header>Function</header> 55<div id="code"></div> 56<div id="cfg"></div> 57</section> 58 59<section id="block" data-selection="bb"> 60<header><template>Block {{selection.bb}}</template></header> 61<div id="iterations"> 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> 67 </a> 68 </template> 69</div> 70<table id="bb-elements"> 71<template> 72 <tr id="{{selection.bb}}.0"> 73 <td class="{{selection.bb}}">{{selection.bb}}.0</td> 74 <td>(initial state)</td> 75 </tr> 76</template> 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> 80 <td>{{elt}}</td> 81 </tr> 82</template> 83</table> 84</section> 85 86<section id="element" data-selection="iter,elt"> 87<template data-let="state = states[selection.iter + '_' + selection.elt]"> 88<header> 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> 93</header> 94<template data-if="state.value" data-let="v = state.value"> 95 <h2>Value</h2> 96 <template data-use="value-template"></template> 97</template> 98<template data-if="state.logs"> 99 <h2>Logs</h2> 100 <pre>{{state.logs}}</pre> 101</template> 102<h2>Built-in lattice</h2> 103<pre>{{state.builtinLattice}}</pre> 104</template> 105</section> 106 107<script> 108addBBColors(Object.keys(HTMLLoggerData.cfg).length); 109watchSelection(HTMLLoggerData); 110updateSelection({}, HTMLLoggerData); 111// Copy code and cfg from <template>s into the body. 112for (tmpl of document.querySelectorAll('template[data-copy]')) 113 document.getElementById(tmpl.dataset.copy).replaceChildren( 114 ...tmpl.content.cloneNode(/*deep=*/true).childNodes); 115</script> 116 117</body> 118</html> 119