sammccall created this revision.
sammccall added a reviewer: mboehme.
Herald added subscribers: martong, xazax.hun.
Herald added a reviewer: NoQ.
Herald added a project: All.
sammccall requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

The indexes of analysis state within a BB element is a bit odd:

  BB.0 is the initial state
  BB.1 is the state after the first element

etc

This means we have N+1 states and we need N+1 elements in the BB list.
We add a dummy element at the beginning rather than the end, because we want
selecting a CFG element to show the state *afterwards*.
For example, if we click on an expr, we want to be able to see its value model!


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D148951

Files:
  clang/lib/Analysis/FlowSensitive/HTMLLogger.html


Index: clang/lib/Analysis/FlowSensitive/HTMLLogger.html
===================================================================
--- clang/lib/Analysis/FlowSensitive/HTMLLogger.html
+++ clang/lib/Analysis/FlowSensitive/HTMLLogger.html
@@ -35,9 +35,15 @@
   </template>
 </div>
 <table id="bb-elements">
+<template>
+  <tr id="{{selection.bb}}.0">
+    <td class="{{selection.bb}}">{{selection.bb}}.0</td>
+    <td>(initial state)</td>
+  </tr>
+</template>
 <template data-for="elt in cfg[selection.bb].elements">
-  <tr id="{{selection.bb}}.{{elt_index}}">
-    <td class="{{selection.bb}}">{{selection.bb}}.{{elt_index}}</td>
+  <tr id="{{selection.bb}}.{{elt_index+1}}">
+    <td class="{{selection.bb}}">{{selection.bb}}.{{elt_index+1}}</td>
     <td>{{elt}}</td>
   </tr>
 </template>


Index: clang/lib/Analysis/FlowSensitive/HTMLLogger.html
===================================================================
--- clang/lib/Analysis/FlowSensitive/HTMLLogger.html
+++ clang/lib/Analysis/FlowSensitive/HTMLLogger.html
@@ -35,9 +35,15 @@
   </template>
 </div>
 <table id="bb-elements">
+<template>
+  <tr id="{{selection.bb}}.0">
+    <td class="{{selection.bb}}">{{selection.bb}}.0</td>
+    <td>(initial state)</td>
+  </tr>
+</template>
 <template data-for="elt in cfg[selection.bb].elements">
-  <tr id="{{selection.bb}}.{{elt_index}}">
-    <td class="{{selection.bb}}">{{selection.bb}}.{{elt_index}}</td>
+  <tr id="{{selection.bb}}.{{elt_index+1}}">
+    <td class="{{selection.bb}}">{{selection.bb}}.{{elt_index+1}}</td>
     <td>{{elt}}</td>
   </tr>
 </template>
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to