summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-8/+0
| | | | | | | | | | | | | | | | | All statements that involve conditions can now hold on to a separate condition declaration (a VarDecl), and will use a DeclRefExpr referring to that VarDecl for the condition expression. ForStmts now have such a VarDecl (I'd missed those in previous commits). Also, since this change reworks the Action interface for if/while/switch/for, use FullExprArg for the full expressions in those expressions, to ensure that we're emitting Note that we are (still) not generating the right cleanups for condition variables in for statements. That will be a follow-on commit. llvm-svn: 89817
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-241-55/+58
| | | | | | | | | | | | DependentScopeDeclRefExpr support storing templateids. Unite the common code paths between ActOnDeclarationNameExpr and ActOnTemplateIdExpr. This gets us to a point where we don't need to store function templates in the AST using TemplateNames, which is critical to ripping out OverloadedFunction. Also resolves a few FIXMEs. llvm-svn: 89785
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-48/+24
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* "Incremental" progress on using expressions, by which I mean totally rippingJohn McCall2009-11-211-3/+3
| | | | | | | | | | | | | | | | | | | | | | into pretty much everything about overload resolution in order to wean BuildDeclarationNameExpr off LookupResult::getAsSingleDecl(). Replace UnresolvedFunctionNameExpr with UnresolvedLookupExpr, which generalizes the idea of a non-member lookup that we haven't totally resolved yet, whether by overloading, argument-dependent lookup, or (eventually) the presence of a function template in the lookup results. Incidentally fixes a problem with argument-dependent lookup where we were still performing ADL even when the lookup results contained something from a block scope. Incidentally improves a diagnostic when using an ObjC ivar from a class method. This just fell out from rewriting BuildDeclarationNameExpr's interaction with lookup, and I'm too apathetic to break it out. The only remaining uses of OverloadedFunctionDecl that I know of are in TemplateName and MemberExpr. llvm-svn: 89544
* Draw a brighter line between "unresolved" expressions, where we have done theJohn McCall2009-11-191-13/+13
| | | | | | | | appropriate lookup and simply can't resolve the referrent yet, and "dependent scope" expressions, where we can't do the lookup yet because the entity we need to look into is a dependent type. llvm-svn: 89402
* Improve source-location information for implicitly-generated member call ↵Douglas Gregor2009-11-121-0/+8
| | | | | | expressions llvm-svn: 86989
* Track source information for template arguments and template specializationJohn McCall2009-10-291-13/+13
| | | | | | | types. Preserve it through template instantiation. Preserve it through PCH, although TSTs themselves aren't serializable, so that's pretty much meaningless. llvm-svn: 85500
* Improve handling of initialization by constructor, by ensuring thatDouglas Gregor2009-09-091-15/+13
| | | | | | | | such initializations properly convert constructor arguments and fill in default arguments where necessary. This also makes the ownership model more clear. llvm-svn: 81394
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-58/+53
| | | | llvm-svn: 81346
* Initial stab at implement dependent member references to memberDouglas Gregor2009-09-091-0/+71
| | | | | | | | | | | | | templates, e.g., x.template get<T> We can now parse these, represent them within an UnresolvedMemberExpr expression, then instantiate that expression node in simple cases. This allows us to stumble through parsing LLVM's Casting.h. llvm-svn: 81300
* Clean up the CXXConstructExpr constructor, add Arg getters.Anders Carlsson2009-09-081-7/+14
| | | | llvm-svn: 81178
* Reapply 81096, now with a fix. Spot the bug:Anders Carlsson2009-09-061-0/+2
| | | | | | | | | for (unsigned i = numargs; i < NumArgs; ++i) Args[0] = 0; ;) llvm-svn: 81123
* Revert "Initialize default CXXConstructExpr arguments to 0. Fixes a crash whenDaniel Dunbar2009-09-061-2/+0
| | | | | | | destroying the CXXConstructExpr.", this is causing test failures across the board. llvm-svn: 81100
* Initialize default CXXConstructExpr arguments to 0. Fixes a crash when ↵Anders Carlsson2009-09-051-0/+2
| | | | | | destroying the CXXConstructExpr. llvm-svn: 81096
* Implement AST, semantics, and CodeGen for C++ pseudo-destructorDouglas Gregor2009-09-041-0/+6
| | | | | | | | | | | | | expressions, e.g., p->~T() when p is a pointer to a scalar type. We don't currently diagnose errors when pseudo-destructor expressions are used in any way other than by forming a call. llvm-svn: 81009
* Implement __is_empty. Patch by Sean Hunt.Eli Friedman2009-08-151-0/+6
| | | | llvm-svn: 79143
* Get rid of Stmt::Clone now that we can reference count statements instead.Anders Carlsson2009-08-081-22/+0
| | | | llvm-svn: 78452
* Separate Stmt::Destroy into the entrypoint for destroying a statementDouglas Gregor2009-08-071-14/+8
| | | | | | | or expression (Destroy) from the virtual function used to actually destroy a given expression (DoDestroy). llvm-svn: 78375
* Support for use of default argument in constructors.Fariborz Jahanian2009-08-051-1/+5
| | | | | | work in progress. llvm-svn: 78132
* Change uses of:Ted Kremenek2009-07-291-7/+7
| | | | | | | | | | | | | | | | | | | | Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsRecordType() -> Type::getAs<RecordType>() Type::getAsPointerType() -> Type::getAs<PointerType>() Type::getAsBlockPointerType() -> Type::getAs<BlockPointerType>() Type::getAsLValueReferenceType() -> Type::getAs<LValueReferenceType>() Type::getAsRValueReferenceType() -> Type::getAs<RValueReferenceType>() Type::getAsMemberPointerType() -> Type::getAs<MemberPointerType>() Type::getAsReferenceType() -> Type::getAs<ReferenceType>() Type::getAsTagType() -> Type::getAs<TagType>() And remove Type::getAsReferenceType(), etc. This change is similar to one I made a couple weeks ago, but that was partly reverted pending some additional design discussion. With Doug's pending smart pointer changes for Types, it seemed natural to take this approach. llvm-svn: 77510
* This patch fixes the implementations of the __has_trivial_destructorDouglas Gregor2009-07-231-3/+50
| | | | | | | | and __has_trivial_constructor builtin pseudo-functions and additionally implements __has_trivial_copy and __has_trivial_assign, from John McCall! llvm-svn: 76916
* Per offline discussion with Steve Naroff, add back Type::getAsXXXType() methodsTed Kremenek2009-07-171-5/+5
| | | | | | | | | until Doug Gregor's Type smart pointer code lands (or more discussion occurs). These methods just call the new Type::getAs<XXX> methods, so we still have reduced implementation redundancy. Having explicit getAsXXXType() methods makes it easier to set breakpoints in the debugger. llvm-svn: 76193
* Replaced Type::getAsLValueReferenceType(), Type::getAsRValueReferenceType(), ↵Ted Kremenek2009-07-171-5/+5
| | | | | | Type::getAsMemberPointerType(), Type::getAsTagType(), and Type::getAsRecordType() with their Type::getAs<XXX> equivalents. llvm-svn: 76139
* Preliminary parsing and ASTs for template-ids that refer to functionDouglas Gregor2009-06-301-0/+60
| | | | | | | templates, such as make<int&>. These template-ids are only barely functional for function calls; much more to come. llvm-svn: 74563
* Handle temporaries in default arguments.Anders Carlsson2009-06-161-4/+5
| | | | llvm-svn: 73462
* Improvements to CXXExprWithTemporaries in preparation for fixing a bug with ↵Anders Carlsson2009-06-051-4/+7
| | | | | | default arguments that have temporaries. llvm-svn: 72944
* Clean up the newly added C++ AST nodes.Anders Carlsson2009-05-301-2/+25
| | | | llvm-svn: 72643
* Stop using CXXTempVarDecl and use CXXTemporary instead.Anders Carlsson2009-05-301-8/+8
| | | | llvm-svn: 72634
* Remove VarDecl from CXXConstructExpr.Anders Carlsson2009-05-301-10/+8
| | | | llvm-svn: 72633
* Small fixes to CXXTemporary and CXXBindTemporaryExpr.Anders Carlsson2009-05-301-2/+2
| | | | llvm-svn: 72628
* Add a CXXBindTemporaryExpr.Anders Carlsson2009-05-301-0/+18
| | | | llvm-svn: 72627
* Add a CXXTemporary class. Not used yet.Anders Carlsson2009-05-301-0/+6
| | | | llvm-svn: 72626
* Representation of and template instantiation for memberDouglas Gregor2009-05-221-0/+8
| | | | | | | | | | | | expressions. This change introduces another AST node, CXXUnresolvedMemberExpr, that captures member references (x->m, x.m) when the base of the expression (the "x") is type-dependent, and we therefore cannot resolve the member reference yet. Note that our parsing of member references for C++ is still quite poor, e.g., we don't handle x->Base::m or x->operator int. llvm-svn: 72281
* Template instantiation for the various kinds of AST nodes that occurDouglas Gregor2009-05-201-0/+4
| | | | | | due to C++ type construction of the form T(a1, a2, ..., aN). llvm-svn: 72183
* Introduce a new expression type, CXXUnresolvedConstructExpr, toDouglas Gregor2009-05-201-0/+39
| | | | | | | | | | | | | | | | | | describe the construction of a value of a given type using function syntax, e.g., T(a1, a2, ..., aN) when the type or any of its arguments are type-dependent. In this case, we don't know what kind of type-construction this will be: it might construct a temporary of type 'T' (which might be a class or non-class type) or might perform a conversion to type 'T'. Also, implement printing of and template instantiation for this new expression type. Due to the change in Sema::ActOnCXXTypeConstructExpr, our existing tests cover template instantiation of this new expression node. llvm-svn: 72176
* Template instantiation for call expressions.Douglas Gregor2009-05-191-0/+5
| | | | llvm-svn: 72081
* Implement instantiation of a few boring, simple expressions. I don't think ↵Sebastian Redl2009-05-161-0/+12
| | | | | | these are testable yet, though. llvm-svn: 71953
* Implement C++0x nullptr.Sebastian Redl2009-05-101-0/+8
| | | | llvm-svn: 71405
* Get rid of CXXDestroyExpr.Anders Carlsson2009-05-011-16/+6
| | | | llvm-svn: 70586
* Rename CXXExprWithCleanup to CXXExprWithTemporaries.Anders Carlsson2009-05-011-7/+8
| | | | llvm-svn: 70584
* Silence gcc warnings.Eli Friedman2009-04-251-1/+1
| | | | llvm-svn: 70086
* Add CXXExprWithCleanupAnders Carlsson2009-04-241-0/+21
| | | | llvm-svn: 70000
* Make CXXTemporaryObjectExpr inherit from CXXConstructExpr.Anders Carlsson2009-04-241-23/+3
| | | | llvm-svn: 69981
* Add an ASTContext parameter to CXXTemporaryObjectExpr.Anders Carlsson2009-04-241-1/+1
| | | | llvm-svn: 69959
* Add a VarDecl parameter to the CXXTemporaryObjectExpr constructor. It's ↵Anders Carlsson2009-04-241-1/+2
| | | | | | unused for now, so no functionality change yet. Also, create CXXTempVarDecls to pass to the CXXTemporaryObjectExpr ctor. llvm-svn: 69957
* Make the CXXConstructExpr public and add a StmtClass to it. No functionality ↵Anders Carlsson2009-04-241-3/+4
| | | | | | change. llvm-svn: 69954
* Add a CXXConstructExpr that represents an implicit call to a C++ ↵Anders Carlsson2009-04-231-0/+40
| | | | | | constructor. I think CXXTemporaryObjectExpr is going to become a subclass of CXXConstructExpr, since CXXTemporaryObjectExpr represents a syntactic temporary, for example T() llvm-svn: 69854
* Add a CXXDestroyExpr. Add classof member functions to CXXTempVarDecl.Anders Carlsson2009-04-211-0/+14
| | | | llvm-svn: 69654
* Add support for the __has_trivial_destructor type trait.Anders Carlsson2009-04-171-1/+5
| | | | llvm-svn: 69345
* Add support for the __has_trivial_constructor type trait.Anders Carlsson2009-04-161-0/+4
| | | | llvm-svn: 69245
OpenPOWER on IntegriCloud