]> granicus.if.org Git - clang/commit
Added GraphTraits to source-level CFGs (CFG and CFGBlock) to allow
authorTed Kremenek <kremenek@apple.com>
Wed, 29 Aug 2007 21:56:09 +0000 (21:56 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 29 Aug 2007 21:56:09 +0000 (21:56 +0000)
commit7dba8607e59096014b7139ff20ef00870041d518
tree28ae4b88293b6e9a3f9d2d4cf0c95f1fd1141704
parent9b3d3a9f3d60eff7b7c8d383203ff348527e3874
Added GraphTraits to source-level CFGs (CFG and CFGBlock) to allow
(LLVM-provided) graph algorithms such as DFS and graph visualization
to work effortless on source-level CFGs.

Further cleanup on pretty printing of CFGs.  CFGBlock::dump and
CFGBlock::print now take the parent CFG as an argument.  This allows
CFGBlocks to print their own appropriate label indicating whether or
not they are the Entry/Exit/IndirectGotoBlock without the CFG::print
routine doing it instead.

Added Graphviz visualization for CFGs: CFG::viewCFG.  This employs the
GraphTraits just implemented.

Added "-view-cfg" mode the to clang driver.  This is identical to
"-dump-cfg" except that it calls Graphviz to visualize the CFGs
instead of dumping them to the terminal.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41580 91177308-0d34-0410-b5e6-96231b3b80d8
AST/CFG.cpp
Driver/ASTStreamers.cpp
Driver/ASTStreamers.h
Driver/clang.cpp
include/clang/AST/CFG.h