diff options
Diffstat (limited to 'src/passes/Directize.cpp')
-rw-r--r-- | src/passes/Directize.cpp | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/src/passes/Directize.cpp b/src/passes/Directize.cpp index 8d5cacdaf..3d8fcdfdd 100644 --- a/src/passes/Directize.cpp +++ b/src/passes/Directize.cpp @@ -27,37 +27,13 @@ #include "wasm-builder.h" #include "wasm-traversal.h" #include "asm_v_wasm.h" -#include <ir/utils.h> +#include "ir/table-utils.h" +#include "ir/utils.h" namespace wasm { namespace { -struct FlatTable { - std::vector<Name> names; - bool valid; - - FlatTable(Table& table) { - valid = true; - for (auto& segment : table.segments) { - auto offset = segment.offset; - if (!offset->is<Const>()) { - // TODO: handle some non-constant segments - valid = false; - return; - } - Index start = offset->cast<Const>()->value.geti32(); - Index end = start + segment.data.size(); - if (end > names.size()) { - names.resize(end); - } - for (Index i = 0; i < segment.data.size(); i++) { - names[start + i] = segment.data[i]; - } - } - } -}; - struct FunctionDirectizer : public WalkerPass<PostWalker<FunctionDirectizer>> { bool isFunctionParallel() override { return true; } |