[cfe-commits] r73641 - in /cfe/trunk: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/AST/TypeNodes.def lib/AST/ASTContext.cpp lib/AST/Type.cpp lib/Sema/Sema.h lib/Sema/SemaDecl.cpp lib/Sema/SemaDeclAttr.cpp lib/Sema/SemaDec

Douglas Gregor dgregor at apple.com
Thu Jun 18 07:12:09 PDT 2009


On Jun 17, 2009, at 6:50 PM, Eli Friedman <eli.friedman at gmail.com>  
wrote:

> On Wed, Jun 17, 2009 at 5:28 PM, Chris Lattner<clattner at apple.com>  
> wrote:
>> +  /// getDependentSizedExtVectorType - Returns a non-unique  
>> reference
>> to
>> +  /// the type for a dependently-sized vector of the specified  
>> element
>> +  /// type. FIXME: We will need these to be uniqued, or at least
>> +  /// comparable, at some point.
>> +  QualType getDependentSizedExtVectorType(QualType VectorType,
>> +                                          Expr *SizeExpr,
>> +                                          SourceLocation AttrLoc);
>>
>> If this includes a Loc, uniquing will never reuse a type.  Is there
>> really any reason to unique these?
>
> I don't think so; the only reasons to unique types are to save memory
> and to speed up tests for type identity, and neither of those seems
> relevant here (it's a rare construct, and we can't actually do any
> interesting comparisons between dependent types.)

We actually do need be able to perform comparisons between dependent  
types, to match one template declaration to another, e.g.,

   template<class> struct A;
   template<int> struct X;

   template<int N> struct A<X<N>>;
   template<int M> struct A<X<M>>; // redeclares partial spec above

This also happens when matching out-of-line member definitions of  
class templates (which we can't do yet) and function templates (ditto).

   - Doug 
     



More information about the cfe-commits mailing list