This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA][PATCH][PR tree-optimization/64058] Improve and stabilize sorting of coalesce pairs


On 03/14/2016 07:08 PM, Trevor Saunders wrote:

To work around the narrow API in the comparison function we have to either
store additional data in each node or have them available in globals.  The
former would be horribly wasteful, the latter is just ugly.  I choose the
latter in the lazy evaluation of the conflicts version.

its a bit ugly in C++98, but you can give std::sort a random object with
operator () to compare with.
So we could just wrap the object with a class that has a suitable operator? I like that much more than mucking around with global variables. Let me give that a whirl.

Jeff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]