[cfe-commits] [Patch] -Wduplicate-enum which fixes PR6343

Ted Kremenek kremenek at apple.com
Tue Aug 14 21:48:17 PDT 2012


On Aug 14, 2012, at 2:32 PM, Richard Trieu <rtrieu at google.com> wrote:

> At a high level, I honestly find this logic to be more complicated than I would have expected.  The sorting seems unnecessary, and will report diagnostics in an unnatural order (first based on enum constant value, then on declaration order).  A straight linear pass seems more naturally to me, and DenseMap is very efficient.
> Is there a comparison between the different containers in LLVM and the STL containers?

This is a reasonable place to start:

  http://llvm.org/docs/ProgrammersManual.html#ds_map

The key with DenseMap is that it is probed hashtable.  There is one big allocation for the entire table, instead of a bunch of buckets.  When applicable, it can be very fast, and feels like the right data structure to use here.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120814/0c1cee59/attachment.html>


More information about the cfe-commits mailing list