summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Added a path-sensitive idempotent operation checker ↵Tom Care2010-07-061-66/+0
| | | | | | | | | | | | | | | | | | | (-analyzer-idempotent-operation). Finds idempotent and/or tautological operations in a path sensitive context, flagging operations that have no effect or a predictable effect. Example: { int a = 1; int b = 5; int c = b / a; // a is 1 on all paths } - New IdempotentOperationChecker class - Moved recursive Stmt functions in r107675 to IdempotentOperationChecker - Minor refactoring of SVal to allow checking for any integer - Added command line option for check - Added basic test cases llvm-svn: 107706
* Added several helper functions to Stmt to recursively check for different ↵Tom Care2010-07-061-0/+66
| | | | | | elements (macros, enum constants, etc). llvm-svn: 107675
* Alter the internal representation of the condition variable inDouglas Gregor2010-06-211-8/+124
| | | | | | | | | | | | | | | | if/while/switch/for statements to ensure that walking the children of these statements actually works. Previously, we stored the condition variable as a VarDecl. However, StmtIterator isn't able to walk from a VarDecl to a set of statements, and would (in some circumstances) walk beyond the end of the list of statements, cause Bad Behavior. In this change, we've gone back to representing the condition variables as DeclStmts. While not as memory-efficient as VarDecls, it greatly simplifies iteration over the children. Fixes the remainder of <rdar://problem/8104754>. llvm-svn: 106504
* Switch over the tablegen to use much prettier range technologyAlexis Hunt2010-05-181-1/+1
| | | | | | | Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def files llvm-svn: 104017
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeAlexis Hunt2010-05-051-5/+5
| | | | | | | with no whitespace. This will allow statements to be referred to in attribute TableGen files. llvm-svn: 103087
* Revert r103072; I accidentally ended up deleting a bunch of trailingAlexis Hunt2010-05-051-29/+29
| | | | | | | whitespace which makes this patch unreadable. Will recommit without the whitespace. llvm-svn: 103086
* Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesAlexis Hunt2010-05-051-29/+29
| | | | llvm-svn: 103072
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-231-27/+53
| | | | | | | | | | statements. Instead of the @try having a single @catch, where all of the @catch's were chained (using an O(n^2) algorithm nonetheless), @try just holds an array of its @catch blocks. The resulting AST is slightly more compact (not important) and better represents the actual language semantics (good). llvm-svn: 102221
* david conrad points out that {|} in inline assembly on arm are not asmChris Lattner2010-04-231-3/+6
| | | | | | variants. This fixes neon inline asm which my patch for PR6780 broke. llvm-svn: 102181
* fix PR6780, properly handling the IR {|} escapes in inline asm strings.Chris Lattner2010-04-051-5/+9
| | | | llvm-svn: 100449
* Remove the AST statistics tracking I added yesterday; it didn't pan out.Douglas Gregor2010-03-311-7/+0
| | | | llvm-svn: 100027
* Introduce new AST statistics that keep track of the number of isa (orDouglas Gregor2010-03-301-0/+7
| | | | | | | | | | | | | | | | | | | | | dyn_cast) invocations for C++ and Objective-C types, declarations, expressions, and statements. The statistics will be printed when -print-stats is provided to Clang -cc1, with results such as: 277073 clang - Number of checks for C++ declaration nodes 13311 clang - Number of checks for C++ expression nodes 18 clang - Number of checks for C++ statement nodes 174182 clang - Number of checks for C++ type nodes 92300 clang - Number of checks for Objective-C declaration nodes 9800 clang - Number of checks for Objective-C expression nodes 7 clang - Number of checks for Objective-C statement nodes 65733 clang - Number of checks for Objective-C type nodes The statistics are only gathered when NDEBUG is not defined, since they introduce potentially-expensive operations into very low-level routines (isa). llvm-svn: 99912
* Implement Doug's suggestion. Eliminate the Stmts pointer from CXXTryStmt and ↵Sam Weinig2010-02-031-12/+19
| | | | | | instead allocate the statements after the object. llvm-svn: 95199
* Remove the SmallVector from CXXTryStmt.Sam Weinig2010-02-031-14/+23
| | | | llvm-svn: 95190
* Remove abstract expression kinds from the StmtClass enum. Update a few usersJohn McCall2010-02-031-0/+1
| | | | | | appropriately. Call out a few missing cases in the expression mangler. llvm-svn: 95176
* Try to unbreak MSVC build.Benjamin Kramer2010-01-311-1/+1
| | | | llvm-svn: 94951
* Remove the SmallVectors from AsmStmt. Fixes PR6105.Anders Carlsson2010-01-301-21/+49
| | | | llvm-svn: 94926
* Use IdentifierInfo * instead of std::string for the AsmStmt names.Anders Carlsson2010-01-301-2/+2
| | | | llvm-svn: 94925
* Fix thinko.Anders Carlsson2010-01-301-1/+1
| | | | llvm-svn: 94922
* Even more AsmStmt cleanup.Anders Carlsson2010-01-301-9/+8
| | | | llvm-svn: 94921
* Combine AsmStmt::setOutputsAndInputs and AsmStmt::setClobbers.Anders Carlsson2010-01-301-12/+10
| | | | llvm-svn: 94918
* Implement instantiation of AsmStmts (Crazy, I know)Anders Carlsson2010-01-241-1/+1
| | | | llvm-svn: 94361
* Remember if the AsmStmt came from Microsoft-style inline assembly code.Mike Stump2010-01-041-2/+2
| | | | llvm-svn: 92526
* Fix bug I just introduced in ForStmt::child_end() where we could iterate off ↵Ted Kremenek2009-12-241-1/+1
| | | | | | into garbage values. llvm-svn: 92115
* Coelesce 'DoDestroy()' methods in Stmt.cpp, and modify the child_iterator ↵Ted Kremenek2009-12-241-65/+70
| | | | | | returned by ForStmt to include the initializer of the condition variable. llvm-svn: 92112
* Modify WhileStmt::child_begin()/child_end() to include the initializer for ↵Ted Kremenek2009-12-241-2/+16
| | | | | | the condition variable. llvm-svn: 92104
* Modify SwitchStmt::child_begin()/child_end() to include the initializer for ↵Ted Kremenek2009-12-241-4/+14
| | | | | | the condition variable. llvm-svn: 92100
* Add StmtIterator support for iterating over both the conditionTed Kremenek2009-12-231-2/+15
| | | | | | | | | | variable initializer and the other expressions in an IfStmt. This change required adding a 'DoDestroy()' method for IfStmt that did not include destroying the initializer (since that is owned by the VarDecl). llvm-svn: 92089
* Add 'DeclStmt::DoDestroy()' which doesn't actually recurse over its child ↵Ted Kremenek2009-12-231-0/+8
| | | | | | expressions (via StmtIterator), as those expressions are owned by the Decls and Types (which are destroyed elsewhere). This fixes a crasher reported in <rdar://problem/7487294>. llvm-svn: 91990
* Add const to accessors that don't modify the object.Mike Stump2009-11-301-1/+1
| | | | llvm-svn: 90153
* Streamline Stmt::CollectingStats() and Decl::CollectingStats(). No ↵Kovarththanan Rajaratnam2009-11-291-2/+2
| | | | | | functionality change. llvm-svn: 90078
* Move clients to use IdentifierInfo::getNameStart() instead of getName()Daniel Dunbar2009-10-181-1/+1
| | | | llvm-svn: 84436
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-24/+24
| | | | llvm-svn: 81346
* Fix build of clang with gcc-4.4: #include <cstdio> was missing.Torok Edwin2009-08-241-0/+1
| | | | llvm-svn: 79916
* Get rid of Stmt::Clone now that we can reference count statements instead.Anders Carlsson2009-08-081-12/+0
| | | | llvm-svn: 78452
* Introduce reference counting for statements and expressions, using itDouglas Gregor2009-08-081-1/+15
| | | | | | | to allow sharing of nodes. Simplifies some aspects of template instantiation, and fixes both PR3444 and <rdar://problem/6757457>. llvm-svn: 78450
* Separate Stmt::Destroy into the entrypoint for destroying a statementDouglas Gregor2009-08-071-10/+3
| | | | | | | or expression (Destroy) from the virtual function used to actually destroy a given expression (DoDestroy). llvm-svn: 78375
* Simplify printing of the statistics for types.Douglas Gregor2009-05-261-0/+1
| | | | llvm-svn: 72415
* Template instantiation for C++ try/catch statements.Douglas Gregor2009-05-181-1/+1
| | | | llvm-svn: 72035
* Template instantiation for break and continue statements.Douglas Gregor2009-05-151-0/+8
| | | | llvm-svn: 71903
* Add NullStmt::Clone and use itAnders Carlsson2009-05-151-0/+4
| | | | llvm-svn: 71823
* split ObjC and C++ Statements out into their own headers.Chris Lattner2009-04-261-0/+2
| | | | llvm-svn: 70105
* PCH support for inline assembly statements.Douglas Gregor2009-04-171-0/+20
| | | | | | | This completes support for all of C (+ extensions). We can (again) build a PCH file for Carbon.h. llvm-svn: 69385
* PCH support for the first batch of statements, including null,Douglas Gregor2009-04-171-0/+8
| | | | | | compound, case, default, if, switch, and break statements. llvm-svn: 69329
* Ignore plus operands when looking up the operand number from a named ↵Anders Carlsson2009-04-031-3/+0
| | | | | | operand. This matches llvm-gcc and fixes PR3908. llvm-svn: 68371
* add some spaces :)Chris Lattner2009-03-111-1/+1
| | | | llvm-svn: 66738
* don't use strtoul on a non-null-terminated string.Chris Lattner2009-03-111-4/+5
| | | | llvm-svn: 66732
* fix PR3258 by rejecting invalid numeric operands.Chris Lattner2009-03-111-5/+19
| | | | llvm-svn: 66618
* checking for symbolic operands as well as % at end of string.Chris Lattner2009-03-111-7/+20
| | | | llvm-svn: 66614
* position the caret properly on asm string diagnostics, e.g.:Chris Lattner2009-03-101-1/+1
| | | | | | | | Sema/asm.c:64:9: error: invalid % escape in inline assembly string asm("%!" : ); // expected-error {{invalid % escape in inline assembly string}} ~~^~ llvm-svn: 66606
OpenPOWER on IntegriCloud