summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/StmtProfile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement support for pack expansions whose pattern is a non-typeDouglas Gregor2011-01-031-0/+4
| | | | | | | | | | | | | | | | | 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
* When instantiating a non-type template parameter pack, be sure toDouglas Gregor2010-12-241-0/+1
| | | | | | | | extract the appropriate argument from the argument pack (based on the current substitution index, of course). Simple instantiation of pack expansions involving non-type template parameter packs now works. llvm-svn: 122532
* Remove the TypesCompatibleExprClass AST node. Merge its functionality into ↵Francois Pichet2010-12-081-6/+0
| | | | | | BinaryTypeTraitExpr. llvm-svn: 121298
* Type traits intrinsic implementation: __is_base_of(T, U)Francois Pichet2010-12-071-0/+7
| | | | | | New AST node introduced: BinaryTypeTraitExpr; to be reused for more intrinsics. llvm-svn: 121074
* Rename CXXExprWithTemporaries -> ExprWithCleanups; there's no theoreticalJohn McCall2010-12-061-4/+1
| | | | | | reason this is limited to C++, and it's certainly not limited to temporaries. llvm-svn: 120996
* Simplify the ASTs by consolidating ObjCImplicitGetterSetterExpr and ↵John McCall2010-12-021-13/+6
| | | | | | | | ObjCPropertyRefExpr into the latter. llvm-svn: 120643
* Add a new expression kind, OpaqueValueExpr, which is useful forJohn McCall2010-11-151-0/+4
| | | | | | | certain internal type-checking procedures as well as for representing certain implicitly-generated operations. Uses to follow. llvm-svn: 119289
* Eliminate usage of ObjCSuperExpr used forFariborz Jahanian2010-10-141-4/+8
| | | | | | | 'super' as receiver of property or a setter/getter methods. //rdar: //8525788 llvm-svn: 116483
* Define and implement CXXNoexceptExpr. Create it in Sema.Sebastian Redl2010-09-101-0/+4
| | | | llvm-svn: 113623
* Microsoft's __uuidof operator implementation part 1.Francois Pichet2010-09-081-0/+6
| | | | llvm-svn: 113356
* Eliminate CXXBindReferenceExpr, which was used in a ton ofDouglas Gregor2010-09-021-4/+0
| | | | | | well-intentioned but completely unused code. llvm-svn: 112868
* Revert my user-defined literal commits - r1124{58,60,67} pendingAlexis Hunt2010-08-301-6/+0
| | | | | | some issues being sorted out. llvm-svn: 112493
* Implement C++0x user-defined string literals.Alexis Hunt2010-08-291-0/+6
| | | | | | | | | | The extra data stored on user-defined literal Tokens is stored in extra allocated memory, which is managed by the PreprocessorLexer because there isn't a better place to put it that makes sure it gets deallocated, but only after it's used up. My testing has shown no significant slowdown as a result, but independent testing would be appreciated. llvm-svn: 112458
* GCC didn't care for my attempt at API compatibility, so brute-force everythingJohn McCall2010-08-251-45/+45
| | | | | | to the new constants. llvm-svn: 112047
* More incremental progress towards not including Expr.h in Sema.h.John McCall2010-08-251-1/+1
| | | | llvm-svn: 112044
* Call the base class in StmtProfiler::VisitOverloadExpr.Argyrios Kyrtzidis2010-08-151-0/+1
| | | | llvm-svn: 111110
* Call the correct base class in StmtProfiler::VisitUnresolvedLookupExpr.Argyrios Kyrtzidis2010-08-151-4/+8
| | | | llvm-svn: 111089
* Update ImplicitCastExpr to be able to represent an XValue.Sebastian Redl2010-07-201-1/+1
| | | | llvm-svn: 108807
* When computing the canonical profile of a DeclRefExpr or MemberExpr,Douglas Gregor2010-07-131-3/+6
| | | | | | | don't include the nested-name-specifier or template arguments: they were only relevant when resolving the declaration. Fixes PR7460. llvm-svn: 108235
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-1/+1
| | | | | | 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-1/+1
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-1/+1
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* Added a field to BlockDeclRefExpr for future use.Fariborz Jahanian2010-06-041-0/+2
| | | | | | No functionality change yet. llvm-svn: 105479
* Fill in some silly defaults to silence a GCC warningDouglas Gregor2010-05-191-2/+2
| | | | llvm-svn: 104140
* Profile type-dependent uses of overloaded operators in C++ the sameDouglas Gregor2010-05-191-0/+208
| | | | | | | way regardless of whether some overloaded operator functions were found by name lookup within the template. Fixes PR6851. llvm-svn: 104107
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeAlexis Hunt2010-05-051-1/+1
| | | | | | | with no whitespace. This will allow statements to be referred to in attribute TableGen files. llvm-svn: 103087
* Revert r103072; I accidentally ended up deleting a bunch of trailingAlexis Hunt2010-05-051-4/+4
| | | | | | | whitespace which makes this patch unreadable. Will recommit without the whitespace. llvm-svn: 103086
* Change StmtNodes.def to StmtNodes.td in anticipation of a rewrite of attributesAlexis Hunt2010-05-051-4/+4
| | | | llvm-svn: 103072
* Teach __builtin_offsetof to compute the offsets of members of baseDouglas Gregor2010-04-291-0/+4
| | | | | | | | 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/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add an CXXBindReferenceExpr (not used just yet).Anders Carlsson2010-01-291-0/+4
| | | | llvm-svn: 94791
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-151-1/+0
| | | | llvm-svn: 91450
* r90313, in which OverloadedFunctionDecl is removed and never spoken of again.John McCall2009-12-021-7/+0
| | | | llvm-svn: 90313
* Rework how we support C++ implicit member accesses. If we can resolve anJohn McCall2009-12-011-6/+12
| | | | | | | | | | | | | | | 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/+13
| | | | | | | | 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
* Remove VISIBILITY_HIDDEN from lib/AST.Benjamin Kramer2009-11-281-2/+1
| | | | llvm-svn: 90043
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-4/+3
| | | | | | | | | | | | | | | | | 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-8/+7
| | | | | | | | | | | | 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
* "Incremental" progress on using expressions, by which I mean totally rippingJohn McCall2009-11-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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-2/+4
| | | | | | | | 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
* Introduce a new representation for template templateDouglas Gregor2009-11-111-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | parameters. Rather than storing them as either declarations (for the non-dependent case) or expressions (for the dependent case), we now (always) store them as TemplateNames. The primary change here is to add a new kind of TemplateArgument, which stores a TemplateName. However, making that change ripples to every switch on a TemplateArgument's kind, also affecting TemplateArgumentLocInfo/TemplateArgumentLoc, default template arguments for template template parameters, type-checking of template template arguments, etc. This change is light on testing. It should fix several pre-existing problems with template template parameters, such as: - the inability to use dependent template names as template template arguments - template template parameter default arguments cannot be instantiation However, there are enough pieces missing that more implementation is required before we can adequately test template template parameters. llvm-svn: 86777
* Track source information for template arguments and template specializationJohn McCall2009-10-291-32/+38
| | | | | | | 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
* Eliminate QualifiedDeclRefExpr, which captured the notion of aDouglas Gregor2009-10-231-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | qualified reference to a declaration that is not a non-static data member or non-static member function, e.g., namespace N { int i; } int j = N::i; Instead, extend DeclRefExpr to optionally store the qualifier. Most clients won't see or care about the difference (since QualifierDeclRefExpr inherited DeclRefExpr). However, this reduces the number of top-level expression types that clients need to cope with, brings the implementation of DeclRefExpr into line with MemberExpr, and simplifies and unifies our handling of declaration references. Extended DeclRefExpr to (optionally) store explicitly-specified template arguments. This occurs when naming a declaration via a template-id (which will be stored in a TemplateIdRefExpr) that, following template argument deduction and (possibly) overload resolution, is replaced with a DeclRefExpr that refers to a template specialization but maintains the template arguments as written. llvm-svn: 84962
* Add safe part of previous (reverted) commit, necessary to update to LLVM API ↵Daniel Dunbar2009-09-221-1/+1
| | | | | | change. llvm-svn: 82540
* Revert "Switch a few clients over to StringLiteral::getString.", this is ↵Daniel Dunbar2009-09-221-1/+1
| | | | | | breaking some projects, but I don't have a test case yet. llvm-svn: 82539
* Switch a few clients over to StringLiteral::getString.Daniel Dunbar2009-09-221-1/+1
| | | | | | - Switching all of them out-of-my-current-scope-of-interest, sorry. llvm-svn: 82515
* Remove tabs, and whitespace cleanups.Mike Stump2009-09-091-31/+31
| | | | llvm-svn: 81346
* Implement AST, semantics, and CodeGen for C++ pseudo-destructorDouglas Gregor2009-09-041-0/+7
| | | | | | | | | | | | | 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
* Improved handling for dependent, qualified member access expressions, e.g.,Douglas Gregor2009-09-031-0/+1
| | | | | | | | | | | | | | | t->Base::f where t has a dependent type. We save the nested-name-specifier in the CXXUnresolvedMemberExpr then, during instantiation, substitute into the nested-name-specifier with the (transformed) object type of t, so that we get name lookup into the type of the object expression. Note that we do not yet retain information about name lookup into the lexical scope of the member access expression, so several regression tests are still disabled. llvm-svn: 80925
* Eliminate CXXAdornedMemberExpr entirely. Instead, optionally allocateDouglas Gregor2009-08-311-5/+1
| | | | | | | | space within the MemberExpr for the nested-name-specifier and its source range. We'll do the same thing with explicitly-specified template arguments, assuming I don't flip-flop again. llvm-svn: 80642
OpenPOWER on IntegriCloud