[clang] 20cb4ec - [analyzer] Print the PostInitializer target in exploded-graph-rewriter (#116034)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 22 07:40:17 PST 2024
Author: Balazs Benics
Date: 2024-11-22T16:40:13+01:00
New Revision: 20cb4ec845dec70f304c054ba5b45c0a388112b8
URL: https://github.com/llvm/llvm-project/commit/20cb4ec845dec70f304c054ba5b45c0a388112b8
DIFF: https://github.com/llvm/llvm-project/commit/20cb4ec845dec70f304c054ba5b45c0a388112b8.diff
LOG: [analyzer] Print the PostInitializer target in exploded-graph-rewriter (#116034)
This aids debugging PostInitializer program points by knowing what is
the location being initialized.

Added:
Modified:
clang/utils/analyzer/exploded-graph-rewriter.py
Removed:
################################################################################
diff --git a/clang/utils/analyzer/exploded-graph-rewriter.py b/clang/utils/analyzer/exploded-graph-rewriter.py
index eca0f17beb40a0..dcda91e8a6809b 100755
--- a/clang/utils/analyzer/exploded-graph-rewriter.py
+++ b/clang/utils/analyzer/exploded-graph-rewriter.py
@@ -90,6 +90,11 @@ def __init__(self, json_pp):
self.callee_decl = json_pp.get("callee_decl", "None")
elif self.kind == "BlockEntrance":
self.block_id = json_pp["block_id"]
+ elif self.kind == "PostInitializer":
+ if "field_decl" in json_pp:
+ self.target = json_pp["field_decl"]
+ else:
+ self.target = json_pp["type"]
# A single expression acting as a key in a deserialized Environment.
@@ -627,6 +632,13 @@ def visit_program_point(self, p):
'<font color="%s">%s</font></td>'
'<td align="left">%s</td></tr>' % (color, p.kind, p.callee_decl)
)
+ elif p.kind == "PostInitializer":
+ self._dump(
+ '<td width="0"></td>'
+ '<td align="left" width="0">'
+ '<font color="%s">%s</font></td>'
+ '<td align="left">%s</td></tr>' % (color, p.kind, p.target)
+ )
else:
# TODO: Print more stuff for other kinds of points.
self._dump(
More information about the cfe-commits
mailing list