[cfe-commits] [Request for approval] Allow clang library applications to get specializations

Peter Collingbourne peter at pcc.me.uk
Tue Jul 27 11:55:20 PDT 2010


Hi,

Another possibility would be to expose an iterator
specs_begin()..specs_end() over the set of specialisations.  This way
we don't need to copy the vector and the client still doesn't need
to care how the specialisation list is stored.

(N.B. My application also needs to access the specialisation list.)

Thanks,

On Tue, Jul 27, 2010 at 08:25:26PM +0300, Argyrios Kyrtzidis wrote:
> Hi Abramo,
> 
> How about adding a method to get the specializations in a vector, like the already existing:
> 
>   /// \brief Retrieve the partial specializations as an ordered list.
>   void getPartialSpecializations(
>           llvm::SmallVectorImpl<ClassTemplatePartialSpecializationDecl *> &PS);
> 
> 
> Users of the template decls interface would not need to depend on how the specializations are stored.
> For example, before I changed getSpecializations() to 'protected', the set contained the latest redeclarations but now the set contains just the canonical decls and we return the latest when the client makes a query about the specializations.
> 
> -Argiris
> 
> 
> On Jul 27, 2010, at 12:41 PM, Abramo Bagnara wrote:
> 
> > The following patch restores the "public" access specifier for method
> > getSpecializations() of FunctionTemplateDecl as well as methods
> > getSpecializations() and getPartialSpecializations() of ClassTemplateDecl.
> > 
> > They were recently downgraded to "protected", but it seems that clients
> > such as our application have no other way to query the set of all
> > specializations of a given template.
> > 
> > <public-specializations.patch>_______________________________________________
> > cfe-commits mailing list
> > cfe-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
> 

> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits


-- 
Peter



More information about the cfe-commits mailing list