summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/Expr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* When determining whether a DeclRefExpr is value-dependent when itDouglas Gregor2010-01-151-4/+6
| | | | | | | | references a const variable of integral type, the initializer may be in a different declaration than the one that name-lookup saw. Find the initializer anyway. Fixes PR6045. llvm-svn: 93514
* Move the allocation of designators in DesignatedInitExpr to theDouglas Gregor2010-01-061-11/+19
| | | | | | ASTContext. Fixes <rdar://problem/7495428>. llvm-svn: 92867
* Make sure to explicitly pass type/value dependence to Expr constructor. ThisEli Friedman2009-12-301-3/+3
| | | | | | | | caught several cases where we were not doing the right thing. I'm not completely sure all cases are being handled correctly, but this should be an improvement. llvm-svn: 92281
* Fix for PR5872. Add static specifier and const/volatile qualifiers to member ↵Sam Weinig2009-12-271-0/+10
| | | | | | functions in __PRETTY_FUNCTION__ predefined expressions. llvm-svn: 92171
* support the warn_unused_result in C++ class methodsNuno Lopes2009-12-241-0/+2
| | | | llvm-svn: 92095
* indentation fixChris Lattner2009-12-211-1/+1
| | | | llvm-svn: 91807
* fix PR4010: add support for the warn_unused_result for function pointersNuno Lopes2009-12-201-3/+7
| | | | llvm-svn: 91803
* A CXXExprWithTemporaries expression is an lvalue if its subexpressionDouglas Gregor2009-12-191-0/+10
| | | | | | is an lvalue. Fixes PR5787. llvm-svn: 91765
* Diagnose attempting to assign to a sub-structure of an ivarFariborz Jahanian2009-12-151-4/+14
| | | | | | using objective-c property. (fixes radar 7449707) llvm-svn: 91474
* Improve template instantiation for object constructions in several ways:Douglas Gregor2009-12-141-0/+31
| | | | | | | | | | | | | - During instantiation, drop default arguments from constructor and call expressions; they'll be recomputed anyway, and we don't want to instantiate them twice. - Rewrote the instantiation of variable initializers to cope with non-dependent forms properly. Together, these fix a handful of problems I introduced with the switch to always rebuild expressions from the source code "as written." llvm-svn: 91315
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-1/+1
| | | | | | no extra safety anyway. llvm-svn: 91207
* Patch to allow C-style cast from 'void *' to block pointer type.Fariborz Jahanian2009-12-111-0/+2
| | | | | | (fixes radar 7465023). llvm-svn: 91171
* Code gen for ObjCIsaExpr AST used as lvalue.Fariborz Jahanian2009-12-091-0/+1
| | | | | | (fixes radar 7457534). llvm-svn: 90995
* Added a missing case to a switch statement.Fariborz Jahanian2009-12-081-0/+2
| | | | llvm-svn: 90902
* DeclRefExpr stores a ValueDecl internally.John McCall2009-12-081-2/+2
| | | | | | Template instantiation can re-use DeclRefExprs. llvm-svn: 90848
* Don't print a void return type for C++ constructors and destructors when ↵Sam Weinig2009-12-061-1/+2
| | | | | | generating a predefined expr for them. llvm-svn: 90725
* Make the type of the Decl referred to by a MemberExpr a bit more precise.Eli Friedman2009-12-041-2/+2
| | | | llvm-svn: 90549
* Add recursion guards to ice-checking and evaluation for declrefs, so weEli Friedman2009-12-031-3/+8
| | | | | | don't infinitely recurse for cases we can't evaluate. llvm-svn: 90480
* r90313, in which OverloadedFunctionDecl is removed and never spoken of again.John McCall2009-12-021-3/+1
| | | | llvm-svn: 90313
* Eliminate the use of OverloadedFunctionDecl in member expressions.John McCall2009-11-301-0/+1
| | | | | | | | 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
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-3/+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-13/+0
| | | | | | | | | | | | 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
* Handle converting member pointers to bool.Anders Carlsson2009-11-231-0/+2
| | | | llvm-svn: 89692
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-231-14/+58
| | | | | | DeclRefExprs llvm-svn: 89649
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-60/+43
| | | | | | | | | | 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-1/+4
| | | | | | | | | | | | | | | | | | | | | | 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
* Deduce a ConstantArrayType from a value-dependent initializer listDouglas Gregor2009-11-191-5/+10
| | | | | | | rather than punting to a DependentSizedArrayType, tightening up our type checking for template definitions. Thanks, John! llvm-svn: 89407
* Draw a brighter line between "unresolved" expressions, where we have done theJohn McCall2009-11-191-2/+2
| | | | | | | | 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
* Fix PR5531.Anders Carlsson2009-11-171-4/+13
| | | | llvm-svn: 89106
* Add a CK_BaseToDerived cast kind.Anders Carlsson2009-11-121-0/+2
| | | | llvm-svn: 86994
* Refine volatile handling, specifically, we must have the canonicalMike Stump2009-11-031-22/+23
| | | | | | | type to look at the volatile specifier. I found these all from just hand auditing the code. llvm-svn: 85967
* When determining whether a reference to a static data member is anDouglas Gregor2009-11-011-10/+30
| | | | | | | | | integral constant expression, make sure to find where the initializer was provided---inside or outside the class definition---since that can affect whether we have an integral constant expression (and, we need to see the initializer itself). llvm-svn: 85741
* Add a CK_DerivedToBaseMemberPointer cast kind and use it in Sema (Still no ↵Anders Carlsson2009-10-301-0/+2
| | | | | | codegen). llvm-svn: 85552
* Track source information for template arguments and template specializationJohn McCall2009-10-291-10/+10
| | | | | | | 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
* Fix overload resolution when calling a member template or taking theDouglas Gregor2009-10-241-0/+12
| | | | | | | address of a member template when explicit template arguments are provided. llvm-svn: 84991
* Eliminate QualifiedDeclRefExpr, which captured the notion of aDouglas Gregor2009-10-231-5/+87
| | | | | | | | | | | | | | | | | | | | | | | | 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
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-1/+1
| | | | | | are updated. llvm-svn: 84447
* Add FloatingCast to getCastKindName's list.Benjamin Kramer2009-10-181-0/+2
| | | | llvm-svn: 84427
* Add some more cast kinds.Anders Carlsson2009-10-181-0/+6
| | | | llvm-svn: 84423
* Switch ExtVectorElementExpr::getEncodedElementAccess to use StringRef.Daniel Dunbar2009-10-181-8/+8
| | | | | | - Really this should be simplified by the FIXME above, but I'm too deep in DFS. llvm-svn: 84392
* Add FIXME... maybe Nate will get bored? :)Daniel Dunbar2009-10-181-0/+2
| | | | llvm-svn: 84389
* Simplify ExtVectorElementExpr::containsDuplicateElements().Daniel Dunbar2009-10-171-13/+7
| | | | llvm-svn: 84380
* Add CK_VectorSplat and use it for casting non-pointer scalars to ExtVectors.Anders Carlsson2009-10-161-0/+2
| | | | llvm-svn: 84245
* Add a ToVoid cast kind and start using it.Anders Carlsson2009-10-161-0/+2
| | | | llvm-svn: 84241
* fix test/CodeGen/statements.c on 32-bit hosts.Chris Lattner2009-10-131-0/+7
| | | | llvm-svn: 84039
* Teach sema and codegen about the difference between address of labels,Chris Lattner2009-10-131-2/+11
| | | | | | | | | | which is a common idiom to improve PIC'ness of code using the addr of label extension. This implementation is a gross hack, but the only other alternative would be to teach evalutate about this horrid combination. While GCC allows things like "&&foo - &&bar + 1", people don't use this in practice. This implements PR5131. llvm-svn: 83957
* make the diagnostic in the 'unused result' warning more preciseChris Lattner2009-10-131-13/+14
| | | | | | about the reason, rdar://7186119. llvm-svn: 83940
* Implement [expr.mptr.oper]p6 for '->*' operator.Fariborz Jahanian2009-10-081-2/+12
| | | | llvm-svn: 83562
* Refixed pr5086 by letting Expr::isNullPointerConstantFariborz Jahanian2009-10-061-1/+2
| | | | | | | handle checking for a null pointer for a zero-valued enumerator; moving the test case from CodeGen to Sema. llvm-svn: 83350
* Fix checking for a null pointer constant when the expression itself isDouglas Gregor2009-09-251-7/+19
| | | | | | | | | | | | value-dependent. Audit (and fixed) all calls to Expr::isNullPointerConstant() to provide the correct behavior with value-dependent expressions. Fixes PR5041 and a crash in libstdc++ <locale>. In the same vein, properly compute value- and type-dependence for ChooseExpr. Fixes PR4996. llvm-svn: 82748
OpenPOWER on IntegriCloud