1 /*
2  * Copyright 2016 WebAssembly Community Group participants
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *     http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef WABT_BINARY_READER_NOP_H_
18 #define WABT_BINARY_READER_NOP_H_
19 
20 #include "src/binary-reader.h"
21 
22 namespace wabt {
23 
24 class BinaryReaderNop : public BinaryReaderDelegate {
25  public:
OnError(const Error &)26   bool OnError(const Error&) override { return false; }
27 
28   /* Module */
BeginModule(uint32_t version)29   Result BeginModule(uint32_t version) override { return Result::Ok; }
EndModule()30   Result EndModule() override { return Result::Ok; }
31 
BeginSection(Index section_index,BinarySection section_type,Offset size)32   Result BeginSection(Index section_index,
33                       BinarySection section_type,
34                       Offset size) override {
35     return Result::Ok;
36   }
37 
38   /* Custom section */
BeginCustomSection(Offset size,string_view section_name)39   Result BeginCustomSection(Offset size, string_view section_name) override {
40     return Result::Ok;
41   }
EndCustomSection()42   Result EndCustomSection() override { return Result::Ok; }
43 
44   /* Type section */
BeginTypeSection(Offset size)45   Result BeginTypeSection(Offset size) override { return Result::Ok; }
OnTypeCount(Index count)46   Result OnTypeCount(Index count) override { return Result::Ok; }
OnType(Index index,Index param_count,Type * param_types,Index result_count,Type * result_types)47   Result OnType(Index index,
48                 Index param_count,
49                 Type* param_types,
50                 Index result_count,
51                 Type* result_types) override {
52     return Result::Ok;
53   }
EndTypeSection()54   Result EndTypeSection() override { return Result::Ok; }
55 
56   /* Import section */
BeginImportSection(Offset size)57   Result BeginImportSection(Offset size) override { return Result::Ok; }
OnImportCount(Index count)58   Result OnImportCount(Index count) override { return Result::Ok; }
OnImport(Index index,string_view module_name,string_view field_name)59   Result OnImport(Index index,
60                   string_view module_name,
61                   string_view field_name) override {
62     return Result::Ok;
63   }
OnImportFunc(Index import_index,string_view module_name,string_view field_name,Index func_index,Index sig_index)64   Result OnImportFunc(Index import_index,
65                       string_view module_name,
66                       string_view field_name,
67                       Index func_index,
68                       Index sig_index) override {
69     return Result::Ok;
70   }
OnImportTable(Index import_index,string_view module_name,string_view field_name,Index table_index,Type elem_type,const Limits * elem_limits)71   Result OnImportTable(Index import_index,
72                        string_view module_name,
73                        string_view field_name,
74                        Index table_index,
75                        Type elem_type,
76                        const Limits* elem_limits) override {
77     return Result::Ok;
78   }
OnImportMemory(Index import_index,string_view module_name,string_view field_name,Index memory_index,const Limits * page_limits)79   Result OnImportMemory(Index import_index,
80                         string_view module_name,
81                         string_view field_name,
82                         Index memory_index,
83                         const Limits* page_limits) override {
84     return Result::Ok;
85   }
OnImportGlobal(Index import_index,string_view module_name,string_view field_name,Index global_index,Type type,bool mutable_)86   Result OnImportGlobal(Index import_index,
87                         string_view module_name,
88                         string_view field_name,
89                         Index global_index,
90                         Type type,
91                         bool mutable_) override {
92     return Result::Ok;
93   }
OnImportEvent(Index import_index,string_view module_name,string_view field_name,Index event_index,Index sig_index)94   Result OnImportEvent(Index import_index,
95                        string_view module_name,
96                        string_view field_name,
97                        Index event_index,
98                        Index sig_index) override {
99     return Result::Ok;
100   }
EndImportSection()101   Result EndImportSection() override { return Result::Ok; }
102 
103   /* Function section */
BeginFunctionSection(Offset size)104   Result BeginFunctionSection(Offset size) override { return Result::Ok; }
OnFunctionCount(Index count)105   Result OnFunctionCount(Index count) override { return Result::Ok; }
OnFunction(Index index,Index sig_index)106   Result OnFunction(Index index, Index sig_index) override {
107     return Result::Ok;
108   }
EndFunctionSection()109   Result EndFunctionSection() override { return Result::Ok; }
110 
111   /* Table section */
BeginTableSection(Offset size)112   Result BeginTableSection(Offset size) override { return Result::Ok; }
OnTableCount(Index count)113   Result OnTableCount(Index count) override { return Result::Ok; }
OnTable(Index index,Type elem_type,const Limits * elem_limits)114   Result OnTable(Index index,
115                  Type elem_type,
116                  const Limits* elem_limits) override {
117     return Result::Ok;
118   }
EndTableSection()119   Result EndTableSection() override { return Result::Ok; }
120 
121   /* Memory section */
BeginMemorySection(Offset size)122   Result BeginMemorySection(Offset size) override { return Result::Ok; }
OnMemoryCount(Index count)123   Result OnMemoryCount(Index count) override { return Result::Ok; }
OnMemory(Index index,const Limits * limits)124   Result OnMemory(Index index, const Limits* limits) override {
125     return Result::Ok;
126   }
EndMemorySection()127   Result EndMemorySection() override { return Result::Ok; }
128 
129   /* Global section */
BeginGlobalSection(Offset size)130   Result BeginGlobalSection(Offset size) override { return Result::Ok; }
OnGlobalCount(Index count)131   Result OnGlobalCount(Index count) override { return Result::Ok; }
BeginGlobal(Index index,Type type,bool mutable_)132   Result BeginGlobal(Index index, Type type, bool mutable_) override {
133     return Result::Ok;
134   }
BeginGlobalInitExpr(Index index)135   Result BeginGlobalInitExpr(Index index) override { return Result::Ok; }
EndGlobalInitExpr(Index index)136   Result EndGlobalInitExpr(Index index) override { return Result::Ok; }
EndGlobal(Index index)137   Result EndGlobal(Index index) override { return Result::Ok; }
EndGlobalSection()138   Result EndGlobalSection() override { return Result::Ok; }
139 
140   /* Exports section */
BeginExportSection(Offset size)141   Result BeginExportSection(Offset size) override { return Result::Ok; }
OnExportCount(Index count)142   Result OnExportCount(Index count) override { return Result::Ok; }
OnExport(Index index,ExternalKind kind,Index item_index,string_view name)143   Result OnExport(Index index,
144                   ExternalKind kind,
145                   Index item_index,
146                   string_view name) override {
147     return Result::Ok;
148   }
EndExportSection()149   Result EndExportSection() override { return Result::Ok; }
150 
151   /* Start section */
BeginStartSection(Offset size)152   Result BeginStartSection(Offset size) override { return Result::Ok; }
OnStartFunction(Index func_index)153   Result OnStartFunction(Index func_index) override { return Result::Ok; }
EndStartSection()154   Result EndStartSection() override { return Result::Ok; }
155 
156   /* Code section */
BeginCodeSection(Offset size)157   Result BeginCodeSection(Offset size) override { return Result::Ok; }
OnFunctionBodyCount(Index count)158   Result OnFunctionBodyCount(Index count) override { return Result::Ok; }
BeginFunctionBody(Index index,Offset size)159   Result BeginFunctionBody(Index index, Offset size) override {
160     return Result::Ok;
161   }
OnLocalDeclCount(Index count)162   Result OnLocalDeclCount(Index count) override { return Result::Ok; }
OnLocalDecl(Index decl_index,Index count,Type type)163   Result OnLocalDecl(Index decl_index, Index count, Type type) override {
164     return Result::Ok;
165   }
166 
167   /* Function expressions; called between BeginFunctionBody and
168    EndFunctionBody */
OnOpcode(Opcode Opcode)169   Result OnOpcode(Opcode Opcode) override { return Result::Ok; }
OnOpcodeBare()170   Result OnOpcodeBare() override { return Result::Ok; }
OnOpcodeIndex(Index value)171   Result OnOpcodeIndex(Index value) override { return Result::Ok; }
OnOpcodeIndexIndex(Index value,Index value2)172   Result OnOpcodeIndexIndex(Index value, Index value2) override {
173     return Result::Ok;
174   }
OnOpcodeUint32(uint32_t value)175   Result OnOpcodeUint32(uint32_t value) override { return Result::Ok; }
OnOpcodeUint32Uint32(uint32_t value,uint32_t value2)176   Result OnOpcodeUint32Uint32(uint32_t value, uint32_t value2) override {
177     return Result::Ok;
178   }
OnOpcodeUint64(uint64_t value)179   Result OnOpcodeUint64(uint64_t value) override { return Result::Ok; }
OnOpcodeF32(uint32_t value)180   Result OnOpcodeF32(uint32_t value) override { return Result::Ok; }
OnOpcodeF64(uint64_t value)181   Result OnOpcodeF64(uint64_t value) override { return Result::Ok; }
OnOpcodeV128(v128 value)182   Result OnOpcodeV128(v128 value) override { return Result::Ok; }
OnOpcodeBlockSig(Type sig_type)183   Result OnOpcodeBlockSig(Type sig_type) override { return Result::Ok; }
OnAtomicLoadExpr(Opcode opcode,uint32_t alignment_log2,Address offset)184   Result OnAtomicLoadExpr(Opcode opcode,
185                           uint32_t alignment_log2,
186                           Address offset) override {
187     return Result::Ok;
188   }
OnAtomicStoreExpr(Opcode opcode,uint32_t alignment_log2,Address offset)189   Result OnAtomicStoreExpr(Opcode opcode,
190                            uint32_t alignment_log2,
191                            Address offset) override {
192     return Result::Ok;
193   }
OnAtomicRmwExpr(Opcode opcode,uint32_t alignment_log2,Address offset)194   Result OnAtomicRmwExpr(Opcode opcode,
195                          uint32_t alignment_log2,
196                          Address offset) override {
197     return Result::Ok;
198   }
OnAtomicRmwCmpxchgExpr(Opcode opcode,uint32_t alignment_log2,Address offset)199   Result OnAtomicRmwCmpxchgExpr(Opcode opcode,
200                                 uint32_t alignment_log2,
201                                 Address offset) override {
202     return Result::Ok;
203   }
OnAtomicWaitExpr(Opcode,uint32_t,Address)204   Result OnAtomicWaitExpr(Opcode, uint32_t, Address) override {
205     return Result::Ok;
206   }
OnAtomicNotifyExpr(Opcode,uint32_t,Address)207   Result OnAtomicNotifyExpr(Opcode, uint32_t, Address) override {
208     return Result::Ok;
209   }
OnBinaryExpr(Opcode opcode)210   Result OnBinaryExpr(Opcode opcode) override { return Result::Ok; }
OnBlockExpr(Type sig_type)211   Result OnBlockExpr(Type sig_type) override { return Result::Ok; }
OnBrExpr(Index depth)212   Result OnBrExpr(Index depth) override { return Result::Ok; }
OnBrIfExpr(Index depth)213   Result OnBrIfExpr(Index depth) override { return Result::Ok; }
OnBrOnExnExpr(Index depth,Index event_index)214   Result OnBrOnExnExpr(Index depth, Index event_index) override {
215     return Result::Ok;
216   }
OnBrTableExpr(Index num_targets,Index * target_depths,Index default_target_depth)217   Result OnBrTableExpr(Index num_targets,
218                        Index* target_depths,
219                        Index default_target_depth) override {
220     return Result::Ok;
221   }
OnCallExpr(Index func_index)222   Result OnCallExpr(Index func_index) override { return Result::Ok; }
OnCallIndirectExpr(Index sig_index,Index table_index)223   Result OnCallIndirectExpr(Index sig_index, Index table_index) override { return Result::Ok; }
OnCatchExpr()224   Result OnCatchExpr() override { return Result::Ok; }
OnCompareExpr(Opcode opcode)225   Result OnCompareExpr(Opcode opcode) override { return Result::Ok; }
OnConvertExpr(Opcode opcode)226   Result OnConvertExpr(Opcode opcode) override { return Result::Ok; }
OnDropExpr()227   Result OnDropExpr() override { return Result::Ok; }
OnElseExpr()228   Result OnElseExpr() override { return Result::Ok; }
OnEndExpr()229   Result OnEndExpr() override { return Result::Ok; }
OnEndFunc()230   Result OnEndFunc() override { return Result::Ok; }
OnF32ConstExpr(uint32_t value_bits)231   Result OnF32ConstExpr(uint32_t value_bits) override { return Result::Ok; }
OnF64ConstExpr(uint64_t value_bits)232   Result OnF64ConstExpr(uint64_t value_bits) override { return Result::Ok; }
OnV128ConstExpr(v128 value_bits)233   Result OnV128ConstExpr(v128 value_bits) override { return Result::Ok; }
OnGlobalGetExpr(Index global_index)234   Result OnGlobalGetExpr(Index global_index) override { return Result::Ok; }
OnGlobalSetExpr(Index global_index)235   Result OnGlobalSetExpr(Index global_index) override { return Result::Ok; }
OnI32ConstExpr(uint32_t value)236   Result OnI32ConstExpr(uint32_t value) override { return Result::Ok; }
OnI64ConstExpr(uint64_t value)237   Result OnI64ConstExpr(uint64_t value) override { return Result::Ok; }
OnIfExpr(Type sig_type)238   Result OnIfExpr(Type sig_type) override { return Result::Ok; }
OnLoadExpr(Opcode opcode,uint32_t alignment_log2,Address offset)239   Result OnLoadExpr(Opcode opcode,
240                     uint32_t alignment_log2,
241                     Address offset) override {
242     return Result::Ok;
243   }
OnLocalGetExpr(Index local_index)244   Result OnLocalGetExpr(Index local_index) override { return Result::Ok; }
OnLocalSetExpr(Index local_index)245   Result OnLocalSetExpr(Index local_index) override { return Result::Ok; }
OnLocalTeeExpr(Index local_index)246   Result OnLocalTeeExpr(Index local_index) override { return Result::Ok; }
OnLoopExpr(Type sig_type)247   Result OnLoopExpr(Type sig_type) override { return Result::Ok; }
OnMemoryCopyExpr()248   Result OnMemoryCopyExpr() override { return Result::Ok; }
OnDataDropExpr(Index segment_index)249   Result OnDataDropExpr(Index segment_index) override { return Result::Ok; }
OnMemoryFillExpr()250   Result OnMemoryFillExpr() override { return Result::Ok; }
OnMemoryGrowExpr()251   Result OnMemoryGrowExpr() override { return Result::Ok; }
OnMemoryInitExpr(Index segment_index)252   Result OnMemoryInitExpr(Index segment_index) override { return Result::Ok; }
OnMemorySizeExpr()253   Result OnMemorySizeExpr() override { return Result::Ok; }
OnTableCopyExpr()254   Result OnTableCopyExpr() override { return Result::Ok; }
OnElemDropExpr(Index segment_index)255   Result OnElemDropExpr(Index segment_index) override { return Result::Ok; }
OnTableInitExpr(Index segment_index)256   Result OnTableInitExpr(Index segment_index) override { return Result::Ok; }
OnTableGetExpr(Index table_index)257   Result OnTableGetExpr(Index table_index) override { return Result::Ok; }
OnTableSetExpr(Index table_index)258   Result OnTableSetExpr(Index table_index) override { return Result::Ok; }
OnTableGrowExpr(Index table_index)259   Result OnTableGrowExpr(Index table_index) override { return Result::Ok; }
OnTableSizeExpr(Index table_index)260   Result OnTableSizeExpr(Index table_index) override { return Result::Ok; }
OnRefNullExpr()261   Result OnRefNullExpr() override { return Result::Ok; }
OnRefIsNullExpr()262   Result OnRefIsNullExpr() override { return Result::Ok; }
OnNopExpr()263   Result OnNopExpr() override { return Result::Ok; }
OnRethrowExpr()264   Result OnRethrowExpr() override { return Result::Ok; }
OnReturnCallExpr(Index sig_index)265   Result OnReturnCallExpr(Index sig_index) override { return Result::Ok; }
OnReturnCallIndirectExpr(Index sig_index,Index table_index)266   Result OnReturnCallIndirectExpr(Index sig_index, Index table_index) override { return Result::Ok; }
OnReturnExpr()267   Result OnReturnExpr() override { return Result::Ok; }
OnSelectExpr()268   Result OnSelectExpr() override { return Result::Ok; }
OnStoreExpr(Opcode opcode,uint32_t alignment_log2,Address offset)269   Result OnStoreExpr(Opcode opcode,
270                      uint32_t alignment_log2,
271                      Address offset) override {
272     return Result::Ok;
273   }
OnThrowExpr(Index depth)274   Result OnThrowExpr(Index depth) override { return Result::Ok; }
OnTryExpr(Type sig_type)275   Result OnTryExpr(Type sig_type) override { return Result::Ok; }
OnUnaryExpr(Opcode opcode)276   Result OnUnaryExpr(Opcode opcode) override { return Result::Ok; }
OnTernaryExpr(Opcode opcode)277   Result OnTernaryExpr(Opcode opcode) override { return Result::Ok; }
OnUnreachableExpr()278   Result OnUnreachableExpr() override { return Result::Ok; }
EndFunctionBody(Index index)279   Result EndFunctionBody(Index index) override { return Result::Ok; }
EndCodeSection()280   Result EndCodeSection() override { return Result::Ok; }
OnSimdLaneOpExpr(Opcode opcode,uint64_t value)281   Result OnSimdLaneOpExpr(Opcode opcode, uint64_t value) override {
282     return Result::Ok;
283   }
OnSimdShuffleOpExpr(Opcode opcode,v128 value)284   Result OnSimdShuffleOpExpr(Opcode opcode, v128 value) override {
285     return Result::Ok;
286   }
OnLoadSplatExpr(Opcode opcode,uint32_t alignment_log2,Address offset)287   Result OnLoadSplatExpr(Opcode opcode,
288                          uint32_t alignment_log2,
289                          Address offset) override {
290     return Result::Ok;
291   }
292 
293   /* Elem section */
BeginElemSection(Offset size)294   Result BeginElemSection(Offset size) override { return Result::Ok; }
OnElemSegmentCount(Index count)295   Result OnElemSegmentCount(Index count) override { return Result::Ok; }
BeginElemSegment(Index index,Index table_index,bool passive,Type elem_type)296   Result BeginElemSegment(Index index,
297                           Index table_index,
298                           bool passive,
299                           Type elem_type) override {
300     return Result::Ok;
301   }
BeginElemSegmentInitExpr(Index index)302   Result BeginElemSegmentInitExpr(Index index) override { return Result::Ok; }
EndElemSegmentInitExpr(Index index)303   Result EndElemSegmentInitExpr(Index index) override { return Result::Ok; }
OnElemSegmentElemExprCount(Index index,Index count)304   Result OnElemSegmentElemExprCount(Index index, Index count) override {
305     return Result::Ok;
306   }
OnElemSegmentElemExpr_RefNull(Index segment_index)307   Result OnElemSegmentElemExpr_RefNull(Index segment_index) override {
308     return Result::Ok;
309   }
OnElemSegmentElemExpr_RefFunc(Index segment_index,Index func_index)310   Result OnElemSegmentElemExpr_RefFunc(Index segment_index,
311                                        Index func_index) override {
312     return Result::Ok;
313   }
EndElemSegment(Index index)314   Result EndElemSegment(Index index) override { return Result::Ok; }
EndElemSection()315   Result EndElemSection() override { return Result::Ok; }
316 
317   /* Data section */
BeginDataSection(Offset size)318   Result BeginDataSection(Offset size) override { return Result::Ok; }
OnDataSegmentCount(Index count)319   Result OnDataSegmentCount(Index count) override { return Result::Ok; }
BeginDataSegment(Index index,Index memory_index,bool passive)320   Result BeginDataSegment(Index index, Index memory_index, bool passive) override {
321     return Result::Ok;
322   }
BeginDataSegmentInitExpr(Index index)323   Result BeginDataSegmentInitExpr(Index index) override { return Result::Ok; }
EndDataSegmentInitExpr(Index index)324   Result EndDataSegmentInitExpr(Index index) override { return Result::Ok; }
OnDataSegmentData(Index index,const void * data,Address size)325   Result OnDataSegmentData(Index index,
326                            const void* data,
327                            Address size) override {
328     return Result::Ok;
329   }
EndDataSegment(Index index)330   Result EndDataSegment(Index index) override { return Result::Ok; }
EndDataSection()331   Result EndDataSection() override { return Result::Ok; }
332 
333   /* DataCount section */
BeginDataCountSection(Offset size)334   Result BeginDataCountSection(Offset size) override { return Result::Ok; }
OnDataCount(Index count)335   Result OnDataCount(Index count) override { return Result::Ok; }
EndDataCountSection()336   Result EndDataCountSection() override { return Result::Ok; }
337 
338   /* Names section */
BeginNamesSection(Offset size)339   Result BeginNamesSection(Offset size) override { return Result::Ok; }
OnModuleNameSubsection(Index index,uint32_t name_type,Offset subsection_size)340   Result OnModuleNameSubsection(Index index,
341                                 uint32_t name_type,
342                                 Offset subsection_size) override {
343     return Result::Ok;
344   }
OnModuleName(string_view name)345   Result OnModuleName(string_view name) override { return Result::Ok; }
OnFunctionNameSubsection(Index index,uint32_t name_type,Offset subsection_size)346   Result OnFunctionNameSubsection(Index index,
347                                   uint32_t name_type,
348                                   Offset subsection_size) override {
349     return Result::Ok;
350   }
OnFunctionNamesCount(Index num_functions)351   Result OnFunctionNamesCount(Index num_functions) override {
352     return Result::Ok;
353   }
OnFunctionName(Index function_index,string_view function_name)354   Result OnFunctionName(Index function_index,
355                         string_view function_name) override {
356     return Result::Ok;
357   }
OnLocalNameSubsection(Index index,uint32_t name_type,Offset subsection_size)358   Result OnLocalNameSubsection(Index index,
359                                uint32_t name_type,
360                                Offset subsection_size) override {
361     return Result::Ok;
362   }
OnLocalNameFunctionCount(Index num_functions)363   Result OnLocalNameFunctionCount(Index num_functions) override {
364     return Result::Ok;
365   }
OnLocalNameLocalCount(Index function_index,Index num_locals)366   Result OnLocalNameLocalCount(Index function_index,
367                                Index num_locals) override {
368     return Result::Ok;
369   }
OnLocalName(Index function_index,Index local_index,string_view local_name)370   Result OnLocalName(Index function_index,
371                      Index local_index,
372                      string_view local_name) override {
373     return Result::Ok;
374   }
EndNamesSection()375   Result EndNamesSection() override { return Result::Ok; }
376 
377   /* Reloc section */
BeginRelocSection(Offset size)378   Result BeginRelocSection(Offset size) override { return Result::Ok; }
OnRelocCount(Index count,Index section_code)379   Result OnRelocCount(Index count, Index section_code) override {
380     return Result::Ok;
381   }
OnReloc(RelocType type,Offset offset,Index index,uint32_t addend)382   Result OnReloc(RelocType type,
383                  Offset offset,
384                  Index index,
385                  uint32_t addend) override {
386     return Result::Ok;
387   }
EndRelocSection()388   Result EndRelocSection() override { return Result::Ok; }
389 
390   /* Event section */
BeginEventSection(Offset size)391   Result BeginEventSection(Offset size) override { return Result::Ok; }
OnEventCount(Index count)392   Result OnEventCount(Index count) override { return Result::Ok; }
OnEventType(Index index,Index sig_index)393   Result OnEventType(Index index, Index sig_index) override {
394     return Result::Ok;
395   }
EndEventSection()396   Result EndEventSection() override { return Result::Ok; }
397 
398   /* Dylink section */
BeginDylinkSection(Offset size)399   Result BeginDylinkSection(Offset size) override { return Result::Ok; }
OnDylinkInfo(uint32_t mem_size,uint32_t mem_align,uint32_t table_size,uint32_t table_align)400   Result OnDylinkInfo(uint32_t mem_size,
401                       uint32_t mem_align,
402                       uint32_t table_size,
403                       uint32_t table_align) override {
404     return Result::Ok;
405   }
OnDylinkNeededCount(Index count)406   Result OnDylinkNeededCount(Index count) override { return Result::Ok; }
OnDylinkNeeded(string_view so_name)407   Result OnDylinkNeeded(string_view so_name) override { return Result::Ok; }
EndDylinkSection()408   Result EndDylinkSection() override { return Result::Ok; }
409 
410   /* Linking section */
BeginLinkingSection(Offset size)411   Result BeginLinkingSection(Offset size) override { return Result::Ok; }
OnSymbolCount(Index count)412   Result OnSymbolCount(Index count) override { return Result::Ok; }
OnSymbol(Index sybmol_index,SymbolType type,uint32_t flags)413   Result OnSymbol(Index sybmol_index,
414                   SymbolType type,
415                   uint32_t flags) override {
416     return Result::Ok;
417   }
OnDataSymbol(Index index,uint32_t flags,string_view name,Index segment,uint32_t offset,uint32_t size)418   Result OnDataSymbol(Index index,
419                       uint32_t flags,
420                       string_view name,
421                       Index segment,
422                       uint32_t offset,
423                       uint32_t size) override {
424     return Result::Ok;
425   }
OnFunctionSymbol(Index index,uint32_t flags,string_view name,Index func_index)426   Result OnFunctionSymbol(Index index,
427                           uint32_t flags,
428                           string_view name,
429                           Index func_index) override {
430     return Result::Ok;
431   }
OnGlobalSymbol(Index index,uint32_t flags,string_view name,Index global_index)432   Result OnGlobalSymbol(Index index,
433                         uint32_t flags,
434                         string_view name,
435                         Index global_index) override {
436     return Result::Ok;
437   }
OnSectionSymbol(Index index,uint32_t flags,Index section_index)438   Result OnSectionSymbol(Index index,
439                          uint32_t flags,
440                          Index section_index) override {
441     return Result::Ok;
442   }
OnEventSymbol(Index index,uint32_t flags,string_view name,Index event_index)443   Result OnEventSymbol(Index index,
444                        uint32_t flags,
445                        string_view name,
446                        Index event_index) override {
447     return Result::Ok;
448   }
OnSegmentInfoCount(Index count)449   Result OnSegmentInfoCount(Index count) override { return Result::Ok; }
OnSegmentInfo(Index index,string_view name,uint32_t alignment,uint32_t flags)450   Result OnSegmentInfo(Index index,
451                        string_view name,
452                        uint32_t alignment,
453                        uint32_t flags) override {
454     return Result::Ok;
455   }
OnInitFunctionCount(Index count)456   Result OnInitFunctionCount(Index count) override { return Result::Ok; }
OnInitFunction(uint32_t priority,Index function_index)457   Result OnInitFunction(uint32_t priority, Index function_index) override {
458     return Result::Ok;
459   }
OnComdatCount(Index count)460   Result OnComdatCount(Index count) override { return Result::Ok; }
OnComdatBegin(string_view name,uint32_t flags,Index count)461   Result OnComdatBegin(string_view name, uint32_t flags, Index count) override {
462     return Result::Ok;
463   }
OnComdatEntry(ComdatType kind,Index index)464   Result OnComdatEntry(ComdatType kind, Index index) override {
465     return Result::Ok;
466   }
EndLinkingSection()467   Result EndLinkingSection() override { return Result::Ok; }
468 
469   /* InitExpr - used by elem, data and global sections; these functions are
470    * only called between calls to Begin*InitExpr and End*InitExpr */
OnInitExprF32ConstExpr(Index index,uint32_t value)471   Result OnInitExprF32ConstExpr(Index index, uint32_t value) override {
472     return Result::Ok;
473   }
OnInitExprF64ConstExpr(Index index,uint64_t value)474   Result OnInitExprF64ConstExpr(Index index, uint64_t value) override {
475     return Result::Ok;
476   }
OnInitExprV128ConstExpr(Index index,v128 value)477   Result OnInitExprV128ConstExpr(Index index, v128 value) override {
478     return Result::Ok;
479   }
OnInitExprGlobalGetExpr(Index index,Index global_index)480   Result OnInitExprGlobalGetExpr(Index index, Index global_index) override {
481     return Result::Ok;
482   }
OnInitExprI32ConstExpr(Index index,uint32_t value)483   Result OnInitExprI32ConstExpr(Index index, uint32_t value) override {
484     return Result::Ok;
485   }
OnInitExprI64ConstExpr(Index index,uint64_t value)486   Result OnInitExprI64ConstExpr(Index index, uint64_t value) override {
487     return Result::Ok;
488   }
OnInitExprRefNull(Index index)489   Result OnInitExprRefNull(Index index) override {
490     return Result::Ok;
491   }
492 };
493 
494 }  // namespace wabt
495 
496 #endif /* WABT_BINARY_READER_H_ */
497