summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/ASTContext.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Add rudimentary support for member pointers to CGDebugInfo.Anders Carlsson2009-12-061-4/+0
| | | | llvm-svn: 90711
* Fix "using typename" and the instantiation of non-dependent using declarations.John McCall2009-12-041-11/+30
| | | | llvm-svn: 90614
* Push overloaded function templates through the parser using a totally differentJohn McCall2009-12-021-39/+24
| | | | | | | leaked data structure than before. This kills off the last remaining explicit uses of OverloadedFunctionDecl in Sema. llvm-svn: 90306
* Fix a crash when ivar type is a __strong SEL. Fallout fromFariborz Jahanian2009-11-301-5/+5
| | | | | | recent change to make SEL a builtin type (fixes radar 7425510). llvm-svn: 90145
* Allow user re-definition of SEL as well as accessing its fields.Fariborz Jahanian2009-11-251-1/+1
| | | | | | This fixes pr5611. llvm-svn: 89895
* Helper function for turning a TemplateName into a DeclarationName.John McCall2009-11-241-0/+16
| | | | llvm-svn: 89782
* Fixe a crash in encoding of SEL type caused by recent changes.Fariborz Jahanian2009-11-231-4/+5
| | | | llvm-svn: 89696
* Intercept sizeof and alignof references before they get into ASTContext ↵Sebastian Redl2009-11-231-11/+18
| | | | | | 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
* Encapsulate "an array of TemplateArgumentLocs and two angle bracket ↵John McCall2009-11-231-2/+3
| | | | | | | | | | locations" into a new class. Use it pervasively throughout Sema. My fingers hurt. llvm-svn: 89638
* This patch implements objective-c's 'SEL' type as a built-inFariborz Jahanian2009-11-211-16/+5
| | | | | | | | | | | | | | | | | | type and fixes a long-standing code gen. crash reported in at least two PRs and a radar. (radar 7405040 and pr5025). There are couple of remaining issues that I would like for Ted. and Doug to look at: Ted, please look at failure in Analysis/MissingDealloc.m. I have temporarily added an expected-warning to make the test pass. This tests has a declaration of 'SEL' type which may not co-exist with the new changes. Doug, please look at a FIXME in PCHWriter.cpp/PCHReader.cpp. I think the changes which I have ifdef'ed out are correct. They need be considered for in a few Indexer/PCH test cases. llvm-svn: 89561
* Added rudimentary C++0x attribute support.Alexis Hunt2009-11-211-2/+3
| | | | | | | | | | | | | | The following attributes are currently supported in C++0x attribute lists (and in GNU ones as well): - align() - semantics believed to be conformant to n3000, except for redeclarations and what entities it may apply to - final - semantics believed to be conformant to CWG issue 817's proposed wording, except for redeclarations - noreturn - semantics believed to be conformant to n3000, except for redeclarations - carries_dependency - currently ignored (this is an optimization hint) llvm-svn: 89543
* Cope with an amusingly little anomaly with dependent types andDouglas Gregor2009-11-191-8/+18
| | | | | | | | | | | | | | | | | | incomplete array initialization, where we have the following in a template: int a[] = { 1, 2, something-value-dependent }; // ... sizeof(a); The type of "a" appears to be a non-dependent IncompleteArrayType, but treating it as such makes the sizeof(a) fail at template definition time. We now correctly handle this by morphing the IncompleteArrayType into a DependentSizedArrayType with a NULL expression, indicating that its size has no corresponding expression (and, therefore, the type is distinct from others). llvm-svn: 89366
* Incremental progress on using declarations. Split UnresolvedUsingDecl intoJohn McCall2009-11-181-3/+6
| | | | | | | | | | 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
* Added block type introspection support.David Chisnall2009-11-171-0/+48
| | | | | | As per Fariborz's suggestion, committed now but can be reverted later if the used flag is problematic for Apple. llvm-svn: 89134
* First part of changes to eliminate problems with cv-qualifiers andDouglas Gregor2009-11-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sugared types. The basic problem is that our qualifier accessors (getQualifiers, getCVRQualifiers, isConstQualified, etc.) only look at the current QualType and not at any qualifiers that come from sugared types, meaning that we won't see these qualifiers through, e.g., typedefs: typedef const int CInt; typedef CInt Self; Self.isConstQualified() currently returns false! Various bugs (e.g., PR5383) have cropped up all over the front end due to such problems. I'm addressing this problem by splitting each qualifier accessor into two versions: - the "local" version only returns qualifiers on this particular QualType instance - the "normal" version that will eventually combine qualifiers from this QualType instance with the qualifiers on the canonical type to produce the full set of qualifiers. This commit adds the local versions and switches a few callers from the "normal" version (e.g., isConstQualified) over to the "local" version (e.g., isLocalConstQualified) when that is the right thing to do, e.g., because we're printing or serializing the qualifiers. Also, switch a bunch of Context.getCanonicalType(T1).getUnqualifiedType() == Context.getCanonicalType(T2).getQualifiedType() expressions over to Context.hasSameUnqualifiedType(T1, T2) llvm-svn: 88969
* Add an internal CreateRecordDecl that will create a CXXRecordDecl when ↵Anders Carlsson2009-11-141-12/+22
| | | | | | compiling C++ and a RecordDecl otherwise. llvm-svn: 88816
* Wherein the TargetInfo argument to Preprocessor is made 'const' and propogated.Daniel Dunbar2009-11-131-1/+1
| | | | llvm-svn: 87087
* Template argument deduction for template template parameters. ThisDouglas Gregor2009-11-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | permits, among other things, ripping apart and reconstructing templates via partial specialization: template<typename T> struct DeepRemoveConst { typedef T type; }; template<typename T> struct DeepRemoveConst<const T> { typedef typename DeepRemoveConst<T>::type type; }; template<template<typename> class TT, typename T> struct DeepRemoveConst<TT<T> > { typedef TT<typename DeepRemoveConst<T>::type> type; }; Also, fix a longstanding thinko in the code handling partial ordering of class template partial specializations. We were performing the second deduction without clearing out the results of the first deduction. It's amazing we got through so much code with such a horrendous error :( llvm-svn: 86893
* Introduce a new representation for template templateDouglas Gregor2009-11-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | parameters. Rather than storing them as either declarations (for the non-dependent case) or expressions (for the dependent case), we now (always) store them as TemplateNames. The primary change here is to add a new kind of TemplateArgument, which stores a TemplateName. However, making that change ripples to every switch on a TemplateArgument's kind, also affecting TemplateArgumentLocInfo/TemplateArgumentLoc, default template arguments for template template parameters, type-checking of template template arguments, etc. This change is light on testing. It should fix several pre-existing problems with template template parameters, such as: - the inability to use dependent template names as template template arguments - template template parameter default arguments cannot be instantiation However, there are enough pieces missing that more implementation is required before we can adequately test template template parameters. llvm-svn: 86777
* Fix clang's use of DenseMap iterators after r86636 fixed their constness.Jeffrey Yasskin2009-11-101-1/+1
| | | | | | Patch by Victor Zverovich! llvm-svn: 86638
* Make ASTContext::getIntWidth return 1 for all boolean type variations, not ↵Sebastian Redl2009-11-051-1/+1
| | | | | | just for the unqualified, unaliased bool. llvm-svn: 86174
* Allow the element type of arrays to be incomplete in C++.Sebastian Redl2009-11-051-1/+2
| | | | | | This fixes PR5048. Also fix a bug where zero-sized arrays weren't warned about when the size was unsigned. llvm-svn: 86136
* Store the unresolved class type in MemberPointerType's Class field,Douglas Gregor2009-11-041-1/+1
| | | | | | from Peter Collingbourne! llvm-svn: 86030
* Implement support for parsing dependent template-ids that refer toDouglas Gregor2009-11-041-0/+30
| | | | | | | | overloaded operators, e.g., p->template operator+<T>() llvm-svn: 85989
* Fix a crazy canonical-types bug because canonicalizing aDouglas Gregor2009-10-301-1/+1
| | | | | | | | | dependently-sized array type with a given expression might end up returning a non-canonical type; see through that non-canonical type to the underlying canonical type. Yes, I have a test case; no, I can't reduce it to the point where it's worth checking in :( llvm-svn: 85633
* This patch computes composite type of two objective-c expressionsFariborz Jahanian2009-10-301-2/+102
| | | | | | | | | used in a conditional expression by finding the most-derived common super class of the two and qualifies the resulting type by the intersection of the protocl qualifier list of the two objective-c pointer types. ( this is continuation of radar 7334235). llvm-svn: 85554
* Track source information for template arguments and template specializationJohn McCall2009-10-291-6/+16
| | | | | | | types. Preserve it through template instantiation. Preserve it through PCH, although TSTs themselves aren't serializable, so that's pretty much meaningless. llvm-svn: 85500
* Fix <rdar://problem/7330784>. Avoid crashing on 'Class<p>' when generating ↵Steve Naroff2009-10-281-3/+6
| | | | | | meta-data for a class. llvm-svn: 85440
* Type of a conditional expression with two distinct objective-cFariborz Jahanian2009-10-271-0/+22
| | | | | | | class pointer is the most derived common class of the two. This is <rdar://problem/7334235>. llvm-svn: 85337
* Switch alloca/sprintf to SmallString/raw_ostream.Benjamin Kramer2009-10-241-9/+10
| | | | llvm-svn: 84996
* Make the local buffer overflow safe.Fariborz Jahanian2009-10-241-8/+6
| | | | llvm-svn: 84981
* Fixe a buffer overflow problem which causes a crashFariborz Jahanian2009-10-231-2/+6
| | | | | | | in a certain project. Need to have a permananent fix later (FIXME added). llvm-svn: 84980
* Store the builtin types as CanQualTypes. Expand a bit on the CanQual API,John McCall2009-10-231-5/+5
| | | | | | | but also remove some methods that cause ambiguities, and generally make CanQual<blah> more analogous to QualType. llvm-svn: 84976
* Add ASTContext::getTrivialDeclaratorInfo, which initializes a newJohn McCall2009-10-231-0/+7
| | | | | | source info block with a single location. llvm-svn: 84970
* When building types from declarators, instead of building two types (one forJohn McCall2009-10-221-54/+87
| | | | | | | | | | | | | | | | | | | | | the DeclaratorInfo, one for semantic analysis), just build a single type whose canonical type will reflect the semantic analysis (assuming the type is well-formed, of course). To make that work, make a few changes to the type system: * allow the nominal pointee type of a reference type to be a (possibly sugared) reference type. Also, preserve the original spelling of the reference type. Both of these can be ignored on canonical reference types. * Remove ObjCProtocolListType and preserve the associated source information on the various ObjC TypeLocs. Preserve the spelling of protocol lists except in the canonical form. * Preserve some level of source type structure on parameter types, but canonicalize on the canonical function type. This is still a WIP. Drops code size, makes strides towards accurate source location representation, slight (~1.7%) progression on Cocoa.h because of complexity drop. llvm-svn: 84907
* Canonicality is a property of qualified types, not unqualified types.John McCall2009-10-221-16/+16
| | | | llvm-svn: 84891
* fix PR5265: the size of a float3 should be rounded up to its alignment. Chris Lattner2009-10-221-10/+11
| | | | | | This ensures that arrays of float3 are correctly padded. llvm-svn: 84833
* Extend out the block descriptor structure for debug information withMike Stump2009-10-221-3/+54
| | | | | | the copy/dispose helpers as appropriate. llvm-svn: 84817
* Refine collection of BlockDeclRefExprs. WIP.Mike Stump2009-10-211-2/+2
| | | | llvm-svn: 84787
* Complete out debug info generation for captured __block variables. WIP.Mike Stump2009-10-211-7/+63
| | | | llvm-svn: 84768
* Prep work to always preallocate BlockDeclRefExprs so that we canMike Stump2009-10-211-32/+39
| | | | | | | generate the debug information for the first parameter to the block invoke functions. WIP. llvm-svn: 84737
* Add TypeLocBuilder, an API for incrementally creating TypeLocs. ChangeJohn McCall2009-10-211-2/+8
| | | | | | | the API for creating DeclaratorInfos to allow callers to provide an exact size. llvm-svn: 84715
* Refine the type of the first parameter to block invoke functions.Mike Stump2009-10-201-1/+108
| | | | | | | WIP. I have yet to find the magic incantation to get the structure type to be defined. If someone has a pointer, love to hear it. llvm-svn: 84590
* PR5218: Replace IdentifierInfo::getName with StringRef version, now that clientsDaniel Dunbar2009-10-181-0/+1
| | | | | | are updated. llvm-svn: 84447
* When performing template-substitution into a type, don't just replace theJohn McCall2009-10-181-0/+28
| | | | | | | | | | | | | | | | | | TemplateTypeParmType with the substituted type directly; instead, replace it with a SubstTemplateTypeParmType which will note that the type was originally written as a template type parameter. This makes it reasonable to preserve source information even through template substitution. Also define the new SubstTemplateTypeParmType class, obviously. For consistency with current behavior, we stringize these types as if they were the underlying type. I'm not sure this is the right thing to do. At any rate, I paled at adding yet another clause to the don't-desugar 'if' statement, so I extracted a function to do it. The new function also does The Right Thing more often, I think: e.g. if we have a chain of typedefs leading to a vector type, we will now desugar all but the last one. llvm-svn: 84412
* teach getCorrespondingUnsignedType how to handle vectors of integers,Chris Lattner2009-10-171-4/+12
| | | | | | fixing PR4838. llvm-svn: 84353
* Remove the ConstantArrayType subtypes. This information is preserved in theJohn McCall2009-10-161-49/+0
| | | | | | | | | | TypeLoc records for declarations; it should not be necessary to represent it directly in the type system. Please complain if you were using these classes and feel you can't replicate previous functionality using the TypeLoc API. llvm-svn: 84222
* Testing and some minor fixes for explicit template instantiation.Douglas Gregor2009-10-141-2/+2
| | | | llvm-svn: 84129
* For instantiations of static data members of class templates, keepDouglas Gregor2009-10-081-4/+7
| | | | | | | | track of the kind of specialization or instantiation. Also, check the scope of the specialization and ensure that a specialization declaration without an initializer is not a definition. llvm-svn: 83533
* Introduce ObjCProtocolListType type subclass.Argyrios Kyrtzidis2009-09-291-0/+23
| | | | | | | | | This is used only for keeping detailed type source information for protocol references, it should not participate in the semantics of the type system. Its protocol list is not canonicalized. llvm-svn: 83093
OpenPOWER on IntegriCloud