[llvm] r265685 - NFC: disallow comparison of AtomicOrdering

JF Bastien via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 7 08:50:06 PDT 2016


Author: jfb
Date: Thu Apr  7 10:50:05 2016
New Revision: 265685

URL: http://llvm.org/viewvc/llvm-project?rev=265685&view=rev
Log:
NFC: disallow comparison of AtomicOrdering

Follow-up to D18775 and related clang change. AtomicOrdering is a lattice, 'stronger' is the right thing to do, direct comparison is fraught with peril.

Modified:
    llvm/trunk/include/llvm/IR/Instructions.h

Modified: llvm/trunk/include/llvm/IR/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/IR/Instructions.h?rev=265685&r1=265684&r2=265685&view=diff
==============================================================================
--- llvm/trunk/include/llvm/IR/Instructions.h (original)
+++ llvm/trunk/include/llvm/IR/Instructions.h Thu Apr  7 10:50:05 2016
@@ -53,6 +53,11 @@ enum class AtomicOrdering {
   SequentiallyConsistent = 7
 };
 
+bool operator<(AtomicOrdering, AtomicOrdering) = delete;
+bool operator>(AtomicOrdering, AtomicOrdering) = delete;
+bool operator<=(AtomicOrdering, AtomicOrdering) = delete;
+bool operator>=(AtomicOrdering, AtomicOrdering) = delete;
+
 /// String used by LLVM IR to represent atomic ordering.
 static inline const char *toIRString(AtomicOrdering ao) {
   static const char *names[8] = {"not_atomic", "unordered", "monotonic",




More information about the llvm-commits mailing list