Patch & feedback request

Hello all,

Attached is a patch for the "FIXME: We should detect handlers for the same type as an earlier one." As this is my first patch for Clang, I took something simple to fix, hence this one, and not the "... earlier handler catches a superclass." Before I do that last one, I would like to have some feedback on the patch, and a bit of guidance on how to take it from here.

Regards,
Erik Verbruggen.

Ps: in case it matters, the patch is against r77072

multiple-exception-handlers-for-type.patch (3.17 KB)

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.

And, like I said in the other mail, how do I take it from here? Will somebody apply this patch, should I svn commit it myself, etc.

Best,
Erik.

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

I don't see what ordering has to do with it, or what canonical types do either. He's doing type equality checks.

-Chris

Chris Lattner wrote:

Right, but the predicate ("how it sorts") doesn't matter.

-Chris