From 74909e4b6e9bc0da6c197cf6c4419991a8dc335f Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Mon, 21 Jun 2021 16:34:02 -0700 Subject: Rename MachineMemOperand::getOrdering -> getSuccessOrdering. Since this method can apply to cmpxchg operations, make sure it's clear what value we're actually retrieving. This will help ensure we don't accidentally ignore the failure ordering of cmpxchg in the future. We could potentially introduce a getOrdering() method on AtomicSDNode that asserts the operation isn't cmpxchg, but not sure that's worthwhile. Differential Revision: https://reviews.llvm.org/D103338 --- llvm/lib/CodeGen/MachineOperand.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'llvm/lib/CodeGen/MachineOperand.cpp') diff --git a/llvm/lib/CodeGen/MachineOperand.cpp b/llvm/lib/CodeGen/MachineOperand.cpp index 145423a..79f59cf 100644 --- a/llvm/lib/CodeGen/MachineOperand.cpp +++ b/llvm/lib/CodeGen/MachineOperand.cpp @@ -1038,7 +1038,7 @@ MachineMemOperand::MachineMemOperand(MachinePointerInfo ptrinfo, Flags f, AtomicInfo.SSID = static_cast(SSID); assert(getSyncScopeID() == SSID && "Value truncated"); AtomicInfo.Ordering = static_cast(Ordering); - assert(getOrdering() == Ordering && "Value truncated"); + assert(getSuccessOrdering() == Ordering && "Value truncated"); AtomicInfo.FailureOrdering = static_cast(FailureOrdering); assert(getFailureOrdering() == FailureOrdering && "Value truncated"); } @@ -1107,8 +1107,8 @@ void MachineMemOperand::print(raw_ostream &OS, ModuleSlotTracker &MST, printSyncScope(OS, Context, getSyncScopeID(), SSNs); - if (getOrdering() != AtomicOrdering::NotAtomic) - OS << toIRString(getOrdering()) << ' '; + if (getSuccessOrdering() != AtomicOrdering::NotAtomic) + OS << toIRString(getSuccessOrdering()) << ' '; if (getFailureOrdering() != AtomicOrdering::NotAtomic) OS << toIRString(getFailureOrdering()) << ' '; -- cgit v1.1