summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Convert RecordLayout::NonVirtualSize from bit units to CharUnits.Ken Dyck2011-02-014-7/+12
| | | | llvm-svn: 124646
* Fix some corner cases in the __is_base_of logic.John McCall2011-01-281-3/+6
| | | | llvm-svn: 124505
* Give OpaqueValueExpr a source location, because its source locationDouglas Gregor2011-01-281-1/+1
| | | | | | | | might be queried in places where we absolutely require a valid location (e.g., for template instantiation). Fixes some major brokenness in the use of __is_convertible_to. llvm-svn: 124465
* Implement the Microsoft __is_convertible_to type trait, modeling theDouglas Gregor2011-01-271-1/+1
| | | | | | | | | | semantics after the C++0x is_convertible type trait. This implementation is not 100% complete, because it allows access errors to be hard errors (rather than just evaluating false). Original patch by Steven Watanabe! llvm-svn: 124425
* Fixed parameter names.Abramo Bagnara2011-01-271-7/+7
| | | | llvm-svn: 124408
* Do a proper recursive lookup when deciding whether a class's usualJohn McCall2011-01-271-3/+5
| | | | | | | | | deallocation function has a two-argument form. Store the result of this check in new[] and delete[] nodes. Fixes rdar://problem/8913519 llvm-svn: 124373
* Import three interesting bits that apply only to C++ methods.John McCall2011-01-271-0/+3
| | | | llvm-svn: 124349
* When mangling a qualified array type, push the qualifiers down to theJohn McCall2011-01-261-11/+25
| | | | | | element type. Fixes rdar://problem/8913416. llvm-svn: 124315
* Rvalue references for *this: add name mangling for ref-qualifiers,Douglas Gregor2011-01-261-4/+28
| | | | | | | | using rules that I just made up this morning. This encoding has now been proposed to the Itanium C++ ABI group for inclusion, but of course it's still possible that the mangling will change. llvm-svn: 124296
* Rvalue references for *this: Douglas Gregor2011-01-262-3/+18
| | | | | | | | | | | | - Add ref-qualifiers to the type system; they are part of the canonical type. Print & profile ref-qualifiers - Translate the ref-qualifier from the Declarator chunk for functions to the function type. - Diagnose mis-uses of ref-qualifiers w.r.t. static member functions, free functions, constructors, destructors, etc. - Add serialization and deserialization of ref-qualifiers. llvm-svn: 124281
* Use RecordLayout::getBaseClassOffset() where CharUnits are needed instead ofKen Dyck2011-01-261-7/+4
| | | | | | converting getBaseClassOffsetInBits() to CharUnits. llvm-svn: 124274
* Teach TemplateSpecializationTypeLoc::initializeArgLocs() to actuallyDouglas Gregor2011-01-252-3/+39
| | | | | | | | | generate meaningful [*] template argument location information. [*] Well, as meaningful as possible, given that this entire code path is a hack for when we've lost type-source information. llvm-svn: 124211
* In a ObjCMessageExpr with the super class as receiver, 'super' is actually a ↵Argyrios Kyrtzidis2011-01-251-3/+3
| | | | | | ObjCInterfaceType. llvm-svn: 124158
* Improve the printing of C++ construction expressions, from Yuri Gribov!Douglas Gregor2011-01-241-7/+8
| | | | llvm-svn: 124123
* Use attributes for all the override control specifiers.Anders Carlsson2011-01-241-3/+2
| | | | llvm-svn: 124122
* Check whether DependentScopeDeclRefExpr's NestedNameSpecifier exists before ↵Axel Naumann2011-01-241-1/+2
| | | | | | accessing it, both for consistency (see StmtPrinter::VisitDeclRefExpr()) and for other use cases of dependent types. llvm-svn: 124119
* Remove private toCharUnits() helper method, replacing with calls toKen Dyck2011-01-241-17/+10
| | | | | | ASTContext::toCharUnitsFromBits(). llvm-svn: 124092
* Add final/explicit getters and setters to CXXRecordDecl.Anders Carlsson2011-01-221-0/+1
| | | | llvm-svn: 124037
* Implement the preference for move-construction over copy-constructionDouglas Gregor2011-01-211-10/+25
| | | | | | | | | | | | when returning an NRVO candidate expression. For example, this properly picks the move constructor when dealing with code such as MoveOnlyType f() { MoveOnlyType mot; return mot; } The previously-XFAIL'd rvalue-references test case now works, and has been moved into the appropriate paragraph-specific test case. llvm-svn: 123992
* Add some tests for reference-collapsing and referencing bindingDouglas Gregor2011-01-201-0/+3
| | | | | | | | | involving rvalue references, to start scoping out what is and what isn't implemented. In the process, tweak some standards citations, type desugaring, and teach the tentative parser about && in ptr-operator. llvm-svn: 123913
* Fix the computation of alignment for fields of packed+aligned structs.John McCall2011-01-203-14/+48
| | | | | | Part of the fix for PR8413. llvm-svn: 123904
* Refactor the dependence computation for DeclRefExpr so that we canDouglas Gregor2011-01-191-38/+68
| | | | | | | reuse it for BlockDeclRefExpr. Do so, fixing the dependence calculate for BlockDeclRefExpr. llvm-svn: 123851
* Implement basic support for the use of variadic templates and blocksDouglas Gregor2011-01-191-0/+12
| | | | | | | | | | | | | | | | | together. In particular: - Handle the use of captured parameter pack names within blocks (BlockDeclRefExpr understands parameter packs now) - Handle the declaration and expansion of parameter packs within a block's parameter list, e.g., ^(Args ...args) { ... }) - Handle instantiation of blocks where the return type was not explicitly specified. (unrelated, but necessary for my tests). Together, these fixes should make blocks and variadic templates work reasonably well together. Note that BlockDeclRefExpr is still broken w.r.t. its computation of type and value dependence, which will still cause problems for blocks in templates. llvm-svn: 123849
* Implement support for non-type template parameter packs whose type isDouglas Gregor2011-01-193-27/+116
| | | | | | | | | | | | | | | | | | | | | a pack expansion, e.g., the parameter pack Values in: template<typename ...Types> struct Outer { template<Types ...Values> struct Inner; }; This new implementation approach introduces the notion of an "expanded" non-type template parameter pack, for which we have already expanded the types of the parameter pack (to, say, "int*, float*", for Outer<int*, float*>) but have not yet expanded the values. Aside from creating these expanded non-type template parameter packs, this patch updates template argument checking and non-type template parameter pack instantiation to make use of the appropriate types in the parameter pack. llvm-svn: 123845
* Change the canonical representation of array types to store qualifiers on theJohn McCall2011-01-192-193/+177
| | | | | | | | | | | | outermost array types and not on the element type. Move the CanonicalType member from Type to ExtQualsTypeCommonBase; the canonical type on an ExtQuals node includes the qualifiers on the ExtQuals. Assorted optimizations enabled by this change. getQualifiers(), hasQualifiers(), etc. should all now implicitly look through array types. llvm-svn: 123817
* Change QualType::getTypePtr() to return a const pointer, then change aJohn McCall2011-01-1912-112/+118
| | | | | | thousand other things which were (generally inadvertantly) relying on that. llvm-svn: 123814
* Fix some unnecessarily complicated code for canonicalizing variably-modifiedJohn McCall2011-01-181-43/+119
| | | | | | parameter types. llvm-svn: 123753
* Generalize some operations on qualifiers. QualType::getQualifiers() andJohn McCall2011-01-182-51/+73
| | | | | | | ::getCVRQualifiers() now look through array types, like all the other standard queries. Also, make a 'split' variant of getUnqualifiedType(). llvm-svn: 123751
* Introduce the notion of a "minimal" import of ASTs, to better support LLDB.Douglas Gregor2011-01-181-4/+26
| | | | llvm-svn: 123723
* Replace calls to CharUnits::fromQuantity() with onesKen Dyck2011-01-182-17/+11
| | | | | | ASTContext::toCharUnitsFromBits() when converting from bit sizes to char units. llvm-svn: 123715
* AST/InheritViz: Remove all internal uses of PathV1.Michael J. Spencer2011-01-151-22/+17
| | | | llvm-svn: 123553
* Add toCharUnitsInBits() to simplify the many calls to ↵Ken Dyck2011-01-151-7/+12
| | | | | | CharUnits::fromQuantity() of the form CharUnits::fromQuantity(bitSize, Context.getCharWidth()). llvm-svn: 123542
* Introduce a new kind of TemplateName that captures a substitutedDouglas Gregor2011-01-154-6/+81
| | | | | | | | | | | | | | | template template parameter pack that cannot be fully expanded because its enclosing pack expansion could not be expanded. This form of TemplateName plays the same role as SubstTemplateTypeParmPackType and SubstNonTypeTemplateParmPackExpr do for template type parameter packs and non-type template parameter packs, respectively. We should now handle these multi-level pack expansion substitutions anywhere. The largest remaining gap in our variadic-templates support is that we cannot cope with non-type template parameter packs whose type is a pack expansion. llvm-svn: 123521
* Introduce a new expression kind, SubstNonTypeTemplateParmPackExpr,Douglas Gregor2011-01-156-0/+48
| | | | | | | | | that captures the substitution of a non-type template argument pack for a non-type template parameter pack within a pack expansion that cannot be fully expanded. This follows the approach taken by SubstTemplateTypeParmPackType. llvm-svn: 123506
* Teach template template argument pack expansions to keep track of theDouglas Gregor2011-01-144-5/+16
| | | | | | | number of expansions, when we know it, and propagate that information through Sema. llvm-svn: 123493
* Teach PackExpansionExpr to keep track of the number of pack expansionsDouglas Gregor2011-01-142-2/+3
| | | | | | it will expand to, if known. Propagate this information throughout Sema. llvm-svn: 123470
* Keep track of the number of expansions to be produced from a type packDouglas Gregor2011-01-143-5/+11
| | | | | | | | | | | | | | | | | | | | | | | expansion, when it is known due to the substitution of an out parameter pack. This allows us to properly handle substitution into pack expansions that involve multiple parameter packs at different template parameter levels, even when this substitution happens one level at a time (as with partial specializations of member class templates and the signatures of member function templates). Note that the diagnostic we provide when there is an arity mismatch between an outer parameter pack and an inner parameter pack in this case isn't as clear as the normal diagnostic for an arity mismatch. However, this doesn't matter because these cases are very, very rare and (even then) only typically occur in a SFINAE context. The other kinds of pack expansions (expression, template, etc.) still need to support optional tracking of the number of expansions, and we need the moral equivalent of SubstTemplateTypeParmPackType for substituted argument packs of template template and non-type template parameters. llvm-svn: 123448
* Fix a few warnings stemming from my inability to properly fill outDouglas Gregor2011-01-141-0/+15
| | | | | | switch() statements. llvm-svn: 123429
* Start implementing support for substitution into pack expansions thatDouglas Gregor2011-01-145-0/+81
| | | | | | | | | | | | | | | | | involve template parameter packs at multiple template levels that occur within the signatures members of class templates (and partial specializations thereof). This is a work-in-progress that is deficient in several ways, notably: - It only works for template type parameter packs, but we need to also support non-type template parameter packs and template template parameter packs. - It doesn't keep track of the lengths of the substituted argument packs in the expansion, so it can't properly diagnose length mismatches. However, this is a concrete step in the right direction. llvm-svn: 123425
* Replace a literal '8' with getCharWidth().Ken Dyck2011-01-141-1/+2
| | | | llvm-svn: 123421
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-135-0/+3957
| | | | | | | | | | | | | | process, perform a number of refactorings: - Move MiscNameMangler member functions to MangleContext - Remove GlobalDecl dependency from MangleContext - Make MangleContext abstract and move Itanium/Microsoft functionality to their own classes/files - Implement ASTContext::createMangleContext and have CodeGen use it No (intended) functionality change. llvm-svn: 123386
* Add the location of the right parenthesis of a C++ named castDouglas Gregor2011-01-121-8/+15
| | | | | | | (static_cast, dynamic_cast, reinterpret_cast, or const_cast) to improve source-location information. Fixes PR8960. llvm-svn: 123336
* PR3558: mark "logically const" accessor methods in ASTContext as const,Jay Foad2011-01-1213-188/+208
| | | | | | | and mark the fields they use as mutable. This allows us to remove a few const_casts. llvm-svn: 123314
* Slight bugfix to the attribute-distribution logic for GC attributes.John McCall2011-01-121-18/+24
| | | | | | Slight optimization of getObjCGCAttrKind. llvm-svn: 123295
* Add TemplateArgument::CreatePackCopy() to create a new parameter packDouglas Gregor2011-01-112-5/+14
| | | | | | | in ASTContext-allocated memory, copying the provided template arguments. Use this new routine where we can. No functionality change. llvm-svn: 123289
* Implement the last bullet of [temp.deduct.type]p5 and part of the lastDouglas Gregor2011-01-112-1/+18
| | | | | | | | | sentence of [temp.deduct.call]p1, both of which concern the non-deducibility of parameter packs not at the end of a parameter-type-list. The latter isn't fully implemented yet; see the new FIXME. llvm-svn: 123210
* Fix a comment typo.Bob Wilson2011-01-101-1/+1
| | | | llvm-svn: 123184
* Don't crash if SpecString is an empty string.Francois Pichet2011-01-091-1/+1
| | | | llvm-svn: 123134
* Rename CXXCtorInitializer::BaseOrMember to Initializee, since it will also beAlexis Hunt2011-01-081-9/+9
| | | | | | used to store the CXXConstructorDecl in a delegating constructor. llvm-svn: 123095
* Renamed CXXBaseOrMemberInitializer to CXXCtorInitializer. This is both shorter,Alexis Hunt2011-01-083-39/+40
| | | | | | | more accurate, and makes it make sense for it to hold a delegating constructor call. llvm-svn: 123084
OpenPOWER on IntegriCloud