summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Stmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* reject invalid escape characters in extended-asm strings with a nice diagnostic.Chris Lattner2009-03-101-18/+20
| | | | llvm-svn: 66605
* add plumbing to report diagnostics back through sema for malformed asmstrings.Chris Lattner2009-03-101-2/+2
| | | | llvm-svn: 66598
* move the asm string analysis code out of codegen into common Chris Lattner2009-03-101-0/+112
| | | | | | code where Sema can get to it. No functionality change. llvm-svn: 66596
* move matching of named operands into AsmStmt class. At the sameChris Lattner2009-03-101-0/+25
| | | | | | | time handle + operands in operand counting, fixing asm.c:t7 to expand into $2 instead of $1. llvm-svn: 66531
* add some helper methods to AsmStmt and add some comments.Chris Lattner2009-03-101-6/+17
| | | | llvm-svn: 66521
* Change Parser::ParseCaseStatement to use an iterative approach to parsingChris Lattner2009-03-041-5/+4
| | | | | | | | | | | | | | | | | | multiple sequential case statements instead of doing it with recursion. This fixes a problem where we run out of stack space parsing 100K directly nested cases. There are a couple other problems that prevent this from being useful in practice (right now the example only parses correctly with -disable-free and doesn't work with -emit-llvm), but this is a start. I'm not including a testcase because it is large and uninteresting for regtesting. Sebastian, I would appreciate it if you could scrutinize the smart pointer gymnastics I do. llvm-svn: 66011
* Fix <rdar://problem/6640991> Exception handling executes wrong clause ↵Steve Naroff2009-03-031-2/+2
| | | | | | | | | | | (Daniel, please verify). Also necessary to fix: <rdar://problem/6632061> [sema] non object types should not be allowed in @catch statements <rdar://problem/6252237> [sema] qualified id should be disallowed in @catch statements llvm-svn: 65964
* ObjCAtCatchStmt's ParamStmt is always a DeclStmt.Daniel Dunbar2009-03-011-1/+2
| | | | llvm-svn: 65759
* Remove DeclGroupOwningRef, since we intend for declarations to be ownedDouglas Gregor2009-02-131-1/+0
| | | | | | | | | | | | | | | by DeclContexts (always) rather than by statements. DeclContext currently goes out of its way to avoid destroying any Decls that might be owned by a DeclGroupOwningRef. However, in an error-recovery situation, a failure in a declaration statement can cause all of the decls in a DeclGroupOwningRef to be destroyed after they've already be added into the DeclContext. Hence, DeclContext is left with already-destroyed declarations, and bad things happen. This problem was causing failures that showed up as assertions on x86 Linux in test/Parser/objc-forcollection-neg-2.m. llvm-svn: 64474
* Overhaul of Stmt allocation:Ted Kremenek2009-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Made allocation of Stmt objects using vanilla new/delete a *compiler error* by making this new/delete "protected" within class Stmt. - Now the only way to allocate Stmt objects is by using the new operator that takes ASTContext& as an argument. This ensures that all Stmt nodes are allocated from the same (pool) allocator. - Naturally, these two changes required that *all* creation sites for AST nodes use new (ASTContext&). This is a large patch, but the majority of the changes are just this mechanical adjustment. - The above changes also mean that AST nodes can no longer be deallocated using 'delete'. Instead, one most do StmtObject->Destroy(ASTContext&) or do ASTContextObject.Deallocate(StmtObject) (the latter not running the 'Destroy' method). Along the way I also... - Made CompoundStmt allocate its array of Stmt* using the allocator in ASTContext (previously it used std::vector). There are a whole bunch of other Stmt classes that need to be similarly changed to ensure that all memory allocated for ASTs comes from the allocator in ASTContext. - Added a new smart pointer ExprOwningPtr to Sema.h. This replaces the uses of llvm::OwningPtr within Sema, as llvm::OwningPtr used 'delete' to free memory instead of a Stmt's 'Destroy' method. Big thanks to Doug Gregor for helping with the acrobatics of making 'new/delete' private and the new smart pointer ExprOwningPtr! llvm-svn: 63997
* Use ASTContext's allocator to deallocate Stmt objects instead of using ↵Ted Kremenek2009-02-061-3/+5
| | | | | | 'delete'. This fixes <rdar://problem/6561143>. llvm-svn: 63905
* Don't advance the statement iterator after we've deallocated the statementDouglas Gregor2009-01-161-2/+3
| | | | llvm-svn: 62306
* Full AST support and better Sema support for C++ try-catch.Sebastian Redl2008-12-221-1/+13
| | | | llvm-svn: 61346
* Partial AST and Sema support for C++ try-catch.Sebastian Redl2008-12-221-0/+20
| | | | llvm-svn: 61337
* Don't require us to manually number the statements and expressions in ↵Douglas Gregor2008-11-141-3/+3
| | | | | | StmtNodes.def. We don't need stable numbers yet, renumbering is a pain, and LAST_STMT had the wrong value anyway. llvm-svn: 59300
* - Move ExprIterator to Stmt.h so that it can be used by classes defined in ↵Ted Kremenek2008-10-271-2/+19
| | | | | | | | | Stmt.h - Implement child_begin() and child_end() for AsmStmt. Previously these had stub implementations that did not iterate over the input/output operands of an inline assembly statement. - Use ExprIterator for performing iteration over input/output operands. llvm-svn: 58261
* Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ↵Ted Kremenek2008-10-071-9/+5
| | | | | | | | ScopedDecl*. This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*. llvm-svn: 57275
OpenPOWER on IntegriCloud