diff options
author | Sam Clegg <sbc@chromium.org> | 2017-12-13 22:02:25 +0000 |
---|---|---|
committer | Sam Clegg <sbc@chromium.org> | 2017-12-13 22:02:25 +0000 |
commit | 8764e8a22791f99e6756cd3fbe89c24e87bb0044 (patch) | |
tree | 29a3937147b2764d37c6f4ce55ce5baede6307e5 /include | |
parent | d76ae1215ccdb4f901847c9c22e2945ebfe27531 (diff) |
[WebAssembly] Use bitfield types in wasm YAML representation
Differential Revision: https://reviews.llvm.org/D41202
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@320642 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/ObjectYAML/WasmYAML.h | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/include/llvm/ObjectYAML/WasmYAML.h b/include/llvm/ObjectYAML/WasmYAML.h index d26faa14862..c37aa9c0771 100644 --- a/include/llvm/ObjectYAML/WasmYAML.h +++ b/include/llvm/ObjectYAML/WasmYAML.h @@ -34,13 +34,16 @@ LLVM_YAML_STRONG_TYPEDEF(int32_t, SignatureForm) LLVM_YAML_STRONG_TYPEDEF(uint32_t, ExportKind) LLVM_YAML_STRONG_TYPEDEF(uint32_t, Opcode) LLVM_YAML_STRONG_TYPEDEF(uint32_t, RelocType) +LLVM_YAML_STRONG_TYPEDEF(uint32_t, SymbolFlags); +LLVM_YAML_STRONG_TYPEDEF(uint32_t, SegmentFlags); +LLVM_YAML_STRONG_TYPEDEF(uint32_t, LimitFlags); struct FileHeader { yaml::Hex32 Version; }; struct Limits { - yaml::Hex32 Flags; + LimitFlags Flags; yaml::Hex32 Initial; yaml::Hex32 Maximum; }; @@ -113,7 +116,7 @@ struct SegmentInfo { uint32_t Index; StringRef Name; uint32_t Alignment; - uint32_t Flags; + SegmentFlags Flags; }; struct Signature { @@ -125,7 +128,7 @@ struct Signature { struct SymbolInfo { StringRef Name; - uint32_t Flags; + SymbolFlags Flags; }; struct Section { @@ -334,6 +337,18 @@ template <> struct MappingTraits<WasmYAML::Global> { static void mapping(IO &IO, WasmYAML::Global &Global); }; +template <> struct ScalarBitSetTraits<WasmYAML::LimitFlags> { + static void bitset(IO &IO, WasmYAML::LimitFlags &Value); +}; + +template <> struct ScalarBitSetTraits<WasmYAML::SymbolFlags> { + static void bitset(IO &IO, WasmYAML::SymbolFlags &Value); +}; + +template <> struct ScalarBitSetTraits<WasmYAML::SegmentFlags> { + static void bitset(IO &IO, WasmYAML::SegmentFlags &Value); +}; + template <> struct ScalarEnumerationTraits<WasmYAML::SectionType> { static void enumeration(IO &IO, WasmYAML::SectionType &Type); }; |