diff options
Diffstat (limited to 'include/llvm/ObjectYAML/WasmYAML.h')
-rw-r--r-- | include/llvm/ObjectYAML/WasmYAML.h | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/include/llvm/ObjectYAML/WasmYAML.h b/include/llvm/ObjectYAML/WasmYAML.h index 709ad8ec3b776..188ce8e444919 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; }; @@ -109,6 +112,13 @@ struct NameEntry { StringRef Name; }; +struct SegmentInfo { + uint32_t Index; + StringRef Name; + uint32_t Alignment; + SegmentFlags Flags; +}; + struct Signature { uint32_t Index; SignatureForm Form = wasm::WASM_TYPE_FUNC; @@ -118,7 +128,12 @@ struct Signature { struct SymbolInfo { StringRef Name; - uint32_t Flags; + SymbolFlags Flags; +}; + +struct InitFunction { + uint32_t Priority; + uint32_t FunctionIndex; }; struct Section { @@ -160,9 +175,10 @@ struct LinkingSection : CustomSection { return C && C->Name == "linking"; } - std::vector<SymbolInfo> SymbolInfos; uint32_t DataSize; - uint32_t DataAlignment; + std::vector<SymbolInfo> SymbolInfos; + std::vector<SegmentInfo> SegmentInfos; + std::vector<InitFunction> InitFunctions; }; struct TypeSection : Section { @@ -297,7 +313,9 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::Function) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::LocalDecl) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::Relocation) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::NameEntry) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::SegmentInfo) LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::SymbolInfo) +LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::InitFunction) namespace llvm { namespace yaml { @@ -326,6 +344,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); }; @@ -354,6 +384,10 @@ template <> struct MappingTraits<WasmYAML::NameEntry> { static void mapping(IO &IO, WasmYAML::NameEntry &NameEntry); }; +template <> struct MappingTraits<WasmYAML::SegmentInfo> { + static void mapping(IO &IO, WasmYAML::SegmentInfo &SegmentInfo); +}; + template <> struct MappingTraits<WasmYAML::LocalDecl> { static void mapping(IO &IO, WasmYAML::LocalDecl &LocalDecl); }; @@ -374,6 +408,10 @@ template <> struct MappingTraits<WasmYAML::SymbolInfo> { static void mapping(IO &IO, WasmYAML::SymbolInfo &Info); }; +template <> struct MappingTraits<WasmYAML::InitFunction> { + static void mapping(IO &IO, WasmYAML::InitFunction &Init); +}; + template <> struct ScalarEnumerationTraits<WasmYAML::ValueType> { static void enumeration(IO &IO, WasmYAML::ValueType &Type); }; |