diff options
Diffstat (limited to 'include/llvm/ObjectYAML/WasmYAML.h')
-rw-r--r-- | include/llvm/ObjectYAML/WasmYAML.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/llvm/ObjectYAML/WasmYAML.h b/include/llvm/ObjectYAML/WasmYAML.h index dfeeb8589f82..bd7d72be4dbc 100644 --- a/include/llvm/ObjectYAML/WasmYAML.h +++ b/include/llvm/ObjectYAML/WasmYAML.h @@ -97,6 +97,11 @@ struct DataSegment { yaml::BinaryRef Content; }; +struct NameEntry { + uint32_t Index; + StringRef Name; +}; + struct Signature { Signature() : Form(wasm::WASM_TYPE_FUNC) {} @@ -122,6 +127,11 @@ struct CustomSection : Section { StringRef Name; yaml::BinaryRef Payload; + + // The follow is used by the "name" custom section. + // TODO(sbc): Add support for more then just functions names. The wasm + // name section can support multiple sub-sections. + std::vector<NameEntry> FunctionNames; }; struct TypeSection : Section { @@ -244,6 +254,7 @@ LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::WasmYAML::Global) 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_FLOW_SEQUENCE_VECTOR(uint32_t) namespace llvm { @@ -297,6 +308,10 @@ template <> struct MappingTraits<WasmYAML::Relocation> { static void mapping(IO &IO, WasmYAML::Relocation &Relocation); }; +template <> struct MappingTraits<WasmYAML::NameEntry> { + static void mapping(IO &IO, WasmYAML::NameEntry &NameEntry); +}; + template <> struct MappingTraits<WasmYAML::LocalDecl> { static void mapping(IO &IO, WasmYAML::LocalDecl &LocalDecl); }; |