diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2020-09-09 13:01:21 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-09 13:01:21 -0700 |
commit | 2aa0cf300998c62aea8cc6698f8325653a9f0895 (patch) | |
tree | 2116bc18fd58514589821858c528951e76c5178b /src/wasm/wasm-io.cpp | |
parent | 41ea543093ed734c73e5202c58c899be447b3223 (diff) | |
download | binaryen-2aa0cf300998c62aea8cc6698f8325653a9f0895.tar.gz binaryen-2aa0cf300998c62aea8cc6698f8325653a9f0895.tar.bz2 binaryen-2aa0cf300998c62aea8cc6698f8325653a9f0895.zip |
Poppy IR wast parsing and validation (#3105)
Adds an IR profile to each function so the validator can determine
which validation rules to apply and adds a flag to have the wast
parser set the profile to Poppy for testing purposes.
Diffstat (limited to 'src/wasm/wasm-io.cpp')
-rw-r--r-- | src/wasm/wasm-io.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wasm/wasm-io.cpp b/src/wasm/wasm-io.cpp index 8fa714d9c..79687d469 100644 --- a/src/wasm/wasm-io.cpp +++ b/src/wasm/wasm-io.cpp @@ -33,16 +33,16 @@ namespace wasm { #define DEBUG_TYPE "writer" -static void readTextData(std::string& input, Module& wasm) { +static void readTextData(std::string& input, Module& wasm, IRProfile profile) { SExpressionParser parser(const_cast<char*>(input.c_str())); Element& root = *parser.root; - SExpressionWasmBuilder builder(wasm, *root[0]); + SExpressionWasmBuilder builder(wasm, *root[0], profile); } void ModuleReader::readText(std::string filename, Module& wasm) { BYN_TRACE("reading text from " << filename << "\n"); auto input(read_file<std::string>(filename, Flags::Text)); - readTextData(input, wasm); + readTextData(input, wasm, profile); } void ModuleReader::readBinaryData(std::vector<char>& input, @@ -113,7 +113,7 @@ void ModuleReader::readStdin(Module& wasm, std::string sourceMapFilename) { s.write(input.data(), input.size()); s << '\0'; std::string input_str = s.str(); - readTextData(input_str, wasm); + readTextData(input_str, wasm, profile); } } |