[PATCH] D18775: NFC: make AtomicOrdering an enum class

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 6 12:42:34 PDT 2016


jfb added a comment.

In http://reviews.llvm.org/D18775#393509, @jyknight wrote:

> If we're having this churn, I'd at least like to get some safety out of it. :) Looks like = delete would work:
>
>   bool operator<(AtomicOrdering, AtomicOrdering) = delete;
>   bool operator>(AtomicOrdering, AtomicOrdering) = delete;
>   bool operator<=(AtomicOrdering, AtomicOrdering) = delete;
>   bool operator>=(AtomicOrdering, AtomicOrdering) = delete;


Ha, C++11!

I did this and created two new methods to stand in for comparison. MergeFunctions still does a full-on comparison but that's OK because all it wants is a way to order all `Instruction` (it doesn't care about atomic ordering).

I created http://reviews.llvm.org/D18840 to update clang accordingly. If it all looks good to you I propose that I commit this patch *without* the deleted operators, then commit the clang one, and then commit the deleted operators. That avoids the dependency with clang, which will reduce bots being sad if they don't sync intelligently (and then send me mail about it).


http://reviews.llvm.org/D18775





More information about the llvm-commits mailing list