diff options
author | Alon Zakai <azakai@google.com> | 2019-04-26 16:59:41 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-04-26 16:59:41 -0700 |
commit | db9124f1de0478dcac525009b6f1589b44a7edd8 (patch) | |
tree | fa26395a0f6cca53cf5cb6e10189f989c5bfa847 /src/compiler-support.h | |
parent | 87636dccd404a340d75acb1d96301581343f29ca (diff) | |
download | binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.gz binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.tar.bz2 binaryen-db9124f1de0478dcac525009b6f1589b44a7edd8.zip |
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
Diffstat (limited to 'src/compiler-support.h')
-rw-r--r-- | src/compiler-support.h | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/src/compiler-support.h b/src/compiler-support.h index e7cb4db8c..911d92ef5 100644 --- a/src/compiler-support.h +++ b/src/compiler-support.h @@ -18,26 +18,34 @@ #define wasm_compiler_support_h #ifndef __has_feature -# define __has_feature(x) 0 +#define __has_feature(x) 0 #endif #ifndef __has_builtin -# define __has_builtin(x) 0 +#define __has_builtin(x) 0 #endif // If control flow reaches the point of the WASM_UNREACHABLE(), the program is // undefined. #if __has_builtin(__builtin_unreachable) && defined(NDEBUG) -# define WASM_UNREACHABLE() __builtin_unreachable() +#define WASM_UNREACHABLE() __builtin_unreachable() #elif defined(_MSC_VER) -# define WASM_UNREACHABLE() __assume(false) +#define WASM_UNREACHABLE() __assume(false) #elif __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__) -# include "sanitizer/common_interface_defs.h" -# define WASM_UNREACHABLE() do { __sanitizer_print_stack_trace(); __builtin_trap(); } while (0) +#include "sanitizer/common_interface_defs.h" +#define WASM_UNREACHABLE() \ + do { \ + __sanitizer_print_stack_trace(); \ + __builtin_trap(); \ + } while (0) #else -# include <assert.h> -# include <stdlib.h> -# define WASM_UNREACHABLE() do { assert(false); abort(); } while (0) +#include <assert.h> +#include <stdlib.h> +#define WASM_UNREACHABLE() \ + do { \ + assert(false); \ + abort(); \ + } while (0) #endif #ifdef __GNUC__ @@ -54,7 +62,11 @@ // The code might contain TODOs or stubs that read some values but do nothing // with them. The compiler might fail with [-Werror,-Wunused-variable]. // The WASM_UNUSED(varible) is a wrapper that helps to suppress the error. -#define WASM_UNUSED(expr) \ - do { if (sizeof expr) { (void)0; } } while (0) +#define WASM_UNUSED(expr) \ + do { \ + if (sizeof expr) { \ + (void)0; \ + } \ + } while (0) #endif // wasm_compiler_support_h |