r364267 - [analyzer] NFC: exploded-graph-rewriter: Extract some code into functions.
Artem Dergachev via cfe-commits
cfe-commits at lists.llvm.org
Mon Jun 24 19:16:50 PDT 2019
Author: dergachev
Date: Mon Jun 24 19:16:50 2019
New Revision: 364267
URL: http://llvm.org/viewvc/llvm-project?rev=364267&view=rev
Log:
[analyzer] NFC: exploded-graph-rewriter: Extract some code into functions.
Differential Revision: https://reviews.llvm.org/D63684
Modified:
cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
Modified: cfe/trunk/utils/analyzer/exploded-graph-rewriter.py
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/utils/analyzer/exploded-graph-rewriter.py?rev=364267&r1=364266&r2=364267&view=diff
==============================================================================
--- cfe/trunk/utils/analyzer/exploded-graph-rewriter.py (original)
+++ cfe/trunk/utils/analyzer/exploded-graph-rewriter.py Mon Jun 24 19:16:50 2019
@@ -409,6 +409,24 @@ class DotDumpVisitor(object):
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 @@ class DotDumpVisitor(object):
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 @@ class DotDumpVisitor(object):
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">'
More information about the cfe-commits
mailing list