From 019b0ef15e966ecafa6cdfa357b00de09c332633 Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Mon, 26 Oct 2020 10:31:05 -0700 Subject: [NFC] `using namespace Abstract` to make matchers more compact (#3284) This change makes matchers in OptimizeInstructions more compact and readable by removing the explicit `Abstract::` namespace from individual operations. In some cases, this makes multi-line matcher expressions fit on a single line. This change is only possible because it also adds an explicit "RMW" prefix to each element of the `AtomicRMWOp` enumeration. Without that, their names conflicted with the names of Abstract ops. --- src/wasm-interpreter.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/wasm-interpreter.h') diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 5ca590208..d84591a00 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -2165,22 +2165,22 @@ private: NOTE_EVAL1(loaded); auto computed = value.getSingleValue(); switch (curr->op) { - case Add: + case RMWAdd: computed = loaded.add(computed); break; - case Sub: + case RMWSub: computed = loaded.sub(computed); break; - case And: + case RMWAnd: computed = loaded.and_(computed); break; - case Or: + case RMWOr: computed = loaded.or_(computed); break; - case Xor: + case RMWXor: computed = loaded.xor_(computed); break; - case Xchg: + case RMWXchg: break; } instance.doAtomicStore(addr, curr->bytes, computed); -- cgit v1.2.3