summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Do a proper recursive lookup when deciding whether a class's usualJohn McCall2011-01-271-3/+5
| | | | | | | | | deallocation function has a two-argument form. Store the result of this check in new[] and delete[] nodes. Fixes rdar://problem/8913519 llvm-svn: 124373
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-191-1/+1
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,Douglas Gregor2011-01-151-0/+28
| | | | | | | | | that captures the substitution of a non-type template argument pack for a non-type template parameter pack within a pack expansion that cannot be fully expanded. This follows the approach taken by SubstTemplateTypeParmPackType. llvm-svn: 123506
* Add the location of the right parenthesis of a C++ named castDouglas Gregor2011-01-121-8/+15
| | | | | | | (static_cast, dynamic_cast, reinterpret_cast, or const_cast) to improve source-location information. Fixes PR8960. llvm-svn: 123336
* Implement the sizeof...(pack) expression to compute the length of aDouglas Gregor2011-01-041-0/+12
| | | | | | | | | parameter pack. Note that we're missing proper libclang support for the new SizeOfPackExpr expression node. llvm-svn: 122813
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-031-0/+12
| | | | | | | | | | | | | | | | | template argument (described by an expression, of course). For example: template<int...> struct int_tuple { }; template<int ...Values> struct square { typedef int_tuple<(Values*Values)...> type; }; It also lays the foundation for pack expansions in an initializer-list. llvm-svn: 122751
* Variadic templates: extend the Expr class with a bit that specifiesDouglas Gregor2010-12-151-85/+182
| | | | | | | | | | | | | | | | | | whether the expression contains an unexpanded parameter pack, in the same vein as the changes to the Type hierarchy. Compute this bit within all of the Expr subclasses. This change required a bunch of reshuffling of dependency calculations, mainly to consolidate them inside the constructors and to fuse multiple loops that iterate over arguments to determine type dependence, value dependence, and (now) containment of unexpanded parameter packs. Again, testing is painfully sparse, because all of the diagnostics will change and it is more important to test the to-be-written visitor that collects unexpanded parameter packs. llvm-svn: 121831
* Restore r121752 without modification.John McCall2010-12-141-0/+19
| | | | llvm-svn: 121763
* Pull out r121752 in case it's causing the selfhost breakage.John McCall2010-12-141-19/+0
| | | | llvm-svn: 121759
* Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall2010-12-141-0/+19
| | | | | | | class to be passed around. The line between argument and return types and everything else is kindof vague, but I think it's justifiable. llvm-svn: 121752
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-071-0/+8
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-14/+14
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Add an assertion, fix a whole bunch of bugs, comment the assertionJohn McCall2010-11-181-1/+1
| | | | | | out because there are still bugs left. llvm-svn: 119722
* Calculate the value kind of an expression when it's created andJohn McCall2010-11-181-13/+21
| | | | | | | | | | | | | store it on the expression node. Also store an "object kind", which distinguishes ordinary "addressed" l-values (like variable references and pointer dereferences) and bitfield, @property, and vector-component l-values. Currently we're not using these for much, but I aim to switch pretty much everything calculating l-valueness over to them. For now they shouldn't necessarily be trusted. llvm-svn: 119685
* Have CXXDeleteExpr::getDestroyedType return the actual destroyed typeCraig Silverstein2010-11-161-2/+3
| | | | | | | | | | | | | | | | | | | in more situations. In particular, for code like template<class T> void Fn() { T* x; delete x; } getDestroyedType() will now return T rather than T*, as it would before this change. On the other hand, for code like this: template<class T> void Fn() { T x; delete x; } getDestroyedType() will return an empty QualType(), since it doesn't know what the actual destroyed type would be. Previously, it would return T. OKed by rjmccall llvm-svn: 119334
* Improve source-location information for CXXConstructExpr nodes, byDouglas Gregor2010-11-031-3/+16
| | | | | | | | | ensuring that they cover all of their child nodes. There's still a clang_getCursor()-related issue with CXXFunctionalCastExprs with CXXConstructExprs as children (see FIXME in the test case); I'll look at that separately. llvm-svn: 118132
* Fixes an assertion violation when bind to temporaryFariborz Jahanian2010-11-021-1/+3
| | | | | | | expression is a dependent expression. // rdar: // 8620524 and PR7851 llvm-svn: 118066
* Rename alignof -> alignOf to avoid irritating C++'0x compilers,Chris Lattner2010-10-301-6/+6
| | | | | | PR8423 llvm-svn: 117775
* Add helper for extracting the CXXRecordDecl for the implicit argument toChandler Carruth2010-10-271-0/+11
| | | | | | | a member call expression. This has proved to be a common pattern for users of RecursiveASTVisitor. llvm-svn: 117439
* Improve the tracking of source locations for parentheses in constructor calls.Chandler Carruth2010-10-251-21/+21
| | | | | | | | | | | | This adds them where missing, and traces them through PCH. We fix at least one bug in the extents found by the Index library, and make a lot of refactoring tools which care about the exact formulation of a constructor call easier to write. Also some minor cleanups to more consistently follow the friend pattern instead of the setter pattern when rebuilding a serialized AST. Patch originally by Samuel Benzaquen. llvm-svn: 117254
* Had the wrong type for ArgType. :-( Fixed.Craig Silverstein2010-10-201-1/+1
| | | | llvm-svn: 116893
* The type-to-delete may not be a pointer if it's a dependent type.Craig Silverstein2010-10-201-1/+5
| | | | | | | | | | | | | | | | Here's example code: --- template<class T> class MyClass { struct S { }; S* NewS() { return new S; } void DeleteS() { delete NewS(); } }; --- CXXDeleteExpr::getDestroyedType() on the 'delete NewS()' expression would crash before this change. Now it returns a dependent type object. Solution suggested by dgregor. llvm-svn: 116891
* When marking the declarations in a default argument expression asDouglas Gregor2010-09-141-0/+13
| | | | | | | | | "used", at the time that the default argument itself is used, also mark destructors that will be called by this expression. This fixes a regression that I introduced in r113700, which broke WebKit, and fixes <rdar://problem/8427926>. llvm-svn: 113883
* Eagerly evaluate type traits in Sema instead of lazily in AST. They actually ↵Sebastian Redl2010-09-131-198/+0
| | | | | | need Sema access to be correct, fixes coming up. llvm-svn: 113782
* Define and implement CXXNoexceptExpr. Create it in Sema.Sebastian Redl2010-09-101-0/+7
| | | | llvm-svn: 113623
* Add proper type-source information to UnaryTypeTraitExpr, includingDouglas Gregor2010-09-091-28/+27
| | | | | | libclang visitation. llvm-svn: 113492
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-081-0/+16
| | | | llvm-svn: 113356
* Provide proper type-source location information forDouglas Gregor2010-09-081-14/+27
| | | | | | | | CXXTemporaryObjectExpr, CXXScalarValueInitExpr, and CXXUnresolvedConstructExpr, getting rid of a bunch of FIXMEs in the process. llvm-svn: 113319
* Improve source-location information for CXXNewExpr, by hanging on toDouglas Gregor2010-09-071-1/+3
| | | | | | the TypeSourceInfo for the allocated type. Fixes PR7501. llvm-svn: 113291
* Implement __has_virtual_destructor. Patch by Steven Watanabe.Sebastian Redl2010-09-021-0/+10
| | | | llvm-svn: 112905
* Eliminate CXXBindReferenceExpr, which was used in a ton ofDouglas Gregor2010-09-021-17/+0
| | | | | | well-intentioned but completely unused code. llvm-svn: 112868
* Implement the __has_nothrow trait family, by Steven Watanabe.Sebastian Redl2010-08-311-0/+102
| | | | llvm-svn: 112577
* Regularize the API for accessing explicit template arguments.John McCall2010-08-191-1/+1
| | | | llvm-svn: 111584
* Added locations and type source info for DeclarationName.Abramo Bagnara2010-08-111-31/+24
| | | | llvm-svn: 110860
* Store inheritance paths after CastExprs instead of inside them.John McCall2010-08-071-0/+94
| | | | | | | | | | | | | | | 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
* Remove a bunch of trivial destructorsDouglas Gregor2010-07-251-2/+0
| | | | llvm-svn: 109382
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-47/+0
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* Downgrade the "when type is in parentheses, array cannot have dynamicDouglas Gregor2010-07-131-3/+3
| | | | | | | | | | | | 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-8/+0
| | | | llvm-svn: 108042
* 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
* Support DependentScopeDeclRefExpr for PCH.Argyrios Kyrtzidis2010-06-281-0/+13
| | | | llvm-svn: 106998
* Support UnresolvedLookupExpr for PCH.Argyrios Kyrtzidis2010-06-251-0/+12
| | | | llvm-svn: 106832
* Support UnresolvedMemberExpr for PCH.Argyrios Kyrtzidis2010-06-251-2/+23
| | | | llvm-svn: 106831
* Support a couple more C++ Exprs for PCH.Argyrios Kyrtzidis2010-06-241-0/+31
| | | | llvm-svn: 106727
* Move OverloadExpr over to a ASTContext-allocated pointer for itsDouglas Gregor2010-05-231-4/+26
| | | | | | storage, rather than an UnresolvedSet. llvm-svn: 104469
* Provide the overloaded functions for UnresolvedLookupExpr andDouglas Gregor2010-05-231-6/+13
| | | | | | | UnresolvedMemberExpr in their constructors, rather than adding them after the fact. No functionality change. llvm-svn: 104468
* Renamed misleading getSourceRange -> getLocalSourceRange and ↵Abramo Bagnara2010-05-201-2/+2
| | | | | | getFullSourceRange -> getSourceRange for TypeLoc. llvm-svn: 104220
* Convert CXXTempory[] in CXXExprWithTemporaries to be allocated using ↵Ted Kremenek2010-05-101-10/+9
| | | | | | ASTContext's allocator. Fixes <rdar://problem/7961605>. llvm-svn: 103421
OpenPOWER on IntegriCloud