Commit Graph

24 Commits

Author SHA1 Message Date
Ted Kremenek 14f0d1a85a Fixed bug for CaseStmt where the child_begin/child_end methods were not
including the expressions in the case statement itself (not the body of
the case).

This required moving SubStmt out of SwitchCase into CaseStmt and DefaultStmt
respectively.  getSubStmt() now is a virtual call for SwitchCase, but is
a direct (static) call for CaseStmt and DefaultStmt.

llvm-svn: 41609
2007-08-30 16:50:46 +00:00
Chris Lattner cfb83dd7f2 elimiante some virtual calls.
llvm-svn: 41589
2007-08-30 00:53:54 +00:00
Ted Kremenek 5b3ed283f5 Fixed bug in child_begin/child_end for ReturnStmt where the iterator
would be invalid when RetValExp == NULL.

llvm-svn: 41511
2007-08-27 20:58:16 +00:00
Chris Lattner d8c9fc5ed8 fix off-by-one error
llvm-svn: 41392
2007-08-25 01:55:00 +00:00
Chris Lattner 4d15a0dbc0 rename sNames -> StmtClassInfo. Make lookups constant time.
llvm-svn: 41390
2007-08-25 01:42:24 +00:00
Ted Kremenek 066dd939c0 Added child_begin/child_end to all subclasses of Stmt in Stmt.h. All
concrete subclasses of Stmt are now required to implement 
child_begin/child_end.

llvm-svn: 41374
2007-08-24 21:09:09 +00:00
Chris Lattner 62249a6299 Switch StmtVisitor from using dynamic to static dispatch. This makes it
significantly faster and actually reduces the amount of code in the system.
This also allows for future visitor changes.

llvm-svn: 41211
2007-08-21 04:04:25 +00:00
Chris Lattner 23b7eb677d Finally bite the bullet and make the major change: split the clang namespace
out of the llvm namespace.  This makes the clang namespace be a sibling of
llvm instead of being a child.

The good thing about this is that it makes many things unambiguous.  The
bad things is that many things in the llvm namespace (notably data structures
like smallvector) now require an llvm:: qualifier.  IMO, libsystem and libsupport
should be split out of llvm into their own namespace in the future, which will fix
this issue.

llvm-svn: 39659
2007-06-15 23:05:46 +00:00
Chris Lattner eefa10e78a implement full sema support for the GCC address-of-label extension.
llvm-svn: 39510
2007-05-28 06:56:27 +00:00
Steve Naroff f84d11f9d7 Bug #:
Submitted by:
Reviewed by:
Added "global" statistics gathering for Decls/Stmts/Exprs.
Very useful for working with a single file. When we start compiling
multiple files, will need to enhance this to collect stats on a per-module
basis.

llvm-svn: 39485
2007-05-23 21:48:04 +00:00
Steve Naroff 92e30f8cc7 Bug #:
Submitted by:
Reviewed by:
Incorporate code review feedback from Chris...
- minor restructure of ParseMemberReferenceExpr logic. The last statement
is now the instantiation of the AST node (which I like a lot and will conform
to throughout Sema).
- declare StmtClassNameTable const.
- reword an error diagnostic.
- install the correct type for ParseSizeOfAlignOfTypeExpr. Added hook in
ASTContext. For now, simply return Context.UnsignedLongTy. Added a FIXME
to revisit (i.e. compute using TargetInfo).

llvm-svn: 39374
2007-04-02 22:35:25 +00:00
Steve Naroff f1e53698a4 Bug #:
Submitted by:
Reviewed by:

Type Checking...round 2. This checkin "breaks" parsing carbon.h. I imagine
that this will be true for the next week or so. Nevertheless, this round of
changes includes the following:

- Hacked various Expr classes to pass the appropriate TypeRef. Still have
a few more classes to touch.
- Implement type checking for ParseArraySubscriptExpr and ParseMemberReferenceExpr.
- Added a debug hook to derive the class name for Stmt/Expr nodes. Currently a
linear search...could easily optimize if important.
- Changed the name of TaggedType->TagType. Now we have TagType and TagDecl (which
are easier to remember).
- Fixed a bug in StringLiteral conversion I did a couple weeks ago. hadError was
not initialized (oops).
- changed Sema::Diag to return true. This streamlines the type checking code
considerably.
- Added many diagnositics.

This should be it!

llvm-svn: 39361
2007-03-23 22:27:02 +00:00
Steve Naroff 7f890eb790 More changes to complete the dynamic type support for Stmt/Expr.
This set of changes includes:
- convert ExprCXX.h and add to the Xcode project file.
-- required adding CXXBoolLiteralExpr to StmtNodes.def.
-- required adding visitor support (decl/defn).
- make the class codes in StmtNodes.def explicit (to enable range checking).
-- this required changing all clients of the STMT macro.
- declare the instance data const.

llvm-svn: 39344
2007-02-27 02:53:10 +00:00
Chris Lattner 29375654b6 Add support for parsing and pretty printing const_cast, dynamic_cast,
reinterpret_cast, and static_cast.  Patch by Bill!

llvm-svn: 39247
2006-12-04 18:06:35 +00:00
Chris Lattner 76af84462c use the StmtNodes.def database to eliminate redundant code.
llvm-svn: 39118
2006-11-04 20:54:18 +00:00
Chris Lattner 85ed873bdc implement ast nodes for while and do loops
llvm-svn: 39116
2006-11-04 20:40:44 +00:00
Chris Lattner 71e23ce2e1 Add AST node, AST building, actions, and printing for 'for' stmts.
llvm-svn: 39113
2006-11-04 20:18:38 +00:00
Chris Lattner 9ea960a220 make visit methods take a reference to a visitor instead of a pointer.
Remove all dump_impl methods from Stmt subclasses

llvm-svn: 39108
2006-11-04 07:16:04 +00:00
Chris Lattner 469d357425 implement visitor chaining.
llvm-svn: 39105
2006-11-04 06:32:52 +00:00
Chris Lattner 5e9a878126 add a new StmtVisitor class for traversing Stmt/Expr nodes.
llvm-svn: 39104
2006-11-04 06:21:51 +00:00
Chris Lattner 5f84a0648d add ast node for ifstmt
llvm-svn: 39051
2006-10-25 05:55:20 +00:00
Chris Lattner 6d9a685d75 Make the driver print function bodies at -parse-print-ast
llvm-svn: 39048
2006-10-25 05:11:20 +00:00
Chris Lattner e5cca06829 Make AST nodes for ReturnStmt's and CompoundStmts
llvm-svn: 39046
2006-10-25 04:29:46 +00:00
Chris Lattner f42cce7a8e Add new Stmt class
llvm-svn: 39045
2006-10-25 04:09:21 +00:00