summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ExprCXX.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Extract a common base class between UnresolvedLookupExpr andJohn McCall2010-02-021-14/+11
| | | | | | UnresolvedMemberExpr and employ it in a few places where it's useful. llvm-svn: 95072
* Rework base and member initialization in constructors, with severalDouglas Gregor2010-01-311-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (necessarily simultaneous) changes: - CXXBaseOrMemberInitializer now contains only a single initializer rather than a set of initialiation arguments + a constructor. The single initializer covers all aspects of initialization, including constructor calls as necessary but also cleanup of temporaries created by the initializer (which we never handled before!). - Rework + simplify code generation for CXXBaseOrMemberInitializers, since we can now just emit the initializer as an initializer. - Switched base and member initialization over to the new initialization code (InitializationSequence), so that it - Improved diagnostics for the new initialization code when initializing bases and members, to match the diagnostics produced by the previous (special-purpose) code. - Simplify the representation of type-checked constructor initializers in templates; instead of keeping the fully-type-checked AST, which is rather hard to undo at template instantiation time, throw away the type-checked AST and store the raw expressions in the AST. This simplifies instantiation, but loses a little but of information in the AST. - When type-checking implicit base or member initializers within a dependent context, don't add the generated initializers into the AST, because they'll look like they were explicit. - Record in CXXConstructExpr when the constructor call is to initialize a base class, so that CodeGen does not have to infer it from context. This ensures that we call the right kind of constructor. There are also a few "opportunity" fixes here that were needed to not regress, for example: - Diagnose default-initialization of a const-qualified class that does not have a user-declared default constructor. We had this diagnostic specifically for bases and members, but missed it for variables. That's fixed now. - When defining the implicit constructors, destructor, and copy-assignment operator, set the CurContext to that constructor when we're defining the body. llvm-svn: 94952
* Add an CXXBindReferenceExpr (not used just yet).Anders Carlsson2010-01-291-0/+22
| | | | llvm-svn: 94791
* Implement access control for overloaded functions. Suppress access controlJohn McCall2010-01-271-1/+32
| | | | | | | diagnostics in "early" lookups, such as during typename checks and when building unresolved lookup expressions. llvm-svn: 94647
* Give UnresolvedSet the ability to store access specifiers for each declaration.John McCall2010-01-201-4/+5
| | | | | | | Change LookupResult to use UnresolvedSet. Also extract UnresolvedSet into its own header and make it templated over an inline capacity. llvm-svn: 93959
* When we see a CXXDefaultArgExpr during template instantiation, rebuildDouglas Gregor2009-12-231-2/+4
| | | | | | | | the default argument so that we're sure to mark any referenced declarations. This gets us another little step closer to fixing PR5810. llvm-svn: 92078
* When using a default function argument for a function template (orDouglas Gregor2009-12-231-0/+13
| | | | | | | | | | | | | | | | | member function thereof), perform the template instantiation each time the default argument is needed. This ensures that (1) We get different CXXTemporary objects for each instantiation, and (2) Any other instantiations or definitions triggered by the instantiation of the default argument expression are guaranteed to happen; previously, they might have been suppressed, e.g., because they happened in an unevaluated context. This fixes the majority of PR5810. However, it does not address the problem where we may have multiple uses of the same CXXTemporary within an expression when the temporary came from a non-instantiated default argument expression. llvm-svn: 92015
* Fix CXXConstructExpr::getSourceRange() to not include the source ranges of ↵Ted Kremenek2009-12-231-0/+12
| | | | | | CXXDefaultArgExprs when computing its range (since these expressions have no source range, and using them will make the encompassing range invalid). llvm-svn: 91984
* When value-initializing a class with no user-defined constructors butDouglas Gregor2009-12-161-11/+15
| | | | | | | 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-5/+7
| | | | | | | | | | | | | | | | | | | | | 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
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-151-8/+4
| | | | llvm-svn: 91450
* Introduce the notion of literal types, as specified in C++0x.Sebastian Redl2009-12-031-0/+1
| | | | llvm-svn: 90361
* Rework how we support C++ implicit member accesses. If we can resolve anJohn McCall2009-12-011-19/+26
| | | | | | | | | | | | | | | implicit member access to a specific declaration, go ahead and create it as a DeclRefExpr or a MemberExpr (with implicit CXXThisExpr base) as appropriate. Otherwise, create an UnresolvedMemberExpr or DependentScopeMemberExpr with a null base expression. By representing implicit accesses directly in the AST, we get the ability to correctly delay the decision about whether it's actually an instance member access or not until resolution is complete. This permits us to correctly avoid diagnosing the 'problem' of 'MyType::foo()' where the relationship to the type isn't really known until instantiation. llvm-svn: 90266
* Eliminate the use of OverloadedFunctionDecl in member expressions.John McCall2009-11-301-0/+49
| | | | | | | | Create a new UnresolvedMemberExpr for these lookups. Assorted hackery around qualified member expressions; this will all go away when we implement the correct (i.e. extremely delayed) implicit-member semantics. llvm-svn: 90161
OpenPOWER on IntegriCloud