[PATCH] D63684: [analyzer] exploded-graph-rewriter: NFC: Extract some code into functions.

Phabricator via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 24 19:17:06 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rL364267: [analyzer] NFC: exploded-graph-rewriter: Extract some code into functions. (authored by dergachev, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D63684?vs=206112&id=206353#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63684/new/

https://reviews.llvm.org/D63684

Files:
  cfe/trunk/utils/analyzer/exploded-graph-rewriter.py


Index: cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
===================================================================
--- cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
+++ cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
@@ -409,6 +409,24 @@
 
         self._dump('</table>')
 
+    def visit_environment_in_state(self, s, prev_s=None):
+        self._dump('<tr><td align="left">'
+                   '<b>Environment: </b>')
+        if s.environment is None:
+            self._dump('<i> Nothing!</i>')
+        else:
+            if prev_s is not None and prev_s.environment is not None:
+                if s.environment.is_different(prev_s.environment):
+                    self._dump('</td></tr><tr><td align="left">')
+                    self.visit_environment(s.environment, prev_s.environment)
+                else:
+                    self._dump('<i> No changes!</i>')
+            else:
+                self._dump('</td></tr><tr><td align="left">')
+                self.visit_environment(s.environment)
+
+        self._dump('</td></tr>')
+
     def visit_store(self, s, prev_s=None):
         self._dump('<table border="0">')
 
@@ -447,8 +465,7 @@
 
         self._dump('</table>')
 
-    def visit_state(self, s, prev_s):
-        # == Store ==
+    def visit_store_in_state(self, s, prev_s=None):
         self._dump('<tr><td align="left"><b>Store: </b>')
         if s.store is None:
             self._dump('<i> Nothing!</i>')
@@ -464,23 +481,9 @@
                 self.visit_store(s.store)
         self._dump('</td></tr><hr />')
 
-        # == Environment ==
-        self._dump('<tr><td align="left">'
-                   '<b>Environment: </b>')
-        if s.environment is None:
-            self._dump('<i> Nothing!</i>')
-        else:
-            if prev_s is not None and prev_s.environment is not None:
-                if s.environment.is_different(prev_s.environment):
-                    self._dump('</td></tr><tr><td align="left">')
-                    self.visit_environment(s.environment, prev_s.environment)
-                else:
-                    self._dump('<i> No changes!</i>')
-            else:
-                self._dump('</td></tr><tr><td align="left">')
-                self.visit_environment(s.environment)
-
-        self._dump('</td></tr>')
+    def visit_state(self, s, prev_s):
+        self.visit_store_in_state(s, prev_s)
+        self.visit_environment_in_state(s, prev_s)
 
     def visit_node(self, node):
         self._dump('%s [shape=record,label=<<table border="0">'


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63684.206353.patch
Type: text/x-patch
Size: 2556 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190625/453c0ba2/attachment.bin>


More information about the llvm-commits mailing list