| 209 | } |
| 210 | |
| 211 | WabtWriteModuleResult* wabt_write_binary_module(wabt::Module* module, |
| 212 | int log, |
| 213 | int canonicalize_lebs, |
| 214 | int relocatable, |
| 215 | int write_debug_names) { |
| 216 | wabt::MemoryStream log_stream; |
| 217 | wabt::WriteBinaryOptions options; |
| 218 | options.canonicalize_lebs = canonicalize_lebs; |
| 219 | options.relocatable = relocatable; |
| 220 | options.write_debug_names = write_debug_names; |
| 221 | |
| 222 | wabt::MemoryStream stream(log ? &log_stream : nullptr); |
| 223 | WabtWriteModuleResult* result = new WabtWriteModuleResult(); |
| 224 | result->result = WriteBinaryModule(&stream, module, options); |
| 225 | if (result->result == wabt::Result::Ok) { |
| 226 | result->buffer = stream.ReleaseOutputBuffer(); |
| 227 | result->log_buffer = log ? log_stream.ReleaseOutputBuffer() : nullptr; |
| 228 | } |
| 229 | return result; |
| 230 | } |
| 231 | |
| 232 | WabtWriteModuleResult* wabt_write_text_module(wabt::Module* module, |
| 233 | int fold_exprs, |
nothing calls this directly
no test coverage detected