aboutsummaryrefslogtreecommitdiff
path: root/Driver/ASTStreamers.cpp
AgeCommit message (Collapse)Author
2007-10-07Rename ASTStreamers.* -> ASTConsumers.*Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42718 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06add a missing ;Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42704 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-06stub out some printing of objc decls.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42703 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-01Migrated LiveVariables and UninitializedVariables to now use theTed Kremenek
tracked BlkExpr information now maintained by the CFG class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42498 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-25Further refactored DataflowSolver. Now most code for the solver is sharedTed Kremenek
between forward and backward analyses, with trait classes being used to implement the key differences in operations/functionality. Converted the LiveVariables analysis to use the generic DataflowSolver. This, along with removing some extra functionality that was not needed, reduced the code for LiveVariables by over half. Modified Driver code to handle the updated interface to LiveVariables. Modified the DeadStores checker to handle the update interface to LiveVariables. Updated DataflowValues (generic ADT to store dataflow values) to also store values for blocks. This is used by DeadStores. Updated some comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-19Added support to clang driver to view ASTs using GraphViz. ThisTed Kremenek
functionality is still preliminary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42152 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17UninitialuzedValues now only tracks BlockVarDecls; obviating false positives ↵Ted Kremenek
with globals and function parameters. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42055 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-17Removed check for NULL CFG. Bad CFGs will fire an assertion failureTed Kremenek
in the CFG builder logic. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42033 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-16switch the llvm emitter to ASTConsumer interface.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@42013 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-15switch the various CFG-based stuff over to using ASTConsumer interface,Chris Lattner
this eliminates their dependence on the preprocessor and eliminates some duplicated code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41993 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-15convert ast printer and dumper ocver to ASTConsumer interface,Chris Lattner
genericizing them and eliminating boilerplate code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41992 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-15add a new ASTConsumer consumer to simplify stuff in the driver.Chris Lattner
Switch -parse-ast over to it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41991 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13Phase 2 of making the Decl class more lightweight...Steve Naroff
Move Identifier/Loc instance variables (and associated getters/setters) down from Decl to ScopedDecl/FieldDecl. Objc AST's can now inherit from Decl without getting instance variables and types that are C specific. For now, I am keeping NextDeclarator, since I believe it may be useful to ObjC. If not, it can be moved later. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-13make the sourcemgr available through ASTContext.Chris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41906 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10Some small tweaks to the recent Objc support...Steve Naroff
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41803 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-10Fixed LiveVariables to no longer track the liveness of function pointersTed Kremenek
that refer to direct function calls. Modified interface of LiveVariables to only track liveness of VarDecls. This cleans up a bunch of edge cases, and removed the bug just mentioned. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41797 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07-check-dead-stores now no longer prints out the function declarationsTed Kremenek
for each function. This was the behavior prior to the following patch: http://llvm.org/viewvc/llvm-project?view=rev&revision=41779 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41780 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07Refactored driver options that perform analyses/work over CFGs to useTed Kremenek
"CFGVisitor", which now handles all the boilerplate for iterating over the function definitions in a translation unit and building the CFGs. This logic was previously replicated for each driver option that used CFGs. The options -dump-cfg, -view-cfg, -check-dead-stores, and -dump-live-variables now use this refactored code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41779 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06Added "Dead Stores", a flow-sensitive checker that checks for storesTed Kremenek
to variables that are no longer live. This analysis is built on top of CFGs and the LiveVariables analysis. changes to driver: added driver option "-check-dead-stores" to run the analysis git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41754 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06LiveVariables:Ted Kremenek
- Finished 99% of analysis logic. Probably a few bugs. - Added querying functions to query liveness. - Added better pretty printing of liveness. - Added better bookkeeping of per-variable liveness information. - Added LiveVariablesAuditor interface, which allows "lazy" querying of intra-basic block liveness information. Driver: - Minor cleanups involved in dumping liveness information. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41753 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-06Added an early implementation of Live-Variables analysis built onTed Kremenek
source-level CFGs. This code may change significantly in the near future as we explore different means to implement dataflow analyses. Added a driver option, -dump-live-variables, to view the output of live variable analysis. This output is very ALPHA; it will be improved shortly. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41737 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-30Allow a SourceManager to optionally be passed into Stmt::dumpChris Lattner
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41588 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-29Added GraphTraits to source-level CFGs (CFG and CFGBlock) to allowTed Kremenek
(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
2007-08-26Make parse-ast-print print the storage class and inline Chris Lattner
specifier of functions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41416 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-23Renamed "CFG::BuildCFG" to "CFG::buildCFG" to have more consistent ↵Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41323 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-21Added CFG infrastructure (CFG.cpp and CFG.h) for clang ASTs.Ted Kremenek
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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@41252 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08add a new AST dumper interface (E->dump()). This dumps outChris Lattner
the AST in a structural, non-pretty, form useful for understanding the AST. It isn't quite done yet, but is already somewhat useful. For this example: int test(short X, long long Y) { return X < ((100)); } we get (with -parse-ast-dump): int test(short X, long long Y) (CompoundStmt 0x2905ce0 (ReturnStmt 0x2905cd0 (BinaryOperator 0x2905cb0 '<' (ImplicitCastExpr 0x2905ca0 (DeclRefExpr 0x2905c20 Decl='X' 0x2905bb0)) (ParenExpr 0x2905c80 (ParenExpr 0x2905c60 (IntegerLiteral 0x2905c40 100)))))) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@40954 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-11Stage two of getting CFE top correct.Reid Spencer
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@39734 91177308-0d34-0410-b5e6-96231b3b80d8