summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHReaderStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reintroduce the serialization library, with fixed dependencies.Sebastian Redl2010-08-171-1775/+0
| | | | llvm-svn: 111279
* Revert Sebastian's build-breaking patch.Douglas Gregor2010-08-171-0/+1775
| | | | llvm-svn: 111265
* Create a new Serialization module that contains all the PCH code, and will ↵Sebastian Redl2010-08-171-1775/+0
| | | | | | contain all the module code in the future. Update the Makefiles, CMake projects and the Xcode project. I hope I did everything right for Xcode. No functionality change. llvm-svn: 111258
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-1/+7
| | | | llvm-svn: 110860
* Added TypeLocs to VAArgExpr node.Abramo Bagnara2010-08-101-0/+1
| | | | llvm-svn: 110666
* Added TypeLocs to TypesCompatibleExpr node.Abramo Bagnara2010-08-101-2/+2
| | | | llvm-svn: 110663
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-10/+17
| | | | | | | | | | | | | | | This takes some trickery since CastExpr has subclasses (and indeed, is abstract). Also, smoosh the CastKind into the bitfield from Expr. Drops two words of storage from Expr in the common case of expressions which don't need inheritance paths. Avoids a separate allocation and another word of overhead in cases needing inheritance paths. Also has the advantage of not leaking memory, since destructors for AST nodes are never run. llvm-svn: 110507
* Implement PCH support for offsetof(base-specifier).Argyrios Kyrtzidis2010-07-291-3/+5
| | | | llvm-svn: 109785
* Add source location information to C++ base specifiers.Nick Lewycky2010-07-261-2/+1
| | | | llvm-svn: 109396
* Thread bitstream cursors all the way through the AST reading stuff. This ↵Sebastian Redl2010-07-221-20/+22
| | | | | | way, reading a trivial 2-element chained file actually works. llvm-svn: 109191
* Support C++ try/catch statements for PCH.Argyrios Kyrtzidis2010-07-221-0/+31
| | | | llvm-svn: 109112
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-1/+1
| | | | llvm-svn: 108807
* First baby steps towards PCHReader being able to keep track of multiple PCH ↵Sebastian Redl2010-07-161-1/+1
| | | | | | files. WIP llvm-svn: 108537
* Downgrade the "when type is in parentheses, array cannot have dynamicDouglas Gregor2010-07-131-1/+4
| | | | | | | | | | | | size" error for code like new (int [size]) to a warning, add a Fix-It to remove the parentheses, and make this diagnostic work properly when it occurs in a template instantiation. <rdar://problem/8018245>. llvm-svn: 108242
* Add PCH support for the remaining C++ exprs.Argyrios Kyrtzidis2010-07-101-5/+42
| | | | llvm-svn: 108042
* Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.Argyrios Kyrtzidis2010-07-081-11/+59
| | | | llvm-svn: 107872
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-4/+4
| | | | | | suppressing copies of objects with trivial copy constructors. llvm-svn: 107857
* Revert r107828 and r107827, the fix for PR7556, which seems to beDouglas Gregor2010-07-071-4/+4
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-4/+4
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* Read/write CastExpr's CXXBaseSpecifierArray for PCH.Argyrios Kyrtzidis2010-07-021-0/+8
| | | | llvm-svn: 107542
* Fix broken PCH support for CXXDefaultArgExpr.Argyrios Kyrtzidis2010-07-021-6/+13
| | | | llvm-svn: 107541
* Support ParenListExpr for PCH.Argyrios Kyrtzidis2010-06-301-1/+17
| | | | llvm-svn: 107266
* When we know that we are at sub-statement reading (which is all of ↵Argyrios Kyrtzidis2010-06-291-87/+88
| | | | | | PCHStmtReader) use the "faster" ReadSubStmt. No functionality change. llvm-svn: 107218
* Modify the way sub-statements are stored and retrieved from PCH.Argyrios Kyrtzidis2010-06-281-469/+351
| | | | | | | | | | | | | | | Before this commit, sub-stmts were stored as encountered and when they were placed in the Stmts stack we had to know what index each stmt operand has. This complicated supporting variable sub-stmts and sub-stmts that were contained in TypeSourceInfos, e.g. x = sizeof(int[1]); would crash PCH. Now, sub-stmts are stored in reverse order, from last to first, so that when reading them, in order to get the next sub-stmt we just need to pop the last stmt from the stack. This greatly simplified the way stmts are written and read (just use PCHWriter::AddStmt and PCHReader::ReadStmt accordingly) and allowed variable stmt operands and TypeSourceInfo exprs. llvm-svn: 107087
* Support CXXPseudoDestructorExpr for PCH.Argyrios Kyrtzidis2010-06-281-0/+26
| | | | llvm-svn: 106999
* Support DependentScopeDeclRefExpr for PCH.Argyrios Kyrtzidis2010-06-281-0/+26
| | | | llvm-svn: 106998
* Refactor PCH reading/writing of template arguments passed to expressions.Argyrios Kyrtzidis2010-06-281-39/+43
| | | | llvm-svn: 106997
* Fix PCH emitting/reading for template arguments that contain expressions.Argyrios Kyrtzidis2010-06-281-8/+37
| | | | llvm-svn: 106996
* Support UnresolvedLookupExpr for PCH.Argyrios Kyrtzidis2010-06-251-0/+14
| | | | llvm-svn: 106832
* Support UnresolvedMemberExpr for PCH.Argyrios Kyrtzidis2010-06-251-2/+51
| | | | llvm-svn: 106831
* Support a couple more C++ Exprs for PCH.Argyrios Kyrtzidis2010-06-241-1/+57
| | | | llvm-svn: 106727
* Fix broken de/serialization for a couple of C++ Exprs.Argyrios Kyrtzidis2010-06-241-4/+7
| | | | llvm-svn: 106726
* Read/write CXXDeleteExpr from/to PCH.Argyrios Kyrtzidis2010-06-221-0/+14
| | | | llvm-svn: 106552
* Alter the internal representation of the condition variable inDouglas Gregor2010-06-211-4/+8
| | | | | | | | | | | | | | | | 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
* Added a field to BlockDeclRefExpr for future use.Fariborz Jahanian2010-06-041-1/+2
| | | | | | No functionality change yet. llvm-svn: 105479
* Implement semantic analysis and an AST representation for the namedDouglas Gregor2010-05-151-0/+1
| | | | | | | | | | | | return value optimization. Sema marks return statements with their NRVO candidates (which may or may not end up using the NRVO), then, at the end of a function body, computes and marks those variables that can be allocated into the return slot. I've checked this locally with some debugging statements (not committed), but there won't be any tests until CodeGen comes along. llvm-svn: 103865
* Recognize when the named return value optimization applies in aDouglas Gregor2010-05-151-0/+1
| | | | | | | | | | "return" statement and mark the corresponding CXXConstructExpr as elidable. Teach CodeGen that eliding a temporary is different from eliding an object construction. This is just a baby step toward NRVO. llvm-svn: 103849
* Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ↵Ted Kremenek2010-05-101-1/+1
| | | | | | ASTContext's allocator. Fixes <rdar://problem/7961605>. llvm-svn: 103421
* pch'ify CXXNewExpr and CXXZeroInitValueExprChris Lattner2010-05-101-0/+47
| | | | llvm-svn: 103390
* pchify CXXTemporary, CXXBindTemporaryExpr, and Chris Lattner2010-05-101-1/+31
| | | | | | CXXExprWithTemporaries. llvm-svn: 103387
* pch'ify default argument definitions and uses.Chris Lattner2010-05-091-1/+16
| | | | llvm-svn: 103376
* pch'ify 'this' and 'throw'Chris Lattner2010-05-091-0/+20
| | | | llvm-svn: 103375
* pch'ify typeid.Chris Lattner2010-05-091-0/+20
| | | | llvm-svn: 103374
* pchify CXXMemberCallExpr correctly. Before it would serializeChris Lattner2010-05-091-0/+4
| | | | | | | and deserialize as a CallExpr which is close, but ends up deserializing with the wrong stmt class. llvm-svn: 103371
* Teach __builtin_offsetof to compute the offsets of members of baseDouglas Gregor2010-04-291-0/+5
| | | | | | | | classes, since we only warn (not error) on offsetof() for non-POD types. We store the base path within the OffsetOfExpr itself, then evaluate the offsets within the constant evaluator. llvm-svn: 102571
* Completely reimplement __builtin_offsetof, based on a patch by RobertoDouglas Gregor2010-04-281-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amadini. This change introduces a new expression node type, OffsetOfExpr, that describes __builtin_offsetof. Previously, __builtin_offsetof was implemented using a unary operator whose subexpression involved various synthesized array-subscript and member-reference expressions, which was ugly and made it very hard to instantiate as a template. OffsetOfExpr represents the AST more faithfully, with proper type source information and a more compact representation. OffsetOfExpr also has support for dependent __builtin_offsetof expressions; it can be value-dependent, but will never be type-dependent (like sizeof or alignof). This commit introduces template instantiation for __builtin_offsetof as well. There are two major caveats to this patch: 1) CodeGen cannot handle the case where __builtin_offsetof is not a constant expression, so it produces an error. So, to avoid regressing in C, we retain the old UnaryOperator-based __builtin_offsetof implementation in C while using the shiny new OffsetOfExpr implementation in C++. The old implementation can go away once we have proper CodeGen support for this case, which we expect won't cause much trouble in C++. 2) __builtin_offsetof doesn't work well with non-POD class types, particularly when the designated field is found within a base class. I will address this in a subsequent patch. Fixes PR5880 and a bunch of assertions when building Boost.Python tests. llvm-svn: 102542
* Make the static type of the exception variable in an Objective-CDouglas Gregor2010-04-261-1/+1
| | | | | | | @catch a VarDecl. The dynamic type is still a ParmVarDecl, but that will change soon. No effective functionality change. llvm-svn: 102341
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-231-8/+19
| | | | | | | | | | 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
* Overhaul the AST representation of Objective-C message sendDouglas Gregor2010-04-211-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expressions, to improve source-location information, clarify the actual receiver of the message, and pave the way for proper C++ support. The ObjCMessageExpr node represents four different kinds of message sends in a single AST node: 1) Send to a object instance described by an expression (e.g., [x method:5]) 2) Send to a class described by the class name (e.g., [NSString method:5]) 3) Send to a superclass class (e.g, [super method:5] in class method) 4) Send to a superclass instance (e.g., [super method:5] in instance method) Previously these four cases where tangled together. Now, they have more distinct representations. Specific changes: 1) Unchanged; the object instance is represented by an Expr*. 2) Previously stored the ObjCInterfaceDecl* referring to the class receiving the message. Now stores a TypeSourceInfo* so that we know how the class was spelled. This both maintains typedef information and opens the door for more complicated C++ types (e.g., dependent types). There was an alternative, unused representation of these sends by naming the class via an IdentifierInfo *. In practice, we either had an ObjCInterfaceDecl *, from which we would get the IdentifierInfo *, or we fell into the case below... 3) Previously represented by a class message whose IdentifierInfo * referred to "super". Sema and CodeGen would use isStr("super") to determine if they had a send to super. Now represented as a "class super" send, where we have both the location of the "super" keyword and the ObjCInterfaceDecl* of the superclass we're targetting (statically). 4) Previously represented by an instance message whose receiver is a an ObjCSuperExpr, which Sema and CodeGen would check for via isa<ObjCSuperExpr>(). Now represented as an "instance super" send, where we have both the location of the "super" keyword and the ObjCInterfaceDecl* of the superclass we're targetting (statically). Note that ObjCSuperExpr only has one remaining use in the AST, which is for "super.prop" references. The new representation of ObjCMessageExpr is 2 pointers smaller than the old one, since it combines more storage. It also eliminates a leak when we loaded message-send expressions from a precompiled header. The representation also feels much cleaner to me; comments welcome! This patch attempts to maintain the same semantics we previously had with Objective-C message sends. In several places, there are massive changes that boil down to simply replacing a nested-if structure such as: if (message has a receiver expression) { // instance message if (isa<ObjCSuperExpr>(...)) { // send to super } else { // send to an object } } else { // class message if (name->isStr("super")) { // class send to super } else { // send to class } } with a switch switch (E->getReceiverKind()) { case ObjCMessageExpr::SuperInstance: ... case ObjCMessageExpr::Instance: ... case ObjCMessageExpr::SuperClass: ... case ObjCMessageExpr::Class:... } There are quite a few places (particularly in the checkers) where send-to-super is effectively ignored. I've placed FIXMEs in most of them, and attempted to address send-to-super in a reasonable way. This could use some review. llvm-svn: 101972
* Keep proper source location information for the type in an Objective-CDouglas Gregor2010-04-201-1/+1
| | | | | | @encode expression. llvm-svn: 101907
OpenPOWER on IntegriCloud