summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move composite type finding of two objective-c expressions Fariborz Jahanian2009-12-101-118/+137
| | | | | | into its own helper method. No change in functionality. llvm-svn: 91056
* Codegen. support for ObjCIsaExpr AST which until nowFariborz Jahanian2009-12-091-3/+3
| | | | | | was not needed (fixes radar 7453430). llvm-svn: 90981
* Handle unresolved using decls in bare lookups. These are not being adequatelyJohn McCall2009-12-081-3/+3
| | | | | | tested. Fixes PR5727. llvm-svn: 90893
* Refactor objective-c pointer assignment compatibility logic. NoFariborz Jahanian2009-12-081-17/+24
| | | | | | intended functionality change. llvm-svn: 90865
* DeclRefExpr stores a ValueDecl internally.John McCall2009-12-081-1/+1
| | | | | | Template instantiation can re-use DeclRefExprs. llvm-svn: 90848
* Patch to warn when discarding objective-c pointer type qualifiersFariborz Jahanian2009-12-081-0/+10
| | | | | | Still some refactoring to do. llvm-svn: 90830
* Recover from dot accesses to record pointers and arrow accesses to records.John McCall2009-12-071-3/+32
| | | | | | Patch by Nicola Gigante! llvm-svn: 90814
* Add the BlockDecl to the DeclContext.Ted Kremenek2009-12-071-0/+1
| | | | llvm-svn: 90808
* Allow accessing 'isa' via '->' operator. Fariborz Jahanian2009-12-071-0/+10
| | | | | | (fixes radar 7447251). llvm-svn: 90795
* Rework how virtual member functions are marked. If a class has no key ↵Anders Carlsson2009-12-071-0/+2
| | | | | | function, we now wait until the end of the translation unit to mark its virtual member functions as references. This lays the groundwork for fixing PR5557. llvm-svn: 90752
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-7/+7
| | | | | | | | | | | | | | | | | | | | | variables, but the results are imperfect. For posterity, I did: cat <<EOF > $cmdfile s/DeclaratorInfo/TypeSourceInfo/g s/DInfo/TInfo/g s/TypeTypeSourceInfo/TypeSourceInfo/g s/SourceTypeSourceInfo/TypeSourceInfo/g EOF find lib -name '*.cpp' -not -path 'lib/Parse/*' -exec sed -i '' -f $cmdfile '{}' \; find lib -name '*.h' -exec sed -i '' -f $cmdfile '{}' \; find include -name '*.h' -not -path 'include/clang/Parse/*' -not -path 'include/clang/Basic/*' -exec sed -i '' -f $cmdfile '{}' \; llvm-svn: 90743
* fix rdar://7446395, a crash on invalid, by fixing a broken assertion.Chris Lattner2009-12-051-4/+3
| | | | llvm-svn: 90647
* Make sure to call PerformObjectMemberConversion where necessary.Eli Friedman2009-12-041-1/+4
| | | | llvm-svn: 90555
* Make the type of the Decl referred to by a MemberExpr a bit more precise.Eli Friedman2009-12-041-1/+1
| | | | llvm-svn: 90549
* Use a more rigorous definition of 'class member'. I don't have any evidenceJohn McCall2009-12-021-7/+19
| | | | | | that this was causing a problem, but it could have. llvm-svn: 90343
* Recognize that EnumConstantDecls can be found by lookup and are not instanceJohn McCall2009-12-021-0/+3
| | | | | | members. Fixes PR5667. llvm-svn: 90341
* Rip out the last remaining implicit use of OverloadedFunctionDecl in Sema:John McCall2009-12-021-2/+1
| | | | | | | LookupResult::getAsSingleDecl() is no more. Shift Sema::LookupSingleName to return null on overloaded results. llvm-svn: 90309
* Push overloaded function templates through the parser using a totally differentJohn McCall2009-12-021-3/+3
| | | | | | | leaked data structure than before. This kills off the last remaining explicit uses of OverloadedFunctionDecl in Sema. llvm-svn: 90306
* Stop trying to analyze class-hierarchies for dependently-scoped id-expressions;John McCall2009-12-021-17/+23
| | | | | | | | | | | | | there's nothing interesting we can say now that we're correctly not requiring the qualifier to name a known base class in dependent contexts. Require scope specifiers on member access expressions to name complete types if they're not dependent; delay lookup when they are dependent. Use more appropriate diagnostics when qualified implicit member access expressions find declarations from unrelated classes. llvm-svn: 90289
* Fix IsProvablyNotDerivedFrom to always use record definitions when available.John McCall2009-12-011-5/+5
| | | | | | Gets clang-on-clang passing again. llvm-svn: 90270
* Rework how we support C++ implicit member accesses. If we can resolve anJohn McCall2009-12-011-168/+349
| | | | | | | | | | | | | | | 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
* Don't automatically assume that an id-expression refers to aDouglas Gregor2009-12-011-1/+17
| | | | | | | | | | ValueDecl, because that isn't always the case in ill-formed code. Diagnose a common mistake (forgetting to provide a template argument list for a class template, PR5655) and dyn_cast so that we handle the general problem of referring to a non-value declaration gracefully. llvm-svn: 90239
* Eliminate warning in Release-Asserts mode. No functionality changeDouglas Gregor2009-12-011-0/+1
| | | | llvm-svn: 90204
* Fix and test for a problem caught by the clang-on-clang buildbot: qualifiedJohn McCall2009-11-301-17/+24
| | | | | | IDs in dependent contexts are not dependent if the context names a namespace. llvm-svn: 90171
* Remove all of Sema's explicit uses of OverloadedFunctionDecl except forJohn McCall2009-11-301-2/+0
| | | | | | those associated with TemplateNames. llvm-svn: 90162
* Eliminate the use of OverloadedFunctionDecl in member expressions.John McCall2009-11-301-346/+574
| | | | | | | | 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
* Add DeclarationName support for C++0x operator literals. They should now work asAlexis Hunt2009-11-291-0/+1
| | | | | | | function names outside of templates - they'll probably cause some damage there as they're largely untested. llvm-svn: 90064
* Refactor our handling of expression evaluation contexts, so that SemaDouglas Gregor2009-11-261-21/+28
| | | | | | | | | | | | maintains a stack of evaluation contexts rather than having the parser do it. This change made it simpler to track in which contexts temporaries were created, so that we could... "Forget" about temporaries created within unevaluated contexts, so that we don't build a CXXExprWithTemporaries and, therefore, destroy the integral-constness of our expressions. Fixes PR5609. llvm-svn: 89908
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-251-0/+21
| | | | | | This fixes pr5611. llvm-svn: 89895
* Some fancy footwork to move the decision on how Fariborz Jahanian2009-11-251-4/+9
| | | | | | to build casted expression-list AST to Sema. llvm-svn: 89827
* Refactor argument collection of constructor calls usingFariborz Jahanian2009-11-241-2/+1
| | | | | | the common routine. llvm-svn: 89802
* More cleanup of argument call collection.Fariborz Jahanian2009-11-241-10/+10
| | | | llvm-svn: 89789
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-241-238/+268
| | | | | | | | | | | | 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
* Refactor collection of call arguments in common code.Fariborz Jahanian2009-11-241-28/+47
| | | | | | | Add support for variadic collection functions. More to do here. llvm-svn: 89781
* GNUNullExpr is a valid sentinel even though it isn't of pointer type.Anders Carlsson2009-11-241-3/+4
| | | | llvm-svn: 89778
* Convert the && and || operands to bool using standard conversions. Fixes PR5593.Anders Carlsson2009-11-231-9/+31
| | | | llvm-svn: 89704
* Intercept sizeof and alignof references before they get into ASTContext ↵Sebastian Redl2009-11-231-0/+7
| | | | | | methods. This fixes a crash when writing sizeof(Incomplete&), and lets ASTContext's methods do the right thing for CodeGen, which fixes PR5590. llvm-svn: 89668
* Improve type-checking of templates by distinguishing between membersDouglas Gregor2009-11-231-6/+2
| | | | | | | of the current instantiation and members of an unknown specialization when type-checking a qualified-if expression. llvm-svn: 89653
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-231-54/+3
| | | | | | DeclRefExprs llvm-svn: 89649
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-41/+19
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* If a C++ qualified id is followed by a postfix suffix, it is never the directJohn McCall2009-11-221-1/+4
| | | | | | | | | | | | | | operand of an addressof operator, and so we should not treat it as an abstract member-pointer expression and therefore suppress the implicit member access. This is really a well-formedness constraint on expressions: a DeclRefExpr of a FieldDecl or a non-static CXXMethodDecl (or template thereof, or unresolved collection thereof) should not be allowed in an arbitrary location in the AST. Arguably it shouldn't be allowed anywhere and we should have a different expr node type for this. But unfortunately we don't have a good way of enforcing this kind of constraint right now. llvm-svn: 89578
* Reorganize the intermediate BuildDeclarationNameExpr routines again.John McCall2009-11-221-79/+66
| | | | llvm-svn: 89575
* Consider a FunctionTemplate to be an overload all on its lonesome. TrackJohn McCall2009-11-221-49/+73
| | | | | | this information through lookup rather than rederiving it. llvm-svn: 89570
* "Incremental" progress on using expressions, by which I mean totally rippingJohn McCall2009-11-211-150/+288
| | | | | | | | | | | | | | | | | | | | | | 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-4/+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
* Split LookupResult into its own header.John McCall2009-11-181-0/+1
| | | | llvm-svn: 89199
* Simplify ActOnPostfixUnaryOp.Eli Friedman2009-11-181-122/+1
| | | | llvm-svn: 89188
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-1/+1
| | | | | | | | | | two classes, one for typenames and one for values; this seems to have some support from Doug if not necessarily from the extremely-vague-on-this-point standard. Track the location of the 'typename' keyword in a using-typename decl. Make a new lookup result for unresolved values and deal with it in most places. llvm-svn: 89184
* Eliminate some completely-redundant lookupsDouglas Gregor2009-11-181-10/+0
| | | | llvm-svn: 89181
* Carry lookup configuration throughout lookup on the LookupResult. GiveJohn McCall2009-11-171-15/+8
| | | | | | | | | | | | | LookupResult RAII powers to diagnose ambiguity in the results. Other diagnostics (e.g. access control and deprecation) will be moved to automatically trigger during lookup as part of this same mechanism. This abstraction makes it much easier to encapsulate aliasing declarations (e.g. using declarations) inside the lookup system: eventually, lookup will just produce the aliases in the LookupResult, and the standard access methods will naturally strip the aliases off. llvm-svn: 89027
OpenPOWER on IntegriCloud