summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtSerialization.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Several things...Steve Naroff2008-12-041-1/+1
| | | | | | | | | | | - Implement RewritePropertySetter(). While the routine is simple, there were some tricky changes to RewriteFunctionBodyOrGlobalInitializer(), the main rewriter loop. It also required some additional instance data to distinguish setters from getters, as well as some changes to RewritePropertyGetter(). - Implement FIXME: for pretty printing ObjCPropertyRefExpr's. - Changed ObjCPropertyRefExpr::getSourceRange() to point to the end of the property name (not the beginning). Also made a minor name change from "Loc"->"IdLoc" (to make it clear the Loc does not point to the "."). llvm-svn: 60540
* Fix some type punning errors in SizeOfAlignOf and Typeid AST nodes. This ↵Sebastian Redl2008-12-031-1/+1
| | | | | | should satisfy compilers and language lawyers alike. llvm-svn: 60511
* Handle new by passing the Declaration to the Action, not a processed type.Sebastian Redl2008-12-021-7/+9
| | | | llvm-svn: 60413
* Use EmitInt, not Emit, to emit unsigned valuesDouglas Gregor2008-12-011-2/+2
| | | | llvm-svn: 60364
* Implement the GNU __null extensionDouglas Gregor2008-11-291-0/+17
| | | | llvm-svn: 60235
* Support for implicit property assignment. Error assigning toFariborz Jahanian2008-11-221-1/+1
| | | | | | 'implicit' property with no 'setter'. llvm-svn: 59878
* New AST node to access "implicit" setter/getter using property dor syntax.Fariborz Jahanian2008-11-221-15/+19
| | | | | | | Issuing diagnostics when assigning to read-only properties. This is work in progress. llvm-svn: 59874
* Implementation of new and delete parsing and sema.Sebastian Redl2008-11-211-0/+69
| | | | | | This version uses VLAs to represent arrays. I'll try an alternative way next, but I want this safe first. llvm-svn: 59835
* Add a new expression node, CXXOperatorCallExpr, which expresses aDouglas Gregor2008-11-141-3/+6
| | | | | | | | | | | | | | | | | | | function call created in response to the use of operator syntax that resolves to an overloaded operator in C++, e.g., "str1 + str2" that resolves to std::operator+(str1, str2)". We now build a CXXOperatorCallExpr in C++ when we pick an overloaded operator. (But only for binary operators, where we actually implement overloading) I decided *not* to refactor the current CallExpr to make it abstract (with FunctionCallExpr and CXXOperatorCallExpr as derived classes). Doing so would allow us to make CXXOperatorCallExpr a little bit smaller, at the cost of making the argument and callee accessors virtual. We won't know if this is going to be a win until we can parse lots of C++ code to determine how much memory we'll save by making this change vs. the performance penalty due to the extra virtual calls. llvm-svn: 59306
* Implement support for operator overloading using candidate operatorDouglas Gregor2008-11-121-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | functions for built-in operators, e.g., the builtin bool operator==(int const*, int const*) can be used for the expression "x1 == x2" given: struct X { operator int const*(); } x1, x2; The scheme for handling these built-in operators is relatively simple: for each candidate required by the standard, create a special kind of candidate function for the built-in. If overload resolution picks the built-in operator, we perform the appropriate conversions on the arguments and then let the normal built-in operator take care of it. There may be some optimization opportunity left: if we can reduce the number of built-in operator overloads we generate, overload resolution for these cases will go faster. However, one must be careful when doing this: GCC generates too few operator overloads in our little test program, and fails to compile it because none of the overloads it generates match. Note that we only support operator overload for non-member binary operators at the moment. The other operators will follow. As part of this change, ImplicitCastExpr can now be an lvalue. llvm-svn: 59148
* Introduce a single AST node SizeOfAlignOfExpr for all sizeof and alignof ↵Sebastian Redl2008-11-111-7/+18
| | | | | | expressions, both of values and types. llvm-svn: 59057
* Implement C++ 'typeid' parsing and sema.Sebastian Redl2008-11-111-0/+28
| | | | llvm-svn: 59042
* Add a new expression class, ObjCSuperExpr, to handle the Objective-C ↵Douglas Gregor2008-11-041-0/+14
| | | | | | 'super'. Remove ObjCThis from PredefinedExpr llvm-svn: 58698
* Create a new expression class, CXXThisExpr, to handle the C++ 'this' primary ↵Douglas Gregor2008-11-041-1/+15
| | | | | | expression. Remove CXXThis from PredefinedExpr llvm-svn: 58695
* Fix <rdar://problem/6339636> clang ObjC rewriter: Assertion failed: FileID-1 ↵Steve Naroff2008-11-031-3/+5
| | | | | | < FileIDs.size() && "Invalid FileID!", file c:\cygwin\home\Administrator\llvm\tools\clang\include\clang/Basic/SourceManager.h, line 513 llvm-svn: 58654
* Rename ExplicitCCastExpr to CStyleCastExprDouglas Gregor2008-10-281-5/+5
| | | | llvm-svn: 58331
* Refactor the expression class hierarchy for casts. Most importantly:Douglas Gregor2008-10-271-7/+50
| | | | | | | | | | | | | | | | | | | | | | - CastExpr is the root of all casts - ImplicitCastExpr is (still) used for all explicit casts - ExplicitCastExpr is now the root of all *explicit* casts - ExplicitCCastExpr (new name needed!?) is a C-style cast in C or C++ - CXXFunctionalCastExpr inherits from ExplicitCastExpr - CXXNamedCastExpr inherits from ExplicitCastExpr and is the root of all of the C++ named cast expression types (static_cast, dynamic_cast, etc.) - Added classes CXXStaticCastExpr, CXXDynamicCastExpr, CXXReinterpretCastExpr, and CXXConstCastExpr to Also, fixed returned-stack-addr.cpp, which broke once when we fixed reinterpret_cast to diagnose double->int* conversions and again when we eliminated implicit conversions to reference types. The fix is in both testcase and SemaChecking.cpp. Most of this patch is simply support for the renaming. There's very little actual change in semantics. llvm-svn: 58264
* Preliminary support for function overloadingDouglas Gregor2008-10-211-2/+2
| | | | llvm-svn: 57909
* Use BatchEmitOwnedPtrs for writing multiple child exprs, per review.Daniel Dunbar2008-10-151-12/+28
| | | | | | Also added serialization support to OverloadExpr. llvm-svn: 57588
* Add serialization support in several missing places.Daniel Dunbar2008-10-141-0/+105
| | | | llvm-svn: 57502
* - Add BlockDecl AST node.Steve Naroff2008-10-081-9/+3
| | | | | | | | | | - Modify BlockExpr to reference the BlockDecl. This is "cleanup" necessary to improve our lookup semantics for blocks (to fix <rdar://problem/6272905> clang block rewriter: parameter to function not imported into block?). Still some follow-up work to finish this (forthcoming). llvm-svn: 57298
* Migrate DeclStmt over to using a DeclGroup instead of a pointer to a ↵Ted Kremenek2008-10-071-4/+4
| | | | | | | | ScopedDecl*. This also removes the ugly hack needed in CFG.cpp for subclassing DeclStmt to create a DeclStmt with one Decl*. llvm-svn: 57275
* Don't use DeclStmt::getDecl() to serialize out DeclStmt; use TheDecl directly.Ted Kremenek2008-10-061-1/+1
| | | | | | This patch precedes removing getDecl() DeclStmt::entirely. llvm-svn: 57205
* Remove BlockStmtExpr. Steve Naroff2008-09-171-2/+2
| | | | | | | | Block literals are now represented by the concrete BlockExpr class. This is cleanup (removes a FIXME). No functionality change. llvm-svn: 56288
* Add semantic analysis for "blocks". Steve Naroff2008-09-031-0/+32
| | | | | | | | | | | | | | | Highlights... - 4 new AST nodes, BlockExpr, BlockStmtExpr, BlockExprExpr, BlockDeclRefExpr. - Sema::ActOnBlockStart(), ActOnBlockError(), ActOnBlockStmtExpr(), ActOnBlockExprExpr(), ActOnBlockReturnStmt(). Next steps... - hack Sema::ActOnIdentifierExpr() to deal with block decl refs. - add attribute handler for byref decls. - add test cases. llvm-svn: 55710
* Fix ObjCPropertRefExpr to be able to encode all the information forDaniel Dunbar2008-09-031-2/+15
| | | | | | | uses which refer to methods not properties. - Not yet wired in Sema. llvm-svn: 55681
* Add support for C++'s "type-specifier ( expression-list )" expression:Argyrios Kyrtzidis2008-08-221-0/+36
| | | | | | | | | | -The Parser calls a new "ActOnCXXTypeConstructExpr" action. -Sema, depending on the type and expressions number: -If the type is a class, it will treat it as a class constructor. [TODO] -If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node -If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node. llvm-svn: 55177
* Add ExplicitCastExpr to replace the current CastExpr, and have ↵Argyrios Kyrtzidis2008-08-181-8/+8
| | | | | | | | | | | ImplicitCastExpr and ExplicitCastExpr derive from a common base class (CastExpr): Expr -> CastExpr -> ExplicitCastExpr -> ImplicitCastExpr llvm-svn: 54955
* Cleanup ObjCSuperRefExpr (remove last usage and AST node:-).Steve Naroff2008-08-101-11/+0
| | | | llvm-svn: 54617
* rename PreDefinedExpr -> PredefinedExprChris Lattner2008-08-101-5/+5
| | | | llvm-svn: 54605
* Fix serialization of DeclStmt.Ted Kremenek2008-08-061-19/+3
| | | | llvm-svn: 54428
* Reorder serialization methods.Ted Kremenek2008-08-061-20/+35
| | | | | | When serializing DeclStmt, encode a bit indicating whether or not the DeclStmt owns the Decl. This is an interim solution. llvm-svn: 54410
* Update serialization for ObjCMessageExpr to handle additional bit-swizziling ↵Ted Kremenek2008-06-241-8/+12
| | | | | | of receiver information. llvm-svn: 52679
* This patch is motivated by numerous strict-aliasing warnings when compilingTed Kremenek2008-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang as a Release build. The big change is that all AST nodes (subclasses of Stmt) whose children are Expr* store their children as Stmt* or arrays of Stmt*. This is to remove strict-aliasing warnings when using StmtIterator. None of the interfaces of any of the classes have changed (except those with arg_iterators, see below), as the accessor methods introduce the needed casts (via cast<>). While this extra casting may seem cumbersome, it actually adds some important sanity checks throughout the codebase, as clients using StmtIterator can potentially overwrite children that are expected to be Expr* with Stmt* (that aren't Expr*). The casts provide extra sanity checks that are operational in debug builds to catch invariant violations such as these. For classes that have arg_iterators (e.g., CallExpr), the definition of arg_iterator has been replaced. Instead of it being Expr**, it is an actual class (called ExprIterator) that wraps a Stmt**, and provides the necessary operators for iteration. The nice thing about this class is that it also uses cast<> to type-checking, which introduces extra sanity checks throughout the codebase that are useful for debugging. A few of the CodeGen functions that use arg_iterator (especially from OverloadExpr) have been modified to take begin and end iterators instead of a base Expr** and the number of arguments. This matches more with the abstraction of iteration. This still needs to be cleaned up a little bit, as clients expect that ExprIterator is a RandomAccessIterator (which we may or may not wish to allow for efficiency of representation). This is a fairly large patch. It passes the tests (except CodeGen/bitfield.c, which was already broken) on both a Debug and Release build, but it should obviously be reviewed. llvm-svn: 52378
* capture whether a CharacterLiteral was wide or not in the AST. Chris Lattner2008-06-071-1/+3
| | | | | | Patch by Mike Stump! llvm-svn: 52081
* Fix <rdar://problem/5979875> clang on xcode: error: use of undeclared ↵Steve Naroff2008-06-021-0/+11
| | | | | | identifier 'super' llvm-svn: 51888
* Add basic support for properties references (a missing feature).Steve Naroff2008-05-301-0/+15
| | | | | | While it is far from complete, it does fix the following <rdar://problem/5967199> clang on xcode: error: member reference is not to a structure or union llvm-svn: 51719
* - Move ObjC Expresssion AST's from Expr.h => ExprObjC.hSteve Naroff2008-05-291-0/+1
| | | | | | - #include ExprObjC.h in many places llvm-svn: 51703
* Use pointer swizziling to unify in ObjCMessageExpr the receiver and ↵Ted Kremenek2008-05-011-3/+58
| | | | | | | | classname "fields". This saves us a pointer. Implemented serialization for ObjCMessageExpr. llvm-svn: 50528
* Extend InitListExpr API/IMPL to support arbitrary add/remove (in support of ↵Steve Naroff2008-05-011-6/+8
| | | | | | the initializer rewrite I am doing). llvm-svn: 50511
* Add support for C++ default arguments, and rework Parse-Sema Chris Lattner2008-04-081-0/+21
| | | | | | | | interaction for function parameters, fixing PR2046. Patch by Doug Gregor! llvm-svn: 49369
* Pass the ASTContext object around when deserializing Decl and Stmt objects, soSam Bishop2008-04-071-146/+149
| | | | | | they can be created using the same allocator as in the "from source code" case. llvm-svn: 49353
* Make a major restructuring of the clang tree: introduce a top-levelChris Lattner2008-03-151-0/+1001
lib dir and move all the libraries into it. This follows the main llvm tree, and allows the libraries to be built in parallel. The top level now enforces that all the libs are built before Driver, but we don't care what order the libs are built in. This speeds up parallel builds, particularly incremental ones. llvm-svn: 48402
OpenPOWER on IntegriCloud