summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/TreeTransform.h
Commit message (Collapse)AuthorAgeFilesLines
* Remove the vast majority of the Destroy methods from the AST library,Douglas Gregor2010-07-251-8/+2
| | | | | | since we aren't going to be calling them ever. llvm-svn: 109377
* More block instantiation stuff. Set variable/param DeclContextFariborz Jahanian2010-07-131-4/+0
| | | | | | to block context when first instantiating them. llvm-svn: 108266
* 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
* When forming a function call or message send expression, be sure toDouglas Gregor2010-07-131-1/+1
| | | | | | | | | | | | | | | | | strip cv-qualifiers from the expression's type when the language calls for it: in C, that's all the time, while C++ only does it for non-class types. Centralized the computation of the call expression type in QualType::getCallResultType() and some helper functions in other nodes (FunctionDecl, ObjCMethodDecl, FunctionType), and updated all relevant callers of getResultType() to getCallResultType(). Fixes PR7598 and PR7463, along with a bunch of getResultType() call sites that weren't stripping references off the result type (nothing stripped cv-qualifiers properly before this change). llvm-svn: 108234
* Copy over attributes to instantiated variable.Fariborz Jahanian2010-07-121-5/+0
| | | | llvm-svn: 108195
* Fix compile error. Per Fariborz.Dale Johannesen2010-07-101-1/+2
| | | | llvm-svn: 108051
* Instantiation of byref variable inFariborz Jahanian2010-07-091-0/+4
| | | | | | block literal expression. llvm-svn: 108019
* Instantiation of block literal expressions. wip.Fariborz Jahanian2010-07-091-6/+68
| | | | llvm-svn: 108000
* Reinstate the fix for PR7556. A silly use of isTrivial() wasDouglas Gregor2010-07-081-6/+6
| | | | | | 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-6/+6
| | | | | | breaking bootstrap on Linux. llvm-svn: 107837
* Rename CXXZeroInitValueExpr to CXXScalarValueInitExpr, to reflect itsDouglas Gregor2010-07-071-6/+6
| | | | | | newly-narrowed scope. No functionality change. llvm-svn: 107828
* improve altivec vector bool/pixel support, patch by Anton YartsevChris Lattner2010-06-231-6/+5
| | | | | | with several tweaks by me. llvm-svn: 106619
* Apply array-to-pointer decay when instantiating a MemberExpr. FixesDouglas Gregor2010-06-221-3/+5
| | | | | | PR7405, patch by Kyle Lippincott! llvm-svn: 106523
* A trivial fix for a test case that's too horrible to commit. FixesDouglas Gregor2010-06-181-0/+3
| | | | | | <rdar://problem/8108088>. llvm-svn: 106328
* When pushing a copy of the TypeLoc information for a dependentDouglas Gregor2010-06-171-1/+2
| | | | | | | template specialization type, copy the location information but use the new type. Fixes PR7385. llvm-svn: 106224
* When we see a 'template' disambiguator that marks the next identifierDouglas Gregor2010-06-161-13/+17
| | | | | | | | | | | (or operator-function-id) as a template, but the context is actually non-dependent or the current instantiation, allow us to use knowledge of what kind of template it is, e.g., type template vs. function template, for further syntactic disambiguation. This allows us to parse properly in the presence of stray "template" keywords, which is necessary in C++0x and it's good recovery in C++98/03. llvm-svn: 106167
* Fix the recently-added warning about 'typename' and 'template'Douglas Gregor2010-06-161-2/+2
| | | | | | | | | disambiguation keywords outside of templates in C++98/03. Previously, the warning would fire when the associated nested-name-specifier was not dependent, but that was a misreading of the C++98/03 standard: now, we complain only when we're outside of any template. llvm-svn: 106161
* Fix a point of semantics with using declaration hiding: method templatesJohn McCall2010-06-161-3/+6
| | | | | | | | | | | | | | | | | introduced by using decls are hidden even if their template parameter lists or return types differ from the "overriding" declaration. Propagate using shadow declarations around more effectively when looking up template-ids. Reperform lookup for template-ids in member expressions so that access control is properly set up. Fix some number of latent bugs involving template-ids with totally invalid base types. You can only actually get these with a scope specifier, since otherwise the template-id won't parse as a template-id. Fixes PR7384. llvm-svn: 106093
* Split DependentNameType into two types. DependentNameType represents theJohn McCall2010-06-111-42/+85
| | | | | | | | | | | | | | case of an elaborated-type-specifier like 'typename A<T>::foo', and DependentTemplateSpecializationType represents the case of an elaborated-type-specifier like 'typename A<T>::template B<T>'. The TypeLoc representation of a DependentTST conveniently exactly matches that of an ElaboratedType wrapping a TST. Kill off the explicit rebuild methods for RebuildInCurrentInstantiation; the standard implementations work fine because the nested name specifier is computable in the newly-entered context. llvm-svn: 105801
* Simplify the methods for creating a pointer, reference, member-pointer,John McCall2010-06-051-9/+9
| | | | | | | or block-pointer type by removing the qualifiers parameter. Introduce a method to perform semantic checking when adding qualifiers to a type. llvm-svn: 105526
* Require a complete type when performing the qualified lookup duringJohn McCall2010-05-271-0/+3
| | | | | | instantiation of a dependent elaborated type specifier. Fixes PR 7199. llvm-svn: 104822
* When transforming a C++ "new" expression's constructor arguments, dropDouglas Gregor2010-05-261-0/+3
| | | | | | | | | any arguments that are default-argument expressions. The can show up when we have a new expression whose constructor arguments are not type-dependent and whose allocated type is not dependent and has a constructor with default arguments. Fixes PR7202. llvm-svn: 104690
* tweak to (hopefully) fix darwin[89] buildbots. Thanks to Doug for the ↵Jim Grosbach2010-05-191-1/+1
| | | | | | suggested modification. llvm-svn: 104188
* Added basic source locations to Elaborated and DependentName types.Abramo Bagnara2010-05-191-32/+70
| | | | llvm-svn: 104169
* Fix an obvious goof that rjmccall found by inspection. No testcase, suggestionsChandler Carruth2010-05-191-1/+1
| | | | | | welcome for one. llvm-svn: 104101
* Switch over the tablegen to use much prettier range technologyAlexis Hunt2010-05-181-3/+3
| | | | | | | Also rename ABSTRACT to ABSTRACT_STMT, in keeping with the other .def files llvm-svn: 104017
* Substantially alter the design of the Objective C type AST by introducingJohn McCall2010-05-151-20/+16
| | | | | | | | | | | | | | | | | | | | | ObjCObjectType, which is basically just a pair of one of {primitive-id, primitive-Class, user-defined @class} with a list of protocols. An ObjCObjectPointerType is therefore just a pointer which always points to one of these types (possibly sugared). ObjCInterfaceType is now just a kind of ObjCObjectType which happens to not carry any protocols. Alter a rather large number of use sites to use ObjCObjectType instead of ObjCInterfaceType. Store an ObjCInterfaceType as a pointer on the decl rather than hashing them in a FoldingSet. Remove some number of methods that are no longer used, at least after this patch. By simplifying ObjCObjectPointerType, we are now able to easily remove and apply pointers to Objective-C types, which is crucial for a certain kind of ObjC++ metaprogramming common in WebKit. llvm-svn: 103870
* Revert r103770, "Added basic source locations to Elaborated and DependentNameDaniel Dunbar2010-05-141-36/+9
| | | | | | types.", it is breaking Clang bootstrap. llvm-svn: 103775
* Added basic source locations to Elaborated and DependentName types.Abramo Bagnara2010-05-141-9/+36
| | | | llvm-svn: 103770
* Rebuild builtin_id * as an ObjCObjectPointerType, where builtin_id is theJohn McCall2010-05-131-5/+13
| | | | | | magic type that 'id' is a pointer to. llvm-svn: 103708
* Merged Elaborated and QualifiedName types.Abramo Bagnara2010-05-111-66/+31
| | | | llvm-svn: 103517
* Fix a silly bootstrap-breaking thinko, where we were trying to convertDouglas Gregor2010-05-081-20/+28
| | | | | | | non-existent condition expressions to boolean values during template instantiation. llvm-svn: 103364
* When instantiating statements that involve conditions (if, while, do,Douglas Gregor2010-05-081-51/+58
| | | | | | | | | | | | | for, and switch), be careful to construct the full expressions as soon as we perform template instantation, so we don't either forget to call temporary destructors or destroy temporaries at the wrong time. This is the template-instantiation analogue to r103187, during which I hadn't realized that the issue would affect the handling of these constructs differently inside and outside of templates. Fixes a regression in Boost.Function. llvm-svn: 103357
* Fixed DISABLE_SMART_POINTERS breakageDouglas Gregor2010-05-061-6/+14
| | | | llvm-svn: 103198
* Rework our handling of temporary objects within the conditions ofDouglas Gregor2010-05-061-24/+44
| | | | | | | | | | | | | | | | | | | if/switch/while/do/for statements. Previously, we would end up either: (1) Forgetting to destroy temporaries created in the condition (!), (2) Destroying the temporaries created in the condition *before* converting the condition to a boolean value (or, in the case of a switch statement, to an integral or enumeral value), or (3) In a for statement, destroying the condition's temporaries at the end of the increment expression (!). We now destroy temporaries in conditions at the right times. This required some tweaking of the Parse/Sema interaction, since the parser was building full expressions too early in many places. Fixes PR7067. llvm-svn: 103187
* Reapplying patch to change StmtNodes.def to StmtNodes.td, this timeAlexis Hunt2010-05-051-7/+7
| | | | | | | 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-213/+213
| | | | | | | 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-213/+213
| | | | llvm-svn: 103072
* Fix a thinko that caused us not to compute __builtin_offset as aDouglas Gregor2010-04-301-0/+1
| | | | | | constant expression in C. llvm-svn: 102762
* Clean up our handling of local instantiation scopes, which keep trackDouglas Gregor2010-04-301-7/+9
| | | | | | | | | | | | | | | | | | | | | of the mapping from local declarations to their instantiated counterparts during template instantiation. Previously, we tried to do some unholy merging of local instantiation scopes that involved storing a single hash table along with an "undo" list on the side... which was ugly, and never handled function parameters properly. Now, we just keep separate hash tables for each local instantiation scope, and "combining" two scopes means that we'll look in each of the combined hash tables. The combined scope stack is rarely deep, and this makes it easy to avoid the "undo" issues we were hitting. Also, I've simplified the logic for function parameters: if we're declaring a function and we need the function parameters to live longer, we just push them back into the local instantiation scope where we need them. Fixes PR6990. llvm-svn: 102732
* 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
* Fix template instantiation for __builtin_offfsetof expressions that refer to ↵Douglas Gregor2010-04-281-0/+3
| | | | | | members of anonymous structs/unions llvm-svn: 102551
* Completely reimplement __builtin_offsetof, based on a patch by RobertoDouglas Gregor2010-04-281-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* During template instantiation, set the naming class ofDouglas Gregor2010-04-271-27/+10
| | | | | | | | | | | | | | | | | | | 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
* When instantiating UnresolvedLookupExpr and UnresolvedMemberExprDouglas Gregor2010-04-271-0/+40
| | | | | | | expressions, be sure to set the naming class of the LookupResult structure. Fixes PR6947. llvm-svn: 102434
* Improve source-location information in a C++ typeid (type) expressionDouglas Gregor2010-04-261-25/+18
| | | | | | | | | | | | | | | | | 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
* Implement template instantiation for implicit property references inDouglas Gregor2010-04-261-3/+44
| | | | | | | Objective-C++. This is the last bit of (non-blocks-related) template instantiation logic for Objective-C++. Yay! llvm-svn: 102382
* Implement template instantiation for ObjCPropertyRefExpr.Douglas Gregor2010-04-261-4/+45
| | | | llvm-svn: 102379
* Implement template instantiation for value-dependent Objective-C ivarDouglas Gregor2010-04-261-6/+83
| | | | | | | | references and isa expressions. Also, test template instantiation of unresolved member references to Objective-C ivar references and isa expressions. llvm-svn: 102374
* Implement template instantiation for Objective-C @catchDouglas Gregor2010-04-261-3/+55
| | | | | | statements. This is the last of the Objective-C statements. llvm-svn: 102356
OpenPOWER on IntegriCloud