diff options
author | JF Bastien <jfb@chromium.org> | 2015-12-22 14:53:34 -0800 |
---|---|---|
committer | JF Bastien <jfb@chromium.org> | 2015-12-22 14:53:34 -0800 |
commit | b6786d8187e79d60fcb24e3e6589444cf463128a (patch) | |
tree | c17e7e8e244089d67a8b9ef57a1a9d9634798528 /src | |
parent | 7c39b5ee5dcaf2182d20ca1cb540bbff9adc4c0b (diff) | |
download | binaryen-b6786d8187e79d60fcb24e3e6589444cf463128a.tar.gz binaryen-b6786d8187e79d60fcb24e3e6589444cf463128a.tar.bz2 binaryen-b6786d8187e79d60fcb24e3e6589444cf463128a.zip |
Fix / uniformize include guards
Diffstat (limited to 'src')
-rw-r--r-- | src/asm2wasm.h | 5 | ||||
-rw-r--r-- | src/asm_v_wasm.h | 6 | ||||
-rw-r--r-- | src/command-line.h | 5 | ||||
-rw-r--r-- | src/compiler-support.h | 6 | ||||
-rw-r--r-- | src/emscripten-optimizer/colors.h | 5 | ||||
-rw-r--r-- | src/emscripten-optimizer/istring.h | 6 | ||||
-rw-r--r-- | src/emscripten-optimizer/optimizer.h | 6 | ||||
-rw-r--r-- | src/emscripten-optimizer/parser.h | 6 | ||||
-rw-r--r-- | src/emscripten-optimizer/simple_ast.h | 6 | ||||
-rw-r--r-- | src/emscripten-optimizer/snprintf.h | 5 | ||||
-rw-r--r-- | src/mixed_arena.h | 17 | ||||
-rw-r--r-- | src/parsing.h | 5 | ||||
-rw-r--r-- | src/pass.h | 5 | ||||
-rw-r--r-- | src/pretty_printing.h | 6 | ||||
-rw-r--r-- | src/s2wasm.h | 5 | ||||
-rw-r--r-- | src/shared-constants.h | 6 | ||||
-rw-r--r-- | src/wasm-interpreter.h | 5 | ||||
-rw-r--r-- | src/wasm-s-parser.h | 5 | ||||
-rw-r--r-- | src/wasm-validator.h | 5 | ||||
-rw-r--r-- | src/wasm.h | 12 | ||||
-rw-r--r-- | src/wasm2asm.h | 5 |
21 files changed, 91 insertions, 41 deletions
diff --git a/src/asm2wasm.h b/src/asm2wasm.h index ec47abb7f..95638c9dc 100644 --- a/src/asm2wasm.h +++ b/src/asm2wasm.h @@ -19,6 +19,9 @@ // infrastructure. // +#ifndef wasm_asm2wasm_h +#define wasm_asm2wasm_h + #include "wasm.h" #include "emscripten-optimizer/optimizer.h" #include "mixed_arena.h" @@ -1523,3 +1526,5 @@ void Asm2WasmBuilder::optimize() { } } // namespace wasm + +#endif // wasm_asm2wasm_h diff --git a/src/asm_v_wasm.h b/src/asm_v_wasm.h index c0a913dfe..a19334c2c 100644 --- a/src/asm_v_wasm.h +++ b/src/asm_v_wasm.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef _asm_v_wasm_h_ -#define _asm_v_wasm_h_ +#ifndef wasm_asm_v_wasm_h +#define wasm_asm_v_wasm_h #include "emscripten-optimizer/optimizer.h" @@ -82,4 +82,4 @@ std::string getSig(CallBase *call) { } // namespace wasm -#endif // _asm_v_wasm_h_ +#endif // wasm_asm_v_wasm_h diff --git a/src/command-line.h b/src/command-line.h index 28a1aa5b8..63cf09d9f 100644 --- a/src/command-line.h +++ b/src/command-line.h @@ -18,6 +18,9 @@ // Command line helpers. // +#ifndef wasm_command_line_h +#define wasm_command_line_h + #include "wasm.h" namespace wasm { @@ -71,3 +74,5 @@ void processCommandLine(int argc, const char *argv[], Options *options) { } } // namespace wasm + +#endif // wasm_command_line_h diff --git a/src/compiler-support.h b/src/compiler-support.h index f0ec62535..54dd61bc8 100644 --- a/src/compiler-support.h +++ b/src/compiler-support.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __compiler_support_h__ -#define __compiler_support_h__ +#ifndef wasm_compiler_support_h +#define wasm_compiler_support_h #ifndef __has_feature # define __has_feature(x) 0 @@ -35,4 +35,4 @@ # define WASM_UNREACHABLE() abort() #endif -#endif // __compiler_support_h__ +#endif // wasm_compiler_support_h diff --git a/src/emscripten-optimizer/colors.h b/src/emscripten-optimizer/colors.h index 6e2c6f7d8..c3f48113f 100644 --- a/src/emscripten-optimizer/colors.h +++ b/src/emscripten-optimizer/colors.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef wasm_color_h +#define wasm_color_h + #include <unistd.h> #include <cstdlib> #include <ostream> @@ -73,3 +76,5 @@ namespace Colors { #endif } }; + +#endif // wasm_color_h diff --git a/src/emscripten-optimizer/istring.h b/src/emscripten-optimizer/istring.h index ffcec2fce..d114540e2 100644 --- a/src/emscripten-optimizer/istring.h +++ b/src/emscripten-optimizer/istring.h @@ -16,8 +16,8 @@ // Interned String type, 100% interned on creation. Comparisons are always just a pointer comparison -#ifndef __istring_h__ -#define __istring_h__ +#ifndef wasm_istring_h +#define wasm_istring_h #include <unordered_set> #include <unordered_map> @@ -173,4 +173,4 @@ public: } // namespace cashew -#endif // __istring_h__ +#endif // wasm_istring_h diff --git a/src/emscripten-optimizer/optimizer.h b/src/emscripten-optimizer/optimizer.h index 5e4692f12..451a9e286 100644 --- a/src/emscripten-optimizer/optimizer.h +++ b/src/emscripten-optimizer/optimizer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __optimizer_h__ -#define __optimizer_h__ +#ifndef wasm_optimizer_h +#define wasm_optimizer_h #include "simple_ast.h" @@ -157,4 +157,4 @@ cashew::Ref makeAsmCoercion(cashew::Ref node, AsmType type); cashew::Ref makeSigning(cashew::Ref node, AsmSign sign); -#endif // __optimizer_h__ +#endif // wasm_optimizer_h diff --git a/src/emscripten-optimizer/parser.h b/src/emscripten-optimizer/parser.h index 2b2effcab..6b2fa2faa 100644 --- a/src/emscripten-optimizer/parser.h +++ b/src/emscripten-optimizer/parser.h @@ -19,8 +19,8 @@ // XXX All parsing methods assume they take ownership of the input string. This lets them reuse // parts of it. You will segfault if the input string cannot be reused and written to. -#ifndef __parser_h__ -#define __parser_h__ +#ifndef wasm_parser_h +#define wasm_parser_h #include <vector> #include <iostream> @@ -927,4 +927,4 @@ public: } // namespace cashew -#endif // __parser_h__ +#endif // wasm_parser_h diff --git a/src/emscripten-optimizer/simple_ast.h b/src/emscripten-optimizer/simple_ast.h index a6073d9af..862e1f0bc 100644 --- a/src/emscripten-optimizer/simple_ast.h +++ b/src/emscripten-optimizer/simple_ast.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef __simple_ast_h__ -#define __simple_ast_h__ +#ifndef wasm_simple_ast_h +#define wasm_simple_ast_h #include <assert.h> #include <stdlib.h> @@ -1678,4 +1678,4 @@ public: } // namespace cashew -#endif // __simple_ast_h__ +#endif // wasm_simple_ast_h diff --git a/src/emscripten-optimizer/snprintf.h b/src/emscripten-optimizer/snprintf.h index 8f4a690ca..86335661d 100644 --- a/src/emscripten-optimizer/snprintf.h +++ b/src/emscripten-optimizer/snprintf.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef wasm_snprintf_h +#define wasm_snprintf_h + #include <stdarg.h> // Visual Studio does not support C99, so emulate snprintf support for it manually. @@ -46,3 +49,5 @@ inline int c99_snprintf(char* str, size_t size, const char* format, ...) return count; } #endif + +#endif // wasm_snprintf_h diff --git a/src/mixed_arena.h b/src/mixed_arena.h index 83a8c6f52..82464d51e 100644 --- a/src/mixed_arena.h +++ b/src/mixed_arena.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef mixed_arena_h -#define mixed_arena_h +#ifndef wasm_mixed_arena_h +#define wasm_mixed_arena_h #include <vector> @@ -56,15 +56,4 @@ struct MixedArena { extern MixedArena globalAllocator; -#ifdef __wasm_h__ -namespace wasm { - -class AllocatingModule : public Module { -public: - MixedArena allocator; -}; - -} -#endif - -#endif // mixed_arena_h +#endif // wasm_mixed_arena_h diff --git a/src/parsing.h b/src/parsing.h index 6d1b60c01..31099571b 100644 --- a/src/parsing.h +++ b/src/parsing.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef wasm_parsing_h +#define wasm_parsing_h + #include <sstream> #include "wasm.h" @@ -165,3 +168,5 @@ Expression* parseConst(cashew::IString s, WasmType type, MixedArena& allocator) } // namespace wasm + +#endif // wasm_parsing_h diff --git a/src/pass.h b/src/pass.h index c03db2368..d3f1d9edb 100644 --- a/src/pass.h +++ b/src/pass.h @@ -14,6 +14,9 @@ * limitations under the License. */ +#ifndef wasm_pass_h +#define wasm_pass_h + #include <functional> #include "wasm.h" @@ -124,3 +127,5 @@ private: }; } // namespace wasm + +#endif // wasm_pass_h diff --git a/src/pretty_printing.h b/src/pretty_printing.h index 86865231a..29b2bdea7 100644 --- a/src/pretty_printing.h +++ b/src/pretty_printing.h @@ -18,8 +18,8 @@ // Pretty printing helpers // -#ifndef _pretty_printing_h -#define _pretty_printing_h +#ifndef wasm_pretty_printing_h +#define wasm_pretty_printing_h #include <ostream> @@ -90,4 +90,4 @@ inline std::ostream& printMinorOpening(std::ostream &o, const char *str) { return o; } -#endif // _pretty_printing_h +#endif // wasm_pretty_printing_h diff --git a/src/s2wasm.h b/src/s2wasm.h index 81531ab3c..7c42a81b0 100644 --- a/src/s2wasm.h +++ b/src/s2wasm.h @@ -18,6 +18,9 @@ // .s to WebAssembly translator. // +#ifndef wasm_s2wasm_h +#define wasm_s2wasm_h + #include "wasm.h" #include "parsing.h" #include "asm_v_wasm.h" @@ -1048,3 +1051,5 @@ public: }; } // namespace wasm + +#endif // wasm_s2wasm_h diff --git a/src/shared-constants.h b/src/shared-constants.h index b4ea7869f..ea8980fa2 100644 --- a/src/shared-constants.h +++ b/src/shared-constants.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef _shared_constants_h_ -#define _shared_constants_h_ +#ifndef wasm_shared_constants_h +#define wasm_shared_constants_h #include "emscripten-optimizer/optimizer.h" @@ -87,4 +87,4 @@ cashew::IString GLOBAL("global"), } -#endif // _shared_constants_h_ +#endif // wasm_shared_constants_h diff --git a/src/wasm-interpreter.h b/src/wasm-interpreter.h index 185e920ca..97958b041 100644 --- a/src/wasm-interpreter.h +++ b/src/wasm-interpreter.h @@ -20,6 +20,9 @@ // people to read this code and understand WebAssembly semantics. // +#ifndef wasm_wasm_interpreter_h +#define wasm_wasm_interpreter_h + #include <limits.h> #include "wasm.h" @@ -782,3 +785,5 @@ private: }; } // namespace wasm + +#endif // wasm_wasm_interpreter_h diff --git a/src/wasm-s-parser.h b/src/wasm-s-parser.h index 5440faecc..a286e5af8 100644 --- a/src/wasm-s-parser.h +++ b/src/wasm-s-parser.h @@ -19,6 +19,9 @@ // such as are in the spec test suite. // +#ifndef wasm_wasm_s_parser_h +#define wasm_wasm_s_parser_h + #include <cmath> #include "wasm.h" @@ -1036,3 +1039,5 @@ private: }; } // namespace wasm + +#endif // wasm_wasm_s_parser_h diff --git a/src/wasm-validator.h b/src/wasm-validator.h index c756c4b0d..af0c4ba9d 100644 --- a/src/wasm-validator.h +++ b/src/wasm-validator.h @@ -18,6 +18,9 @@ // Simple WebAssembly module validator. // +#ifndef wasm_wasm_validator_h +#define wasm_wasm_validator_h + #include "wasm.h" namespace wasm { @@ -130,3 +133,5 @@ private: }; } // namespace wasm + +#endif // wasm_wasm_validator_h diff --git a/src/wasm.h b/src/wasm.h index 7baec88aa..df7731094 100644 --- a/src/wasm.h +++ b/src/wasm.h @@ -41,8 +41,8 @@ // a branch). // -#ifndef __wasm_h__ -#define __wasm_h__ +#ifndef wasm_wasm_h +#define wasm_wasm_h #include <cassert> #include <cstddef> @@ -54,6 +54,7 @@ #include "compiler-support.h" #include "emscripten-optimizer/simple_ast.h" +#include "mixed_arena.h" #include "pretty_printing.h" namespace wasm { @@ -1102,6 +1103,11 @@ private: size_t functionTypeIndex, importIndex, exportIndex, functionIndex; }; +class AllocatingModule : public Module { + public: + MixedArena allocator; +}; + // // Simple WebAssembly AST visiting. Useful for anything that wants to do // something different for each AST node type, like printing, interpreting, @@ -1378,4 +1384,4 @@ struct WasmWalker : public WasmVisitor<void> { } // namespace wasm -#endif // __wasm_h__ +#endif // wasm_wasm_h diff --git a/src/wasm2asm.h b/src/wasm2asm.h index b8b897ef9..53cb6df78 100644 --- a/src/wasm2asm.h +++ b/src/wasm2asm.h @@ -19,6 +19,9 @@ // infrastructure. // +#ifndef wasm_wasm2asm_h +#define wasm_wasm2asm_h + #include "wasm.h" #include "emscripten-optimizer/optimizer.h" #include "mixed_arena.h" @@ -1094,3 +1097,5 @@ Ref Wasm2AsmBuilder::processFunctionBody(Expression* curr, IString result) { } } // namespace wasm + +#endif // wasm_wasm2asm_h |