| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
| |
llvm-svn: 41623
|
|
|
|
|
|
|
|
|
|
| |
introduced by moving "CaseStmt" pointers out of the list of statements
and into the explicit "label" associated with a CFGBlock. --This
line, and those below, will be ignored--
M AST/CFG.cpp
llvm-svn: 41622
|
|
|
|
|
|
| |
no statements (or just full of ';' statements).
llvm-svn: 41620
|
|
|
|
|
|
|
|
| |
blocks involving only ';' statements. We now correctly handle the following:
void empty_label() { l1: ; }
llvm-svn: 41619
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
an empty then or else block (or contained only ';' statements).
For example, we now handle the following:
int empty_else() { if (0) { int a; } else ; }
int empty_then() { if (0) ; else { int a; } }
Thanks to Nico Weber for spotting this problem.
llvm-svn: 41617
|
|
|
|
|
|
|
|
|
|
|
|
| |
block begins with a label or case statement, CFGBlock::getLabel() will
return the corresponding LabelStmt/CaseStmt/DefaultStmt.
LabelStmts and SwitchCases no longer appear within the "executable"
statements of a CFGBlock.
More cleanups on visualization/pretty-printing of CFGs (less verbose).
llvm-svn: 41585
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(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.
llvm-svn: 41580
|
|
|
|
|
|
|
|
|
|
| |
This involves the construction of a specialized "dispatch" block that
all basic blocks containing indirect gotos unconditionally transfer
control-flow to. The successors of the dispatch block has as its successors
all of the blocks containing labels whose address was taken somewhere in
the function.
llvm-svn: 41554
|
|
|
|
| |
llvm-svn: 41549
|
|
|
|
|
|
| |
arbitrarily complex control-flow in their subexpressions.
llvm-svn: 41547
|
|
|
|
| |
llvm-svn: 41540
|
|
|
|
| |
llvm-svn: 41520
|
|
|
|
| |
llvm-svn: 41514
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
+ Added the creation of an empty Entry block at the end of CFG
construction if the Entry block in the CFG contains multiple
predecessors (which can happen with labels and do loops).
+ Fixed bug in the creation of an empty Exit block with functions where not
all paths end in a return statement (but some do). Basic blocks with
return statements were jumping to a (sometimes) non-empty block.
+ FinishBlock no longer checks for labels at the beginning of a basic
block before reversing the statements in the block. This is because
the recursion invariants of the builder methods have been cleaned up,
and blocks are only passed to FinishBlock at most once.
+ Modified handling of "if", "for", "while", "do", and "switch" to allow
condition expressions that can span multiple basic blocks. This allows
such conditions to contain short-circuit expressions (which span multiple
blocks in the CFG).
llvm-svn: 41508
|
|
|
|
|
|
|
| |
from the class declaration. This enables a nice view of what visitor methods
have been implemented.
llvm-svn: 41337
|
|
|
|
| |
llvm-svn: 41334
|
|
|
|
| |
llvm-svn: 41332
|
|
|
|
|
|
|
|
| |
block (because we are creating a CFG from an incomplete AST) we now
(gracefully) have a block ending with such statements not have any successors
instead of firing an assertion.
llvm-svn: 41327
|
|
|
|
| |
llvm-svn: 41325
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
capitalization.
Added explicit "Exit" CFGBlock pointer to the source-level CFG.
Changed the construction of blocks with "return" statements to have the
return statement appear both as a statement in the list of statements for
a CFGBlock as well as appear as a control-flow terminator. Also removed
the implicit linearization of "return" so that the return value and the
return statement did not appear as separate statements in the block.
llvm-svn: 41323
|
|
|
|
|
|
|
|
| |
where break targets weren't being set and restored properly. Also
cleaned up CFGBuilder code for "for" and "while" to use less reliance
on globals and to have clearer semantics.
llvm-svn: 41302
|
|
|
|
|
|
| |
Some comment cleanups.
llvm-svn: 41299
|
|
|
|
|
|
|
| |
Cleaned up some code for "for" and "while" loops by making their
implementations more symmetrical (and added a few comments).
llvm-svn: 41298
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
to labeled blocks from a list to a vector.
llvm-svn: 41274
|
|
|
|
|
|
|
| |
Modified CFG so that getEntry(), getExit(), front() and back() return
CFGBlock& instead of CFGBlock*.
llvm-svn: 41258
|
|
|
|
|
|
| |
dispatch to walk the AST.
llvm-svn: 41254
|
|
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
|