From db9124f1de0478dcac525009b6f1589b44a7edd8 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Fri, 26 Apr 2019 16:59:41 -0700 Subject: Apply format changes from #2048 (#2059) Mass change to apply clang-format to everything. We are applying this in a PR by me so the (git) blame is all mine ;) but @aheejin did all the work to get clang-format set up and all the manual work to tidy up some things to make the output nicer in #2048 --- src/wasm-features.h | 50 +++++++++++++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 19 deletions(-) (limited to 'src/wasm-features.h') diff --git a/src/wasm-features.h b/src/wasm-features.h index 6ef704f82..d31715f18 100644 --- a/src/wasm-features.h +++ b/src/wasm-features.h @@ -36,13 +36,20 @@ struct FeatureSet { static std::string toString(Feature f) { switch (f) { - case Atomics: return "threads"; - case MutableGlobals: return "mutable-globals"; - case TruncSat: return "nontrapping-float-to-int"; - case SIMD: return "simd"; - case BulkMemory: return "bulk-memory"; - case SignExt: return "sign-ext"; - default: WASM_UNREACHABLE(); + case Atomics: + return "threads"; + case MutableGlobals: + return "mutable-globals"; + case TruncSat: + return "nontrapping-float-to-int"; + case SIMD: + return "simd"; + case BulkMemory: + return "bulk-memory"; + case SignExt: + return "sign-ext"; + default: + WASM_UNREACHABLE(); } } @@ -60,7 +67,9 @@ struct FeatureSet { bool hasAll() const { return features & All; } void makeMVP() { features = MVP; } - void set(Feature f, bool v = true) { features = v ? (features | f) : (features & ~f); } + void set(Feature f, bool v = true) { + features = v ? (features | f) : (features & ~f); + } void setAtomics(bool v = true) { set(Atomics, v); } void setMutableGlobals(bool v = true) { set(MutableGlobals, v); } void setTruncSat(bool v = true) { set(TruncSat, v); } @@ -74,14 +83,19 @@ struct FeatureSet { features = features & ~other.features & All; } - template - void iterFeatures(F f) { - if (hasAtomics()) f(Atomics); - if (hasBulkMemory()) f(BulkMemory); - if (hasMutableGlobals()) f(MutableGlobals); - if (hasTruncSat()) f(TruncSat); - if (hasSignExt()) f(SignExt); - if (hasSIMD()) f(SIMD); + template void iterFeatures(F f) { + if (hasAtomics()) + f(Atomics); + if (hasBulkMemory()) + f(BulkMemory); + if (hasMutableGlobals()) + f(MutableGlobals); + if (hasTruncSat()) + f(TruncSat); + if (hasSignExt()) + f(SignExt); + if (hasSIMD()) + f(SIMD); } bool operator<=(const FeatureSet& other) const { @@ -92,9 +106,7 @@ struct FeatureSet { return *this <= other && other <= *this; } - bool operator!=(const FeatureSet& other) const { - return !(*this == other); - } + bool operator!=(const FeatureSet& other) const { return !(*this == other); } FeatureSet& operator|=(const FeatureSet& other) { features |= other.features; -- cgit v1.2.3