summaryrefslogtreecommitdiffstats
path: root/clang/AST
Commit message (Collapse)AuthorAgeFilesLines
...
* For gotos, breaks, and continues where we cannot find a target successorTed Kremenek2007-08-231-9/+10
| | | | | | | | 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
* Added support for do..while loops in CFG construction.Ted Kremenek2007-08-231-0/+67
| | | | llvm-svn: 41325
* Renamed "CFG::BuildCFG" to "CFG::buildCFG" to have more consistent ↵Ted Kremenek2007-08-231-33/+52
| | | | | | | | | | | | | | 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
* Fixed bugs in source-level CFG construction for "for" and "while" loopsTed Kremenek2007-08-221-36/+54
| | | | | | | | 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
* Added support for "break" statements in source-level ASTs.Ted Kremenek2007-08-221-4/+31
| | | | | | Some comment cleanups. llvm-svn: 41299
* Added support for "continue" statements in source-level CFGsTed Kremenek2007-08-221-14/+50
| | | | | | | Cleaned up some code for "for" and "while" loops by making their implementations more symmetrical (and added a few comments). llvm-svn: 41298
* Added preliminary support for while loops within source-level CFGs.Ted Kremenek2007-08-221-6/+61
| | | | | | | 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
* Added CFG support for: for loopsTed Kremenek2007-08-221-32/+126
| | | | | | | | | | | | | 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
* Changed data structure recording the CFG blocks that need to be backpatchedTed Kremenek2007-08-221-1/+1
| | | | | | to labeled blocks from a list to a vector. llvm-svn: 41274
* Parse @encode expressions.Anders Carlsson2007-08-222-0/+13
| | | | llvm-svn: 41273
* Added CFG support for gotos and labels.Ted Kremenek2007-08-211-19/+86
| | | | | | | Modified CFG so that getEntry(), getExit(), front() and back() return CFGBlock& instead of CFGBlock*. llvm-svn: 41258
* Converted CFGBuilder to use StmtVisitor instead of doing a switchTed Kremenek2007-08-211-156/+117
| | | | | | dispatch to walk the AST. llvm-svn: 41254
* Added CFG infrastructure (CFG.cpp and CFG.h) for clang ASTs.Ted Kremenek2007-08-211-0/+351
| | | | | | | | | | | | 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
* Implement parsing and code generation of Objective-C string literals.Anders Carlsson2007-08-212-0/+16
| | | | llvm-svn: 41238
* add getAsComplexType() for consistencyChris Lattner2007-08-211-2/+15
| | | | llvm-svn: 41229
* Switch StmtVisitor from using dynamic to static dispatch. This makes it Chris Lattner2007-08-214-46/+13
| | | | | | | significantly faster and actually reduces the amount of code in the system. This also allows for future visitor changes. llvm-svn: 41211
* Modified ArraySubscriptExpr to have accessors getLHS and getRHS in additionTed Kremenek2007-08-202-4/+4
| | | | | | | | | | | | | to getBase and getIdx. getBase and getIdx now return a "normalized" view of the expression (e.g., always "A[4]" instead of possibly "4[A]"). getLHS and getRHS return the expressions with syntactic fidelity to the original source code. Also modified client code of ArraySubscriptExpr, including the AST dumper and pretty printer, the return-stack value checker, and the LLVM code generator. llvm-svn: 41180
* Add initial support for constant CFStrings.Anders Carlsson2007-08-172-12/+78
| | | | llvm-svn: 41136
* make sure to add a newline at the end of the dumpChris Lattner2007-08-101-0/+2
| | | | llvm-svn: 41011
* implement dumper support for declstmt's. The dumper is now "done".Chris Lattner2007-08-091-25/+31
| | | | llvm-svn: 40969
* implement dumper support for the rest of expressions.Chris Lattner2007-08-091-75/+54
| | | | llvm-svn: 40968
* move a switch to common code.Chris Lattner2007-08-091-10/+1
| | | | llvm-svn: 40967
* dump strings with escapes and other stuff in them nicely.Chris Lattner2007-08-091-16/+15
| | | | llvm-svn: 40964
* add dumping support for some new nodesChris Lattner2007-08-091-59/+15
| | | | llvm-svn: 40959
* Dump out types for expressions, and handle typedefs nicely. Chris Lattner2007-08-091-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | This allows us to dump: typedef short S; int test(S X, long long Y) { return X < ((100)); } as: typedef short S; int test(S X, long long Y) (CompoundStmt 0x2905d40 (ReturnStmt 0x2905d30 (BinaryOperator 0x2905d10 'int' '<' (ImplicitCastExpr 0x2905d00 'int' (DeclRefExpr 0x2905c80 'S':'short' Decl='X' 0x2905c20)) (ParenExpr 0x2905ce0 'int' (ParenExpr 0x2905cc0 'int' (IntegerLiteral 0x2905ca0 'int' 100)))))) llvm-svn: 40956
* add a new AST dumper interface (E->dump()). This dumps outChris Lattner2007-08-083-5/+568
| | | | | | | | | | | | | | | | | | | | | | | | | 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)))))) llvm-svn: 40954
* Finish implementing __builtin_classify_type()...Steve Naroff2007-08-082-0/+97
| | | | llvm-svn: 40951
* Add support for __builtin_classify_type(). This builtin function isn't ↵Steve Naroff2007-08-081-3/+13
| | | | | | | | | | | "public", however it is used by "tgmath.h" (so we need to support it). It might also come in handy when developing the overloaded function macros for OpenCU. Next check-in will make this an integer constant expression... llvm-svn: 40930
* Remove a space from "typeof" printing. It was causing the following error...Steve Naroff2007-08-051-1/+1
| | | | | | | | | | | | [dylan:clang/test/Parser] admin% ../../../../Debug/bin/clang -parse-ast-check typeof.c Warnings expected but not seen: Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *' Warnings seen but not expected: Line 21: incompatible types assigning 'typeof(*pi) const' to 'int *' Also corrected a typo from my previous commit. llvm-svn: 40832
* Implement codegen for __builtin_choose_expr. For example:Chris Lattner2007-08-041-2/+2
| | | | | | | | | | | | | | | | | | | struct X { int A; }; void foo() { struct X s; int i; i = __builtin_choose_expr(0, s, i); } compiles to: %tmp = load i32* %i ; <i32> [#uses=1] store i32 %tmp, i32* %i wow :) llvm-svn: 40801
* Implement __builtin_choose_expr.Steve Naroff2007-08-031-0/+9
| | | | llvm-svn: 40794
* Rename AddrLabel and OCUVectorComponent -> AddrLabelExpr and ↵Chris Lattner2007-08-032-10/+11
| | | | | | OCUVectorElementExpr respectively. This is for consistency with other expr nodes end with *Expr. llvm-svn: 40785
* add OCUVectorComponent::getNumComponents()Chris Lattner2007-08-031-1/+6
| | | | llvm-svn: 40778
* Add support for encoding a OCUVectorComponent into a single integer.Chris Lattner2007-08-021-0/+17
| | | | llvm-svn: 40768
* rename some helpers, have them return the idx of the field being accessed.Chris Lattner2007-08-021-3/+3
| | | | llvm-svn: 40764
* Use static methods, which don't require an instance of OCUVectorTypeChris Lattner2007-08-021-5/+7
| | | | llvm-svn: 40763
* Minor comment improvements.Chris Lattner2007-08-021-0/+4
| | | | llvm-svn: 40760
* Tweak to Expr::isIntegerConstantExpr...make sure the result is appropriately ↵Steve Naroff2007-08-021-2/+5
| | | | | | size for TypesCompatibleExpr's. llvm-svn: 40716
* Hack Expr::isConstantExpr() to allow for __builtin_types_compatible_p.Steve Naroff2007-08-021-0/+3
| | | | llvm-svn: 40705
* - Finish hooking up support for __builtin_types_compatible_p().Steve Naroff2007-08-011-2/+6
| | | | | | - Fix type printing code for recently added TypeOfExpr/TypeOfType. llvm-svn: 40700
* Add AST/Sema support for __builtin_types_compatible_p (a GNU extension).Steve Naroff2007-08-011-0/+6
| | | | | | Todo...still need to call the action from the parser... llvm-svn: 40693
* Add comments to getTypeOfExpr/getTypeOfType.Steve Naroff2007-08-011-4/+16
| | | | | | Also add instances of TypeOfExpr/TypeOfType to the Types vector (so we can keep track of them). llvm-svn: 40677
* Two typeof() related changes...Steve Naroff2007-08-012-4/+6
| | | | | | | | | | | | | | | | - Changed the name of ASTContext::getTypeOfType(Expr*)->getTypeOfExpr(). - Remove FIXME for TypeOfExpr::getAsStringInternal(). This will work fine for printing the AST. It isn't ideal for error diagnostics (since it's more natural to display the expressions type). One "random" (or at least delayed:-) change... - Changed all "ext_typecheck_*" diagnostics from EXTENSION->WARNING. Reason: Since -pedantic is now off (by default), these diagnostics were never being emitted (which is bad). With this change, clang will emit the warning all the time. The only downside (wrt GCC compatibility) is -pedantic-errors will not turn this diagnostics into errors (a "feature" of making tagging them with EXTENSION). When/if this becomes an issue, we can revisit. llvm-svn: 40676
* Print floating point literal values better.Chris Lattner2007-08-011-2/+2
| | | | llvm-svn: 40659
* move trivial type predicates inline.Chris Lattner2007-07-311-9/+0
| | | | llvm-svn: 40651
* split the rest of the type predicates into pure predicates:Chris Lattner2007-07-312-25/+43
| | | | | | there is now an isXXXType and a getAsXXXType llvm-svn: 40646
* rename isReferenceType to follow the new scheme.Chris Lattner2007-07-311-1/+2
| | | | llvm-svn: 40640
* make isPointerType() a pure predicate, rename theChris Lattner2007-07-311-1/+4
| | | | | | existing one to getAsPointerType() llvm-svn: 40639
* Add parsing and AST support for GNU "typeof".Steve Naroff2007-07-312-0/+24
| | | | | | | Many small changes to lot's of files. Still some FIXME's, however the basic support is in place. llvm-svn: 40631
* Finish up semantic analysis for vector components.Steve Naroff2007-07-301-0/+18
| | | | llvm-svn: 40584
OpenPOWER on IntegriCloud