Index: cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c =================================================================== --- cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c +++ cfe/trunk/test/Analysis/exploded-graph-rewriter/escapes.c @@ -17,7 +17,7 @@ // CHECK-SAME: &Element\{"foo",0 S64b,char\} const char *const foo = "\x66\x6f\x6f"; - // CHECK: BinaryOperator + // CHECK: BinaryOperator // CHECK-SAME: 1 \| 2 // CHECK-SAME: 3 S32b int x = 1 | 2; Index: cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot =================================================================== --- cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot +++ cfe/trunk/test/Analysis/exploded-graph-rewriter/program_points.dot @@ -3,18 +3,28 @@ // FIXME: Substitution doesn't seem to work on Windows. // UNSUPPORTED: system-windows -// CHECK: Program point: +// CHECK: Program points: // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: +// CHECK-SAME: +// CHECK-SAME: +// CHECK-SAME: +// CHECK-SAME: +// CHECK-SAME: // CHECK-SAME:
// CHECK-SAME: -// CHECK-SAME: Edge +// CHECK-SAME: BlockEdge // CHECK-SAME: // CHECK-SAME: [B0] -> [B1] // CHECK-SAME:
+// CHECK-SAME: +// CHECK-SAME: BlockEntrance +// CHECK-SAME: +// CHECK-SAME: [B1] +// CHECK-SAME:
Node0x1 [shape=record,label= "{ @@ -26,7 +36,15 @@ "dst_id": 1, "terminator": null, "term_kind": null, - "tag": null } + "tag": null + }, + { + "kind": "BlockEntrance", + "block_id": 1, + "terminator": null, + "term_kind": null, + "tag": null + } ]} \l}"]; @@ -37,14 +55,17 @@ // CHECK-SAME: (main file):4:5: // CHECK-SAME: // CHECK-SAME: -// CHECK-SAME: DeclRefExpr +// CHECK-SAME: DeclRefExpr +// CHECK-SAME: +// CHECK-SAME: +// CHECK-SAME: PreStmt // CHECK-SAME: // CHECK-SAME: x // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: // CHECK-SAME: -// CHECK-SAME: +// CHECK-SAME: // CHECK-SAME: Tag: // CHECK-SAME: ExprEngine : Clean Node // CHECK-SAME: @@ -57,6 +78,7 @@ { "kind": "Statement", "stmt_kind": "DeclRefExpr", + "stmt_point_kind": "PreStmt", "stmd_id": 3, "pointer": "0x3", "pretty": "x", 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 @@ -59,6 +59,7 @@ self.dst_id = json_pp['dst_id'] elif self.kind == 'Statement': self.stmt_kind = json_pp['stmt_kind'] + self.stmt_point_kind = json_pp['stmt_point_kind'] self.pointer = json_pp['pointer'] self.pretty = json_pp['pretty'] self.loc = SourceLocation(json_pp['location']) \ @@ -373,30 +374,48 @@ elif p.kind in ['CallEnter', 'CallExitBegin', 'CallExitEnd']: color = 'blue' elif p.kind in ['Statement']: - color = 'cyan3' + color = 'cyan4' else: color = 'forestgreen' if p.kind == 'Statement': + # This avoids pretty-printing huge statements such as CompoundStmt. + # Such statements show up only at [Pre|Post]StmtPurgeDeadSymbols + skip_pretty = 'PurgeDeadSymbols' in p.stmt_point_kind + stmt_color = 'cyan3' if p.loc is not None: self._dump('' '%s:%s:%s:' '' - '%s%s' + '%s' + '%s' + '%s' % (p.loc.filename, p.loc.line, - p.loc.col, color, p.stmt_kind, p.pretty)) + p.loc.col, color, p.stmt_kind, + stmt_color, p.stmt_point_kind, + p.pretty if not skip_pretty else '')) else: self._dump('' 'Invalid Source Location:' '' - '%s%s' - % (color, p.stmt_kind, p.pretty)) + '%s' + '%s' + '%s' + % (color, p.stmt_kind, + stmt_color, p.stmt_point_kind, + p.pretty if not skip_pretty else '')) elif p.kind == 'Edge': self._dump('' '' '%s' '[B%d] -\\> [B%d]' - % (color, p.kind, p.src_id, p.dst_id)) + % (color, 'BlockEdge', p.src_id, p.dst_id)) + elif p.kind == 'BlockEntrance': + self._dump('' + '' + '%s' + '[B%d]' + % (color, p.kind, p.block_id)) else: # TODO: Print more stuff for other kinds of points. self._dump('' @@ -406,7 +425,7 @@ if p.tag is not None: self._dump('' - '' + '' 'Tag: ' '%s' % p.tag)