diff options
Diffstat (limited to 'src/tools/wasm2wat.cc')
-rw-r--r-- | src/tools/wasm2wat.cc | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/tools/wasm2wat.cc b/src/tools/wasm2wat.cc index fe1d17a9..53c7001c 100644 --- a/src/tools/wasm2wat.cc +++ b/src/tools/wasm2wat.cc @@ -22,7 +22,7 @@ #include "src/apply-names.h" #include "src/binary-reader.h" #include "src/binary-reader-ir.h" -#include "src/error-handler.h" +#include "src/error-formatter.h" #include "src/feature.h" #include "src/generate-names.h" #include "src/ir.h" @@ -107,18 +107,18 @@ int ProgramMain(int argc, char** argv) { std::vector<uint8_t> file_data; result = ReadFile(s_infile.c_str(), &file_data); if (Succeeded(result)) { - ErrorHandlerFile error_handler(Location::Type::Binary); + Errors errors; Module module; const bool kStopOnFirstError = true; ReadBinaryOptions options(s_features, s_log_stream.get(), s_read_debug_names, kStopOnFirstError, s_fail_on_custom_section_error); result = ReadBinaryIr(s_infile.c_str(), file_data.data(), file_data.size(), - options, &error_handler, &module); + options, &errors, &module); if (Succeeded(result)) { if (Succeeded(result) && s_validate) { ValidateOptions options(s_features); - result = ValidateModule(&module, &error_handler, options); + result = ValidateModule(&module, &errors, options); } if (s_generate_names) { @@ -138,6 +138,7 @@ int ProgramMain(int argc, char** argv) { result = WriteWat(&stream, &module, s_write_wat_options); } } + FormatErrorsToFile(errors, Location::Type::Binary); } return result != Result::Ok; } |