summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Fix refacto in r103387, noticed by Christopher Jefferson.Daniel Dunbar2010-05-101-1/+1
| | | | llvm-svn: 103406
* pch'ify CXXNewExpr and CXXZeroInitValueExprChris Lattner2010-05-101-5/+15
| | | | llvm-svn: 103390
* fix refactor-oChris Lattner2010-05-101-1/+1
| | | | llvm-svn: 103388
* pchify CXXTemporary, CXXBindTemporaryExpr, and Chris Lattner2010-05-101-5/+14
| | | | | | CXXExprWithTemporaries. llvm-svn: 103387
* Change CXXConstructExpr::Create to take a ConstructionKind.Anders Carlsson2010-05-021-3/+2
| | | | llvm-svn: 102884
* Add an enum to CXXConstructExpr so we can determine if the construction ↵Anders Carlsson2010-05-021-5/+6
| | | | | | expression constructs a non-virtual or virtual base. llvm-svn: 102879
* When explicitly building a temporary object (CXXTemporaryObjectExpr),Douglas Gregor2010-04-271-2/+3
| | | | | | | | | | | keep track of whether we need to zero-initialize storage prior to calling its constructor. Previously, we were only tracking this when implicitly constructing the object (a CXXConstructExpr). Fixes Boost's value-initialization tests, which means that the Boost.Config library now passes all of its tests. llvm-svn: 102461
* During template instantiation, set the naming class ofDouglas Gregor2010-04-271-8/+8
| | | | | | | | | | | | | | | | | | | UnresolvedLookupExpr and UnresolvedMemberExpr by substituting the naming class we computed when building the expression in the template... ... which we didn't always do correctly. Teach UnresolvedMemberExpr::getNamingClass() all about the new representation of injected-class-names in templates, so that it can return a naming class that is the current instantiation. Also, when decomposing a template-id into its template name and its arguments, be sure to set the naming class on the LookupResult structure. Fixes PR6947 the right way. llvm-svn: 102448
* Improve source-location information in a C++ typeid (type) expressionDouglas Gregor2010-04-261-2/+11
| | | | | | | | | | | | | | | | | by using TypeSourceInfo, cleaning up the representation somewhat. Teach getTypeOperand() to strip references and cv-qualifiers, providing the semantic view of the type without requiring any extra storage (the unmodified type remains within the TypeSourceInfo). This fixes a bug found by Boost's call_traits test. Finally, clean up semantic analysis, by splitting the ActOnCXXTypeid routine into ActOnCXXTypeId (the parser action) and two BuildCXXTypeId functions, which perform the semantic analysis for typeid(type) and typeid(expression), respectively. We now perform less work at template instantiation time (we don't look for std::type_info again) and can give better diagnostics. llvm-svn: 102393
* Use the naming class from the overloaded lookup when access-checking anJohn McCall2010-04-221-0/+7
| | | | | | | | | | address of overloaded function, instead of assuming that a nested name specifier was used. A nested name specifier is not required for static functions. Fixes PR6886. llvm-svn: 102107
* Use CXXPseudoDestructorExpr as the stored representation for dependentDouglas Gregor2010-02-251-2/+17
| | | | | | | | | | | | | | | | expressions that look like pseudo-destructors, e.g., p->T::~T() where p has dependent type. At template instantiate time, we determine whether we actually have a pseudo-destructor or a member access, and funnel down to the appropriate routine in Sema. Fixes PR6380. llvm-svn: 97092
* Retain complete source information for the type after the '~' in aDouglas Gregor2010-02-241-0/+7
| | | | | | | | | | | CXXPseudoDestructorExpr. Update template instantiation for pseudo-destructor expressions to use this source information and to make use of Sema::BuildPseudoDestructorExpr when the base expression is dependent or refers to a scalar type. llvm-svn: 97079
* Fix leak in CXXNewExpr where the SubExprs array would get allocated directly ↵Ted Kremenek2010-02-111-2/+10
| | | | | | using 'new[]' instead of the allocator associated with ASTContext. llvm-svn: 95933
OpenPOWER on IntegriCloud