summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TreeTransform.h
Commit message (Collapse)AuthorAgeFilesLines
* Provide a real fix for PR6199, reverting the old workaround. Here, weDouglas Gregor2010-02-031-0/+6
| | | | | | | | realize that CXXConstructExpr is always implicit, so we should just return its argument (if there is only one) rather than directly invoking the constructor. llvm-svn: 95192
* Remove abstract expression kinds from the StmtClass enum. Update a few usersJohn McCall2010-02-031-14/+2
| | | | | | appropriately. Call out a few missing cases in the expression mangler. llvm-svn: 95176
* Use IdentifierInfo * instead of std::string for the AsmStmt names.Anders Carlsson2010-01-301-4/+4
| | | | llvm-svn: 94925
* More asm cleanup.Anders Carlsson2010-01-301-1/+7
| | | | llvm-svn: 94920
* Add an CXXBindReferenceExpr (not used just yet).Anders Carlsson2010-01-291-0/+10
| | | | llvm-svn: 94791
* Preserve access bits through overload resolution much better. SomeJohn McCall2010-01-261-10/+3
| | | | | | general refactoring in operator resolution. llvm-svn: 94498
* Implement instantiation of AsmStmts (Crazy, I know)Anders Carlsson2010-01-241-3/+84
| | | | llvm-svn: 94361
* The type of a compound literal expression is not necessarily the same as theJohn McCall2010-01-191-0/+4
| | | | | | type which was syntactically written. Fixes PR 6080. llvm-svn: 93933
* Preserve type source information in compound literal expressions.John McCall2010-01-181-16/+9
| | | | | | Patch by Enea Zaffanella! llvm-svn: 93752
* Improve source-location information for builtin TypeLocs, from EneaDouglas Gregor2010-01-181-1/+5
| | | | | | Zaffanella (with a couple of my tweaks). llvm-svn: 93733
* Preserve type source information for C++ named casts through templateJohn McCall2010-01-151-20/+16
| | | | | | instantiation. llvm-svn: 93533
* Don't lose type source information when rebuilding C-style cast expressions.John McCall2010-01-151-5/+2
| | | | | | Also we don't need to recheck for altivec initializers, I think. llvm-svn: 93529
* Preserve type source information in explicit cast expressions.John McCall2010-01-151-33/+48
| | | | | | Patch by Enea Zaffanella. llvm-svn: 93522
* Don't repeat lookup when instantiating resolved member expressions.John McCall2010-01-151-5/+23
| | | | | | | | | | Adjust BuildMemberReferenceExpr to perform the inheritance check on implicit member accesses, which can arise from unqualified lookups and therefore may reference decls from enclosing class scopes. Fixes PR 5838. llvm-svn: 93510
* Add type source information for both kinds of typeof types.John McCall2010-01-131-14/+14
| | | | | | Patch by Enea Zaffanella. llvm-svn: 93344
* Add an "implicit" bit to CXXThisExpr, so that we can trackDouglas Gregor2010-01-071-3/+5
| | | | | | | implicitness without losing track of the (logical or actual) location where "this" would occur in the source. llvm-svn: 92958
* Get rid of FixedWidthIntType, as suggested by Chris and Eli.Anders Carlsson2009-12-291-10/+0
| | | | llvm-svn: 92246
* Add test case for PR5868, and improve location information slightly for ↵Douglas Gregor2009-12-241-0/+1
| | | | | | implicit "this" expressions llvm-svn: 92141
* When rebuilding a MemberExpr that refers to an anonymous union, beDouglas Gregor2009-12-241-1/+4
| | | | | | | sure to perform derived-to-base conversions on the base expression. Fixes PR5868. Proper testcase is coming soon. llvm-svn: 92139
* When transforming CXXExprWithTemporaries and CXXBindTemporaryExprDouglas Gregor2009-12-241-20/+7
| | | | | | | | | expressions (e.g., for template instantiation), just transform the subexpressions and return those, since the temporary-related nodes will be implicitly regenerated. Fixes PR5867, but I said that before... llvm-svn: 92135
* When we see a CXXDefaultArgExpr during template instantiation, rebuildDouglas Gregor2009-12-231-3/+5
| | | | | | | | 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 transforming a C++ "new" expression that was not explicitly givenDouglas Gregor2009-12-221-0/+25
| | | | | | | a size, check whether the transformed type is itself an array type. If so, take the major array bound as the size to allocate. Fixes PR5833. llvm-svn: 91907
* When we simply return a retained member expression when instantiating, we ↵Anders Carlsson2009-12-221-1/+6
| | | | | | must also mark the member decl as referenced. llvm-svn: 91887
* Check in a rudimentary FullExpr class that isn't used anywhere yet. Rename ↵Anders Carlsson2009-12-161-6/+6
| | | | | | Action::FullExpr to Action::MakeFullExpr to avoid name clashes. llvm-svn: 91494
* ShouldDestroyTemporaries? I don't think so.Anders Carlsson2009-12-151-2/+1
| | | | llvm-svn: 91450
* Improve template instantiation for object constructions in several ways:Douglas Gregor2009-12-141-31/+22
| | | | | | | | | | | | | - 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
* When rebuilding CXXConstructExprs after a transformation, useDouglas Gregor2009-12-141-5/+10
| | | | | | CompleteConstructorCall to perform type-checking. llvm-svn: 91279
* Fix template instantiation for non-dependent calls to overloaded callDouglas Gregor2009-12-131-0/+62
| | | | | | operators. Fixes PR5266. llvm-svn: 91252
* Rework the way we handle template instantiation forDouglas Gregor2009-12-121-35/+35
| | | | | | | | | | | | | | | | | | | | | | | implicitly-generated AST nodes. We previously built instantiated nodes for each of these AST nodes, then passed them on to Sema, which was not prepared to see already-type-checked nodes (see PR5755). In some places, we had ugly workarounds to try to avoid re-type-checking (e.g., in VarDecl initializer instantiation). Now, we skip implicitly-generated nodes when performing instantiation, preferring instead to build just the AST nodes that directly reflect what was written in the source code. This has several advantages: - We don't need to instantiate anything that doesn't have a direct correlation to the source code, so we can have better location information. - Semantic analysis sees the same thing at template instantiation time that it would see for a non-template. - At least one ugly hack (VarDecl initializers) goes away. Fixes PR5755. llvm-svn: 91218
* Un-namespace-qualify llvm_unreachable. It's a macro, so the qualification gaveJeffrey Yasskin2009-12-121-2/+2
| | | | | | no extra safety anyway. llvm-svn: 91207
* Implement redeclaration checking and hiding semantics for using ↵John McCall2009-12-101-4/+16
| | | | | | | | | | | declarations. There are a couple of O(n^2) operations in this, some analogous to the usual O(n^2) redeclaration problem and some not. In particular, retroactively removing shadow declarations when they're hidden by later decls is pretty unfortunate. I'm not yet convinced it's worse than the alternative, though. llvm-svn: 91045
* The refactor of implicit member access expressions means we don't need thisJohn McCall2009-12-081-175/+85
| | | | | | | | | horrible isAddressOfOperand hack in TreeTransform, since that syntactic information is managed by the initial parser callbacks now. That's enough insomniac commits for one night. llvm-svn: 90849
* DeclRefExpr stores a ValueDecl internally.John McCall2009-12-081-21/+29
| | | | | | Template instantiation can re-use DeclRefExprs. llvm-svn: 90848
* DeclaratorInfo -> TypeSourceInfo. Makes an effort to rename associated ↵John McCall2009-12-071-22/+22
| | | | | | | | | | | | | | | | | | | | | 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
* reapply my patch for PR4451, which improves diagnostics for :: vs : confusion.Chris Lattner2009-12-071-1/+1
| | | | | | This time with a fix to bail out when in a dependent context. llvm-svn: 90730
* revert my previous patch, it is breaking something and I don't have timeChris Lattner2009-12-061-1/+1
| | | | | | to fix it ATM. llvm-svn: 90717
* implement PR4451, improving error recovery for a mistaken : where a :: wasChris Lattner2009-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | intended. On the first testcase in the bug, we now produce: cxx-decl.cpp:12:2: error: unexpected ':' in nested name specifier y:a a2; ^ :: instead of: t.cc:8:1: error: C++ requires a type specifier for all declarations x:a a2; ^ t.cc:8:2: error: invalid token after top level declarator x:a a2; ^ ; t.cc:9:11: error: use of undeclared identifier 'a2' x::a a3 = a2; ^ llvm-svn: 90713
* Fix "using typename" and the instantiation of non-dependent using declarations.John McCall2009-12-041-0/+51
| | | | llvm-svn: 90614
* Make the type of the Decl referred to by a MemberExpr a bit more precise.Eli Friedman2009-12-041-3/+3
| | | | llvm-svn: 90549
* Rework how we support C++ implicit member accesses. If we can resolve anJohn McCall2009-12-011-25/+61
| | | | | | | | | | | | | | | 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-83/+99
| | | | | | | | 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
* Some fancy footwork to move the decision on how Fariborz Jahanian2009-11-251-1/+2
| | | | | | to build casted expression-list AST to Sema. llvm-svn: 89827
* Eliminate CXXConditionDeclExpr with extreme prejudice.Douglas Gregor2009-11-251-62/+58
| | | | | | | | | | | | | | | | | 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
* Clean up the AST for while loops and fix several problems withDouglas Gregor2009-11-241-1/+12
| | | | | | | | | | | | | | | | | cleanups for while loops: 1) Make sure that we destroy the condition variable of a while statement each time through the loop for, e.g., while (shared_ptr<WorkInt> p = getWorkItem()) { // ... } 2) Make sure that we always enter a new cleanup scope for the body of the while loop, even when there is no compound expression, e.g., while (blah) RAIIObject raii(blah+1); llvm-svn: 89800
* Rip out TemplateIdRefExpr and make UnresolvedLookupExpr and John McCall2009-11-241-97/+99
| | | | | | | | | | | | 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
* Explicitly store the condition variable within switch statements, andDouglas Gregor2009-11-241-1/+12
| | | | | | | make sure that this variable is destroyed when we exit the switch statement. llvm-svn: 89776
* Explicitly track the condition variable within an "if" statement,Douglas Gregor2009-11-231-2/+14
| | | | | | | | | rather than burying it in a CXXConditionDeclExpr (that occassionally hides behind implicit conversions). Similar changes for switch, while, and do-while will follow, then the removal of CXXConditionDeclExpr. This commit is the canary. llvm-svn: 89717
* Centralize and complete the computation of value- and type-dependence for ↵Douglas Gregor2009-11-231-1/+1
| | | | | | DeclRefExprs llvm-svn: 89649
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-70/+42
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
OpenPOWER on IntegriCloud