@@ -34,8 +34,11 @@ namespace wasm {
3434
3535#define DEBUG_TYPE " writer"
3636
37- static void readTextData (std::string& input, Module& wasm, IRProfile profile) {
38- if (auto parsed = WATParser::parseModule (wasm, input);
37+ static void readTextData (std::optional<std::string> filename,
38+ std::string& input,
39+ Module& wasm,
40+ IRProfile profile) {
41+ if (auto parsed = WATParser::parseModule (wasm, input, filename);
3942 auto err = parsed.getErr ()) {
4043 Fatal () << err->msg ;
4144 }
@@ -44,7 +47,7 @@ static void readTextData(std::string& input, Module& wasm, IRProfile profile) {
4447void ModuleReader::readText (std::string filename, Module& wasm) {
4548 BYN_TRACE (" reading text from " << filename << " \n " );
4649 auto input (read_file<std::string>(filename, Flags::Text));
47- readTextData (input, wasm, profile);
50+ readTextData (filename, input, wasm, profile);
4851}
4952
5053void ModuleReader::readBinaryData (std::vector<char >& input,
@@ -114,7 +117,7 @@ void ModuleReader::readStdin(Module& wasm, std::string sourceMapFilename) {
114117 std::ostringstream s;
115118 s.write (input.data (), input.size ());
116119 std::string input_str = s.str ();
117- readTextData (input_str, wasm, profile);
120+ readTextData (std:: nullopt , input_str, wasm, profile);
118121 }
119122}
120123
0 commit comments