summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Teach NestedNameSpecifier to keep track of namespace aliases the sameDouglas Gregor2011-02-241-1/+9
| | | | | | | | way it keeps track of namespaces. Previously, we would map from the namespace alias to its underlying namespace when building a nested-name-specifier, losing source information in the process. llvm-svn: 126358
* Emit the structure layout of the block literal parameter to a blockJohn McCall2011-02-221-73/+1
| | | | | | | | | | invocation function into the debug info. Rather than faking up a class, which is tricky because of the custom layout we do, we just emit a struct directly from the layout information we've already got. Also, don't emit an unnecessarily parameter alloca for this "variable". llvm-svn: 126255
* Use an unused-except-in-Debug variable.Matt Beaumont-Gay2011-02-221-1/+1
| | | | llvm-svn: 126240
* Tweaks to C++0x deduced auto type support:Richard Smith2011-02-211-5/+15
| | | | | | | | * Flag indicating 'we're parsing this auto typed variable's initializer' moved from VarDecl to Sema * Temporary template parameter list for auto deduction is now allocated on the stack. * Deduced 'auto' types are now uniqued. llvm-svn: 126139
* Implement the C++0x deduced 'auto' feature.Richard Smith2011-02-201-4/+15
| | | | | | This fixes PR 8738, 9060 and 9132. llvm-svn: 126069
* Add const qualifier to getTypeInfoInChars().Ken Dyck2011-02-201-2/+2
| | | | llvm-svn: 126064
* Fix PR9253, allowing attribute(aligned) to reduce the alignment ofChris Lattner2011-02-191-1/+7
| | | | | | a typedef. llvm-svn: 126059
* Convert RecordLayout::Alignment to CharUnits from bit units. No change inKen Dyck2011-02-151-3/+3
| | | | | | functionality intended. llvm-svn: 125549
* Fix a block sema bug where result type of initializerFariborz Jahanian2011-02-111-3/+8
| | | | | | | | | is unqualified but its initialized is qualified. This is for c only and fixes the imm. problem. c++ is more involved and is wip. // rdar://8979379 llvm-svn: 125386
* Add a helper function, ASTContext::toBits(), that converts sizes inKen Dyck2011-02-111-2/+7
| | | | | | | CharUnits to sizes in bits, and use it to tidy up the places where the conversion was done explicitly. llvm-svn: 125332
* Move the check that gives functions with unique-external types unique-externalJohn McCall2011-02-101-4/+0
| | | | | | | linkage into Decl.cpp. Disable this logic for extern "C" functions, because the operative rule there is weaker. Fixes rdar://problem/8898466 llvm-svn: 125268
* AST, Sema, Serialization: keep track of cudaConfigureCallPeter Collingbourne2011-02-091-0/+1
| | | | llvm-svn: 125216
* Convert RecordLayout::Size to CharUnits from bits. No changes toKen Dyck2011-02-091-2/+2
| | | | | | functionality intended. llvm-svn: 125156
* A few more tweaks to the blocks AST representation: John McCall2011-02-071-3/+6
| | | | | | | | | | | | | | | | | - BlockDeclRefExprs always store VarDecls - BDREs no longer store copy expressions - BlockDecls now store a list of captured variables, information about how they're captured, and a copy expression if necessary With that in hand, change IR generation to use the captures data in blocks instead of walking the block independently. Additionally, optimize block layout by emitting fields in descending alignment order, with a heuristic for filling in words when alignment of the end of the block header is insufficient for the most aligned field. llvm-svn: 125005
* Fixed parameter names.Abramo Bagnara2011-01-271-7/+7
| | | | llvm-svn: 124408
* Teach TemplateSpecializationTypeLoc::initializeArgLocs() to actuallyDouglas Gregor2011-01-251-1/+1
| | | | | | | | | 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
* Fix the computation of alignment for fields of packed+aligned structs.John McCall2011-01-201-6/+28
| | | | | | Part of the fix for PR8413. llvm-svn: 123904
* Implement support for non-type template parameter packs whose type isDouglas Gregor2011-01-191-10/+42
| | | | | | | | | | | | | | | | | | | | | 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-191-191/+157
| | | | | | | | | | | | 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-191-27/+32
| | | | | | 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-181-13/+33
| | | | | | | ::getCVRQualifiers() now look through array types, like all the other standard queries. Also, make a 'split' variant of getUnqualifiedType(). llvm-svn: 123751
* 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-151-0/+30
| | | | | | | | | | | | | | | 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
* Teach template template argument pack expansions to keep track of theDouglas Gregor2011-01-141-1/+1
| | | | | | | number of expansions, when we know it, and propagate that information through Sema. llvm-svn: 123493
* Keep track of the number of expansions to be produced from a type packDouglas Gregor2011-01-141-4/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* Start implementing support for substitution into pack expansions thatDouglas Gregor2011-01-141-0/+36
| | | | | | | | | | | | | | | | | 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
* Move name mangling support from CodeGen to AST. In thePeter Collingbourne2011-01-131-0/+13
| | | | | | | | | | | | | | 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
* PR3558: mark "logically const" accessor methods in ASTContext as const,Jay Foad2011-01-121-119/+128
| | | | | | | 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
* Introduce an AttributedType, but don't actually use it anywhere yet.John McCall2011-01-061-0/+25
| | | | | | | | | | The initial TreeTransform is a cop-out, but it's more-or-less equivalent to what we were doing before, or rather what we're doing now and might eventually stop doing in favor of using this type. I am simultaneously intrigued by the possibilities of rebuilding a dependent Attri llvm-svn: 122942
* Replace the representation of template template argument packDouglas Gregor2011-01-051-1/+6
| | | | | | | | | | | | | expansions with something that is easier to use correctly: a new template argment kind, rather than a bit on an existing kind. Update all of the switch statements that deal with template arguments, fixing a few latent bugs in the process. I"m happy with this representation, now. And, oh look! Template instantiation and deduction work for template template argument pack expansions. llvm-svn: 122896
* Implement support for template template parameter packs, e.g.,Douglas Gregor2011-01-051-3/+5
| | | | | | | template<template<class> class ...Metafunctions> struct apply_to_each; llvm-svn: 122874
* Expose Objective-C type encodings of declarations to libclang users. This ↵David Chisnall2010-12-301-0/+36
| | | | | | also adds a method in ASTContext which encodes FunctionDecls using the same encoding format that is used for Objective-C methods. llvm-svn: 122639
* Fix for PR8695.David Chisnall2010-12-261-1/+4
| | | | llvm-svn: 122564
* The -fshort-wchar option causes wchar_t to become unsigned, in addition to beingChris Lattner2010-12-251-6/+12
| | | | | | | 16-bits in size. Implement this by splitting WChar into two enums, like we have for char. This fixes a miscompmilation of XULRunner, PR8856. llvm-svn: 122558
* Refactor how we collect attributes during parsing, and add slots for attributesJohn McCall2010-12-241-2/+2
| | | | | | | on array and function declarators. This is pretty far from complete, and I'll revisit it later if someone doesn't beat me to it. llvm-svn: 122535
* Add an AST representation for non-type template parameterDouglas Gregor2010-12-231-0/+1
| | | | | | | | | | | | | | packs, e.g., template<typename T, unsigned ...Dims> struct multi_array; along with semantic analysis support for finding unexpanded non-type template parameter packs in types, expressions, and so on. Template instantiation involving non-type template parameter packs probably doesn't work yet. That'll come soon. llvm-svn: 122527
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-12/+12
| | | | | | | | | new gcc warning that complains on self-assignments and self-initializations. Fix one bug found by the warning, in which one clang::OverloadCandidate constructor failed to initialize its FunctionTemplate member. llvm-svn: 122459
* Fix the noreturn conversion to only strip off a single level of indirection.John McCall2010-12-211-52/+10
| | | | | | | Apply the noreturn attribute while creating a builtin function's type. Remove the getNoReturnType() API. llvm-svn: 122295
* Clean up the handling of template argument packs, especially in theDouglas Gregor2010-12-201-0/+3
| | | | | | | area of printing template arguments. The functionality changes here are limited to cases of variadic templates that aren't yet enabled. llvm-svn: 122250
* Introduce a new type, PackExpansionType, to capture types that areDouglas Gregor2010-12-201-0/+26
| | | | | | | | | | | | | | | | | | | | pack expansions, e.g. given template<typename... Types> struct tuple; template<typename... Types> struct tuple_of_refs { typedef tuple<Types&...> types; }; the type of the "types" typedef is a PackExpansionType whose pattern is Types&. This commit introduces support for creating pack expansions for template type arguments, as above, but not for any other kind of pack expansion, nor for any form of instantiation. llvm-svn: 122223
* Motions towards simplifying how we deal with attribute-qualified function types.John McCall2010-12-191-25/+21
| | | | llvm-svn: 122162
* Function types are compatible (in the C sense) if their regparms are identical.John McCall2010-12-151-16/+20
| | | | llvm-svn: 121821
* Restore r121752 without modification.John McCall2010-12-141-57/+48
| | | | llvm-svn: 121763
* Pull out r121752 in case it's causing the selfhost breakage.John McCall2010-12-141-48/+57
| | | | llvm-svn: 121759
* Factor out most of the extra state in a FunctionProtoType into a separateJohn McCall2010-12-141-57/+48
| | | | | | | class to be passed around. The line between argument and return types and everything else is kindof vague, but I think it's justifiable. llvm-svn: 121752
* Added ParenType type node.Abramo Bagnara2010-12-101-0/+34
| | | | llvm-svn: 121488
* It's kindof silly that ExtQuals has an ASTContext&, and we can use thatJohn McCall2010-12-101-3/+3
| | | | | | | | | | space better. Remove this reference. To make that work, change some APIs (most importantly, getDesugaredType()) to take an ASTContext& if they need to return a QualType. Simultaneously, diminish the need to return a QualType by introducing some useful APIs on SplitQualType, which is just a std::pair<const Type *, Qualifiers>. llvm-svn: 121478
* Move the "volatile" bit into QualType's "fast" qualifier set,Douglas Gregor2010-12-101-11/+0
| | | | | | | | increasing the required type alignment from 8 to 16. This provides a 2.5% speedup for -fsyntax-only on a token-cached Cocoa.h, while only increasing memory consumption in the ASTContext by 0.8%. llvm-svn: 121474
OpenPOWER on IntegriCloud