summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/PCHWriterStmt.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement PCH support for offsetof(base-specifier).Argyrios Kyrtzidis2010-07-291-2/+1
| | | | llvm-svn: 109785
* Support C++ try/catch statements for PCH.Argyrios Kyrtzidis2010-07-221-0/+21
| | | | llvm-svn: 109112
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-1/+1
| | | | llvm-svn: 108807
* Downgrade the "when type is in parentheses, array cannot have dynamicDouglas Gregor2010-07-131-1/+1
| | | | | | | | | | | | 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-0/+27
| | | | llvm-svn: 108042
* Read/write the C++ parts of DeclRefExpr and MemberExpr for PCH.Argyrios Kyrtzidis2010-07-081-5/+39
| | | | llvm-svn: 107872
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-3/+3
| | | | | | 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-3/+3
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-3/+3
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* Read/write CastExpr's CXXBaseSpecifierArray for PCH.Argyrios Kyrtzidis2010-07-021-0/+5
| | | | llvm-svn: 107542
* Fix broken PCH support for CXXDefaultArgExpr.Argyrios Kyrtzidis2010-07-021-6/+7
| | | | llvm-svn: 107541
* Support ParenListExpr for PCH.Argyrios Kyrtzidis2010-06-301-1/+12
| | | | llvm-svn: 107266
* Modify the way sub-statements are stored and retrieved from PCH.Argyrios Kyrtzidis2010-06-281-148/+105
| | | | | | | | | | | | | | | 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/+23
| | | | llvm-svn: 106999
* Support DependentScopeDeclRefExpr for PCH.Argyrios Kyrtzidis2010-06-281-0/+24
| | | | llvm-svn: 106998
* Refactor PCH reading/writing of template arguments passed to expressions.Argyrios Kyrtzidis2010-06-281-48/+56
| | | | llvm-svn: 106997
* Fix PCH emitting/reading for template arguments that contain expressions.Argyrios Kyrtzidis2010-06-281-0/+42
| | | | llvm-svn: 106996
* Make PCHWriter::FlushStmts() robust. If we added null Stmts, reading them ↵Argyrios Kyrtzidis2010-06-251-0/+1
| | | | | | back got messed up. llvm-svn: 106859
* Support UnresolvedLookupExpr for PCH.Argyrios Kyrtzidis2010-06-251-0/+9
| | | | llvm-svn: 106832
* Support UnresolvedMemberExpr for PCH.Argyrios Kyrtzidis2010-06-251-0/+42
| | | | llvm-svn: 106831
* Print source location when we encounter unhandled statement during PCH writing.Argyrios Kyrtzidis2010-06-251-1/+3
| | | | llvm-svn: 106830
* Support a couple more C++ Exprs for PCH.Argyrios Kyrtzidis2010-06-241-2/+48
| | | | llvm-svn: 106727
* Fix broken de/serialization for a couple of C++ Exprs.Argyrios Kyrtzidis2010-06-241-3/+3
| | | | llvm-svn: 106726
* Read/write CXXDeleteExpr from/to PCH.Argyrios Kyrtzidis2010-06-221-0/+11
| | | | llvm-svn: 106552
* Added a field to BlockDeclRefExpr for future use.Fariborz Jahanian2010-06-041-0/+1
| | | | | | 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
* pch'ify CXXNewExpr and CXXZeroInitValueExprChris Lattner2010-05-101-2/+38
| | | | llvm-svn: 103390
* pchify CXXTemporary, CXXBindTemporaryExpr, and Chris Lattner2010-05-101-2/+26
| | | | | | CXXExprWithTemporaries. llvm-svn: 103387
* pch'ify default argument definitions and uses.Chris Lattner2010-05-091-0/+15
| | | | llvm-svn: 103376
* pch'ify 'this' and 'throw'Chris Lattner2010-05-091-0/+16
| | | | llvm-svn: 103375
* pch'ify typeid.Chris Lattner2010-05-091-0/+13
| | | | llvm-svn: 103374
* pchify CXXMemberCallExpr correctly. Before it would serializeChris Lattner2010-05-091-0/+6
| | | | | | | 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/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Improve the AST representation of Objective-C @try/@catch/@finallyDouglas Gregor2010-04-231-3/+6
| | | | | | | | | | 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-10/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Extend ObjCMessageExpr for class method sends with the source locationDouglas Gregor2010-03-081-2/+3
| | | | | | of the class name. llvm-svn: 97943
* Roll r95513 back in.Sam Weinig2010-02-071-0/+15
| | | | llvm-svn: 95515
* Roll out r95513, it seems to have broken self hosting.Sam Weinig2010-02-071-15/+0
| | | | llvm-svn: 95514
* Add PCH support for CXXBoolLiteralExpr and CXXNullPtrLiteralExpr.Sam Weinig2010-02-071-0/+15
| | | | llvm-svn: 95513
* Use IdentifierInfo * instead of std::string for the AsmStmt names.Anders Carlsson2010-01-301-3/+3
| | | | llvm-svn: 94925
* Preserve type source information in compound literal expressions.John McCall2010-01-181-0/+1
| | | | | | Patch by Enea Zaffanella! llvm-svn: 93752
* Add PCH support for CXXStaticCastExpr, CXXDynamicCastExpr, ↵Sam Weinig2010-01-161-0/+38
| | | | | | CXXReinterpretCastExpr, CXXConstCastExpr and CXXFunctionalCastExpr. llvm-svn: 93658
* Preserve type source information in explicit cast expressions.John McCall2010-01-151-1/+1
| | | | | | Patch by Enea Zaffanella. llvm-svn: 93522
* Remember if the AsmStmt came from Microsoft-style inline assembly code.Mike Stump2010-01-041-0/+1
| | | | llvm-svn: 92526
* When value-initializing a class with no user-defined constructors butDouglas Gregor2009-12-161-0/+1
| | | | | | | with a non-trivial default constructor, zero-initialize the storage and then call the default constructor. Fixes PR5800. llvm-svn: 91548
* Switch the C++ new expression over to InitializationSequence, ratherDouglas Gregor2009-12-161-0/+1
| | | | | | | | | | | | | | | | | | | | | than using its own partial implementation of initialization. Switched CheckInitializerTypes over to InitializedEntity/InitializationKind, to help move us closer to InitializationSequence. Added InitializedEntity::getName() to retrieve the name of the entity, for diagnostics that care about such things. Implemented support for default initialization in InitializationSequence. Clean up the determination of the "source expressions" for an initialization sequence in InitializationSequence::Perform. Taught CXXConstructExpr to store more location information. llvm-svn: 91492
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-1/+1
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
OpenPOWER on IntegriCloud