Commit Graph

6 Commits

Author SHA1 Message Date
Ted Kremenek 1c65be13cc Added preliminary support for while loops within source-level CFGs.
Adjusted printing of source-level CFGs to account that the entry block
may not be the first block in the list of blocks a CFG object maintains.

llvm-svn: 41294
2007-08-22 21:05:42 +00:00
Ted Kremenek 7e776b1d9c Added CFG support for: for loops
In CFG dumper, refactored the code to print block terminators into a
StmtVisitor.

Added the method "FinishBlock" to CFGBuilder to do the reversal of statements
in a block instead of calling "reverseStmts" for a block directly.  This
was necessary to fix a bug in how blocks with labels were being processed
(some cases would cause the statements to be reversed twice).  FinishBlock
detects blocks that start with labels and doesn't do a second reversal.

llvm-svn: 41281
2007-08-22 18:22:34 +00:00
Ted Kremenek de979aeff3 Changed data structure recording the CFG blocks that need to be backpatched
to labeled blocks from a list to a vector.

llvm-svn: 41274
2007-08-22 15:40:58 +00:00
Ted Kremenek 8a63218855 Added CFG support for gotos and labels.
Modified CFG so that getEntry(), getExit(), front() and back() return
CFGBlock& instead of CFGBlock*.

llvm-svn: 41258
2007-08-21 23:26:17 +00:00
Ted Kremenek 1b8ac851d1 Converted CFGBuilder to use StmtVisitor instead of doing a switch
dispatch to walk the AST.

llvm-svn: 41254
2007-08-21 22:06:14 +00:00
Ted Kremenek 4aa1e8b3b8 Added CFG infrastructure (CFG.cpp and CFG.h) for clang ASTs.
Added builder code to translate ASTs to CFGs.  This currently supports
if, return, and non-control flow statements.

Added pretty-printer to debug CFGs.

Added a "-dump-cfg" option to the clang driver to dump CFGs for code
sent through the frontend.

llvm-svn: 41252
2007-08-21 21:42:03 +00:00