[cfe-dev] Patch & feedback request

Sebastian Redl sebastian.redl at getdesigned.at
Mon Jul 27 04:16:57 PDT 2009


On Mon, 27 Jul 2009 10:46:12 +0200, Erik Verbruggen <erikjv at me.com> wrote:
> On Sunday, 26 July, 2009, at 06:08PM, "Mike Stump" <mrs at apple.com> wrote:
>>On Jul 26, 2009, at 7:16 AM, Erik Verbruggen wrote:
>>> Attached is a patch
>>
>>Looks good to me.  I kinda which we had all the canonicalization  
>>patches in as this would be just slightly different.  Possibly a  
>>FIXME: redo post canonicalization with the type system work...
>>
>>The only question I would have is, do people want a total ordering for  
>>QualType?
> 
> To be honest, I wouldn't, but I used std::map, which requires a less-than
> operator/ordering. Hence the operator in QualType. But that was one of
the
> reasons for the feedback request.

I believe, from previous reviews I've seen, that an operator < should only
be defined if there is a natural ordering. If you simply need an ordering
for a std::map (which you may want to replace by one of LLVM's own ADTs, by
the way - another point that comes up often, though it depends on what you
do with the map), it is, I believe, generally preferred to write a custom
ordering predicate and supply it as a template parameter.

Sebastian



More information about the cfe-dev mailing list