From e2afeacbac90b67a15ee98f51a2f6d0a99af6639 Mon Sep 17 00:00:00 2001 From: thaipanda <45444502+Thaipanda@users.noreply.github.com> Date: Wed, 16 Jan 2019 17:34:35 +0800 Subject: [PATCH 1/7] merge v2.0.1 (#4) * prepare new version * adjust the Dockerfile --- CMakeLists.txt | 4 ++-- README.md | 5 +---- docker/Dockerfile | 13 ++++--------- 3 files changed, 7 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index de65a1b301..ca7d62a69e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ cmake_minimum_required(VERSION 3.5) project(eosio_cdt) -set(VERSION_MAJOR 1) +set(VERSION_MAJOR 2) set(VERSION_MINOR 0) -set(VERSION_PATCH 2) +set(VERSION_PATCH 1) if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") diff --git a/README.md b/README.md index 29cf4aded7..51c94d5cf8 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,7 @@ # BOSCore.CDT (Contract Development Toolkit) -## BOSCore.CDT Version: v1.0.2 +## BOSCore.CDT Version: v2.0.1 ### Basic EOSIO.CDT Version: 1.4.1 -Dependencies: -* [cmake version 3.12+](https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line/355574) - EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that EOSIO.CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. ## Important! diff --git a/docker/Dockerfile b/docker/Dockerfile index 14d98270fe..42f2af2f66 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,17 +1,12 @@ -FROM ubuntu:18.04 +FROM boscore/builder as builder ARG branch=master -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates curl wget git cmake python3 g++ && rm -rf /var/lib/apt/lists/* \ - && cd / && git clone --depth 1 -b $branch https://github.com/boscore/bos.cdt.git --recursive \ +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates curl wget git cmake python3 g++ && rm -rf /var/lib/apt/lists/* + +RUN cd / && git clone --depth 1 -b $branch https://github.com/boscore/bos.cdt.git --recursive \ && cd /bos.cdt/ \ && ./build.sh \ && ./install.sh \ && cd .. \ && rm -rf ./bos.cdt -USER root - - -# https://hub.docker.com/r/gxk666/bos.cdt/tags -# docker pull gxk666/bos.cdt -# docker run -v /root:/root/ -it bos.cdt:latest /bin/bash \ No newline at end of file From e87aa699804162c23bbf13b883c65b7b70084006 Mon Sep 17 00:00:00 2001 From: thaipanda <45444502+Thaipanda@users.noreply.github.com> Date: Thu, 28 Feb 2019 12:38:32 +0800 Subject: [PATCH 2/7] update develop with master (#12) * merge v2.0.1 (#3) * prepare new version * adjust the Dockerfile * fix error: expected namespace name --- libraries/eosiolib/transaction.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libraries/eosiolib/transaction.h b/libraries/eosiolib/transaction.h index 2a0206c58f..6903006cff 100644 --- a/libraries/eosiolib/transaction.h +++ b/libraries/eosiolib/transaction.h @@ -4,6 +4,9 @@ */ #pragma once #include +#include + +using namespace eosio; extern "C" { /** From 3d53cb8c1b6e0056919187c5d10a98e14eb39078 Mon Sep 17 00:00:00 2001 From: thaipanda <45444502+Thaipanda@users.noreply.github.com> Date: Thu, 28 Feb 2019 19:06:42 +0800 Subject: [PATCH 3/7] merge v2.0.2 into develop (#14) * merget EOSIO.CDT 1.5.0 * add boscore/cdt Docker image --- .buildkite/pipeline.yml | 214 +++++ .gitmodules | 3 + CMakeLists.txt | 56 +- LICENSE | 2 +- README.md | 435 +-------- build.sh | 11 +- docker/Dockerfile | 17 +- docker/README.md | 18 + docker/docker-compose.yml | 11 + docs/guides/abi-generator-attributes.md | 60 ++ docs/guides/basic-usage.md | 37 + docs/guides/cmake.md | 38 + docs/guides/first-smart-contract.md | 28 + docs/guides/native-tester.md | 119 +++ docs/guides/upgrading-from-1.2-to-1.3.md | 226 +++++ docs/tools/eosio-abidiff.md | 24 + docs/tools/eosio-abigen.md | 31 + docs/tools/eosio-cpp.md | 73 ++ docs/tools/eosio-init.md | 30 + docs/tools/eosio-ld.md | 27 + eosio_llvm | 2 +- examples/CMakeLists.txt | 2 - examples/hello/CMakeLists.txt | 38 +- examples/hello/README.txt | 12 + examples/hello/hello.clauses.md | 40 - examples/hello/hello.cpp | 8 - examples/hello/hello.hpp | 13 - examples/hello/include/hello.hpp | 13 + .../hello/{ => ricardian}/hello.contracts.md | 7 +- examples/hello/src/CMakeLists.txt | 8 + examples/hello/src/hello.cpp | 11 + examples/hello/tests/CMakeLists.txt | 4 + examples/hello/tests/hello_test.cpp | 62 ++ examples/multi_index_example/CMakeLists.txt | 21 +- examples/multi_index_example/README.txt | 12 + .../include/multi_index_example.hpp | 30 + .../multi_index_example.cpp | 75 -- .../multi_index_example.contracts.md | 3 + .../multi_index_example/src/CMakeLists.txt | 8 + .../src/multi_index_example.cpp | 37 + examples/send_inline/CMakeLists.txt | 24 +- examples/send_inline/README.txt | 12 + examples/send_inline/include/send_inline.hpp | 11 + .../ricardian/send_inline.contracts.md | 3 + examples/send_inline/send_inline.cpp | 21 - examples/send_inline/src/CMakeLists.txt | 9 + examples/send_inline/src/send_inline.cpp | 10 + examples/template/CMakeLists.txt | 7 - eosio.imports.in => imports/eosio.imports.in | 2 - install.sh | 2 + libraries/CMakeLists.txt | 6 + libraries/boost/CMakeLists.txt | 3 +- libraries/eosiolib/CMakeLists.txt | 35 +- libraries/eosiolib/action.h | 33 +- libraries/eosiolib/action.hpp | 28 +- libraries/eosiolib/asset.hpp | 138 +-- libraries/eosiolib/binary_extension.hpp | 7 +- libraries/eosiolib/chain.h | 19 +- libraries/eosiolib/compiler_builtins.h | 130 ++- libraries/eosiolib/contract.hpp | 33 +- libraries/eosiolib/crypto.cpp | 6 +- libraries/eosiolib/crypto.h | 37 +- libraries/eosiolib/crypto.hpp | 24 +- libraries/eosiolib/datastream.hpp | 143 ++- libraries/eosiolib/db.h | 29 +- libraries/eosiolib/dispatcher.hpp | 46 +- libraries/eosiolib/eosio.hpp | 26 +- libraries/eosiolib/eosiolib.cpp | 11 +- libraries/eosiolib/fixed_bytes.hpp | 9 +- libraries/eosiolib/fixed_key.hpp | 62 +- libraries/eosiolib/fixedpoint.hpp | 205 ++-- libraries/eosiolib/ignore.hpp | 9 +- libraries/eosiolib/memory.h | 8 - libraries/eosiolib/memory.hpp | 33 +- libraries/eosiolib/multi_index.hpp | 845 ++++------------- libraries/eosiolib/name.hpp | 109 ++- libraries/eosiolib/permission.h | 27 +- libraries/eosiolib/permission.hpp | 12 +- libraries/eosiolib/print.h | 76 +- libraries/eosiolib/print.hpp | 236 ++--- libraries/eosiolib/privileged.h | 38 +- libraries/eosiolib/privileged.hpp | 80 +- libraries/eosiolib/producer_schedule.hpp | 16 +- libraries/eosiolib/public_key.hpp | 2 +- libraries/eosiolib/reflect.hpp | 186 ---- libraries/eosiolib/serialize.hpp | 18 +- libraries/eosiolib/singleton.hpp | 25 +- libraries/eosiolib/symbol.hpp | 130 ++- libraries/eosiolib/system.h | 46 +- libraries/eosiolib/system.hpp | 117 +++ libraries/eosiolib/time.hpp | 19 +- libraries/eosiolib/transaction.h | 23 +- libraries/eosiolib/transaction.hpp | 87 +- libraries/eosiolib/types.h | 33 +- libraries/eosiolib/varint.hpp | 48 +- libraries/libc++/CMakeLists.txt | 29 +- libraries/libc++/libcxx | 2 +- libraries/libc/CMakeLists.txt | 55 +- libraries/libc/musl | 2 +- libraries/native/CMakeLists.txt | 338 +++++++ libraries/native/crt.cpp | 139 +++ libraries/native/crt.hpp | 30 + libraries/native/elf_crt.s | 75 ++ libraries/native/intrinsics.cpp | 891 ++++++++++++++++++ libraries/native/intrinsics.hpp | 44 + libraries/native/intrinsics_def.hpp | 177 ++++ libraries/native/macho_crt.s | 70 ++ libraries/native/softfloat | 1 + libraries/native/tester.hpp | 122 +++ .../ClangExternalProject.txt | 2 +- modules/EosioCDTMacros.cmake.in | 40 + modules/EosioWasmToolchain.cmake.in | 57 +- InstallClang.txt => modules/InstallCDT.cmake | 15 + modules/LibrariesExternalProject.txt | 15 + modules/TestsExternalProject.txt | 15 + .../ToolsExternalProject.txt | 2 +- modules/eosio.cdt-config.cmake | 9 +- scripts/eosio_build_amazon.sh | 17 +- scripts/eosio_build_centos.sh | 14 +- scripts/eosio_build_fedora.sh | 16 +- scripts/eosio_build_ubuntu.sh | 16 +- scripts/generate_bottle.sh | 2 + scripts/generate_deb.sh | 11 +- scripts/generate_package.sh.in | 6 +- scripts/generate_rpm.sh | 15 +- scripts/generate_tarball.sh | 22 +- tests/CMakeLists.txt | 5 + tests/unit/CMakeLists.txt | 9 + tests/unit/name_tests.cpp | 47 + tests/unit/print_tests.cpp | 30 + tests/unit/system_tests.cpp | 33 + tools/CMakeLists.txt | 14 +- tools/abidiff/CMakeLists.txt | 2 + tools/abidiff/eosio-abidiff.cpp.in | 25 +- tools/abigen/CMakeLists.txt | 2 + tools/abigen/eosio-abigen.cpp.in | 8 +- tools/cc/CMakeLists.txt | 4 + tools/cc/eosio-cc.cpp.in | 10 +- tools/cc/eosio-cpp.cpp.in | 10 +- {external => tools/external}/CMakeLists.txt | 0 .../external}/wabt/.appveyor.yml | 0 .../external}/wabt/.clang-format | 0 {external => tools/external}/wabt/.gitmodules | 0 {external => tools/external}/wabt/.style.yapf | 0 {external => tools/external}/wabt/.travis.yml | 0 .../external}/wabt/CMakeLists.txt | 6 +- .../external}/wabt/Contributing.md | 0 {external => tools/external}/wabt/LICENSE | 0 {external => tools/external}/wabt/Makefile | 0 {external => tools/external}/wabt/README.md | 0 .../external}/wabt/cmake/FindRE2C.cmake | 0 .../external}/wabt/cmake/README.md | 0 .../external}/wabt/demo/custom.css | 0 .../external}/wabt/demo/index.html | 0 .../external}/wabt/demo/libwabt.js | 0 .../wabt/demo/third_party/codemirror/LICENSE | 0 .../third_party/codemirror/codemirror.css | 0 .../demo/third_party/codemirror/codemirror.js | 0 .../demo/third_party/codemirror/javascript.js | 0 .../third_party/codemirror/simple-mode.js | 0 .../demo/third_party/split/horizontal.png | Bin .../wabt/demo/third_party/split/split.min.js | 0 .../wabt/demo/third_party/split/vertical.png | Bin .../external}/wabt/demo/wasm2wat/demo.js | 0 .../external}/wabt/demo/wasm2wat/examples.js | 0 .../external}/wabt/demo/wasm2wat/index.html | 0 .../external}/wabt/demo/wast-mode.js | 0 .../external}/wabt/demo/wat2wasm/demo.js | 0 .../external}/wabt/demo/wat2wasm/examples.js | 0 .../external}/wabt/demo/wat2wasm/index.html | 0 .../external}/wabt/fuzz-in/wasm/stuff.wasm | Bin .../external}/wabt/fuzz-in/wast.dict | 0 .../external}/wabt/fuzz-in/wast/basic.txt | 0 .../external}/wabt/scripts/coverage.sh | 0 .../external}/wabt/scripts/fuzz-wasm2wat.sh | 0 .../external}/wabt/scripts/fuzz-wat2wasm.sh | 0 .../scripts/gen-emscripten-exported-json.py | 0 .../wabt/scripts/travis-before-install.sh | 0 .../external}/wabt/scripts/travis-build.sh | 0 .../external}/wabt/scripts/travis-common.sh | 0 .../external}/wabt/scripts/travis-emcc.sh | 0 .../external}/wabt/scripts/travis-test.sh | 0 .../external}/wabt/src/apply-names.cc | 0 .../external}/wabt/src/apply-names.h | 0 .../wabt/src/binary-reader-interp.cc | 0 .../external}/wabt/src/binary-reader-interp.h | 0 .../external}/wabt/src/binary-reader-ir.cc | 0 .../external}/wabt/src/binary-reader-ir.h | 0 .../wabt/src/binary-reader-logging.cc | 0 .../wabt/src/binary-reader-logging.h | 0 .../external}/wabt/src/binary-reader-nop.h | 0 .../wabt/src/binary-reader-objdump.cc | 0 .../wabt/src/binary-reader-objdump.h | 0 .../external}/wabt/src/binary-reader-opcnt.cc | 0 .../external}/wabt/src/binary-reader-opcnt.h | 0 .../external}/wabt/src/binary-reader.cc | 0 .../external}/wabt/src/binary-reader.h | 0 .../external}/wabt/src/binary-writer-spec.cc | 0 .../external}/wabt/src/binary-writer-spec.h | 0 .../external}/wabt/src/binary-writer.cc | 0 .../external}/wabt/src/binary-writer.h | 0 .../external}/wabt/src/binary.cc | 0 .../external}/wabt/src/binary.h | 0 .../external}/wabt/src/binding-hash.cc | 0 .../external}/wabt/src/binding-hash.h | 0 .../external}/wabt/src/c-writer.cc | 0 .../external}/wabt/src/c-writer.h | 0 {external => tools/external}/wabt/src/cast.h | 0 .../external}/wabt/src/circular-array.h | 0 .../external}/wabt/src/color.cc | 0 {external => tools/external}/wabt/src/color.h | 0 .../external}/wabt/src/common.cc | 0 .../external}/wabt/src/common.h | 0 .../external}/wabt/src/config.cc | 0 .../external}/wabt/src/config.h.in | 0 .../wabt/src/emscripten-exported.json | 0 .../external}/wabt/src/emscripten-helpers.cc | 0 .../external}/wabt/src/error-handler.cc | 3 +- .../external}/wabt/src/error-handler.h | 0 .../external}/wabt/src/expr-visitor.cc | 0 .../external}/wabt/src/expr-visitor.h | 0 .../external}/wabt/src/feature.cc | 0 .../external}/wabt/src/feature.def | 0 .../external}/wabt/src/feature.h | 0 .../external}/wabt/src/filenames.cc | 0 .../external}/wabt/src/filenames.h | 0 .../external}/wabt/src/generate-names.cc | 0 .../external}/wabt/src/generate-names.h | 0 .../external}/wabt/src/hash-util.cc | 0 .../external}/wabt/src/hash-util.h | 0 .../external}/wabt/src/interp.cc | 0 .../external}/wabt/src/interp.h | 0 .../external}/wabt/src/intrusive-list.h | 0 {external => tools/external}/wabt/src/ir.cc | 0 {external => tools/external}/wabt/src/ir.h | 0 .../external}/wabt/src/leb128.cc | 0 .../external}/wabt/src/leb128.h | 0 .../wabt/src/lexer-source-line-finder.cc | 0 .../wabt/src/lexer-source-line-finder.h | 0 .../external}/wabt/src/lexer-source.cc | 0 .../external}/wabt/src/lexer-source.h | 0 .../external}/wabt/src/literal.cc | 0 .../external}/wabt/src/literal.h | 0 .../external}/wabt/src/make-unique.h | 0 .../external}/wabt/src/opcode.cc | 0 .../external}/wabt/src/opcode.def | 0 .../external}/wabt/src/opcode.h | 0 .../external}/wabt/src/option-parser.cc | 0 .../external}/wabt/src/option-parser.h | 0 .../wabt/src/prebuilt/wasm2c.include.c | 0 .../wabt/src/prebuilt/wasm2c.include.h | 0 .../wabt/src/prebuilt/wast-lexer-gen.cc | 0 {external => tools/external}/wabt/src/range.h | 0 .../external}/wabt/src/resolve-names.cc | 0 .../external}/wabt/src/resolve-names.h | 0 .../external}/wabt/src/result.h | 0 .../external}/wabt/src/stream.cc | 0 .../external}/wabt/src/stream.h | 0 .../external}/wabt/src/string-view.cc | 0 .../external}/wabt/src/string-view.h | 0 .../external}/wabt/src/test-circular-array.cc | 0 .../external}/wabt/src/test-filenames.cc | 0 .../external}/wabt/src/test-hexfloat.cc | 0 .../external}/wabt/src/test-intrusive-list.cc | 0 .../external}/wabt/src/test-literal.cc | 0 .../external}/wabt/src/test-string-view.cc | 0 .../external}/wabt/src/test-utf8.cc | 0 .../external}/wabt/src/test-wast-parser.cc | 0 .../external}/wabt/src/token.cc | 0 .../external}/wabt/src/token.def | 0 {external => tools/external}/wabt/src/token.h | 0 .../external}/wabt/src/tools/postpass.cc | 0 .../wabt/src/tools/spectest-interp.cc | 0 .../external}/wabt/src/tools/stripbss.cc | 0 .../external}/wabt/src/tools/wasm-interp.cc | 0 .../external}/wabt/src/tools/wasm-objdump.cc | 0 .../wabt/src/tools/wasm-opcodecnt.cc | 0 .../external}/wabt/src/tools/wasm-validate.cc | 0 .../external}/wabt/src/tools/wasm2c.cc | 0 .../external}/wabt/src/tools/wasm2wat.cc | 0 .../external}/wabt/src/tools/wast2json.cc | 0 .../external}/wabt/src/tools/wat-desugar.cc | 0 .../external}/wabt/src/tools/wat2wasm.cc | 0 .../external}/wabt/src/tracing.cc | 0 .../external}/wabt/src/tracing.h | 0 .../external}/wabt/src/type-checker.cc | 0 .../external}/wabt/src/type-checker.h | 0 {external => tools/external}/wabt/src/utf8.cc | 0 {external => tools/external}/wabt/src/utf8.h | 0 .../external}/wabt/src/validator.cc | 0 .../external}/wabt/src/validator.h | 0 .../external}/wabt/src/wabt.post.js | 0 .../external}/wabt/src/wasm2c.c.tmpl | 0 .../external}/wabt/src/wasm2c.h.tmpl | 0 .../external}/wabt/src/wasm2c_tmpl.py | 0 .../external}/wabt/src/wast-lexer.cc | 0 .../external}/wabt/src/wast-lexer.h | 0 .../wabt/src/wast-parser-lexer-shared.cc | 0 .../wabt/src/wast-parser-lexer-shared.h | 0 .../external}/wabt/src/wast-parser.cc | 0 .../external}/wabt/src/wast-parser.h | 0 .../external}/wabt/src/wat-writer.cc | 0 .../external}/wabt/src/wat-writer.h | 0 .../external}/wabt/test/README.md | 0 .../wabt/test/binary/bad-data-size.txt | 0 .../bad-duplicate-section-around-custom.txt | 0 .../test/binary/bad-duplicate-section.txt | 0 .../test/binary/bad-duplicate-subsection.txt | 0 .../wabt/test/binary/bad-export-func.txt | 0 .../wabt/test/binary/bad-extra-end.txt | 0 .../test/binary/bad-function-body-count.txt | 0 .../test/binary/bad-function-body-size.txt | 0 .../test/binary/bad-function-local-count.txt | 0 .../test/binary/bad-function-local-type.txt | 0 .../binary/bad-function-names-too-many.txt | 0 .../test/binary/bad-function-param-type.txt | 0 .../test/binary/bad-function-result-type.txt | 0 .../wabt/test/binary/bad-function-sig.txt | 0 .../binary/bad-function-too-many-results.txt | 0 .../wabt/test/binary/bad-import-sig.txt | 0 .../wabt/test/binary/bad-linking-metadata.txt | 0 .../wabt/test/binary/bad-logging-basic.txt | 0 .../external}/wabt/test/binary/bad-magic.txt | 0 .../test/binary/bad-memory-init-max-size.txt | 0 .../wabt/test/binary/bad-memory-init-size.txt | 0 .../wabt/test/binary/bad-memory-max-size.txt | 0 .../binary/bad-name-section-invalid-index.txt | 0 .../test/binary/bad-name-section-location.txt | 0 .../binary/bad-names-duplicate-locals.txt | 0 .../wabt/test/binary/bad-names-duplicates.txt | 0 ...bad-names-function-locals-out-of-order.txt | 0 .../binary/bad-names-locals-out-of-order.txt | 0 .../test/binary/bad-names-out-of-order.txt | 0 .../wabt/test/binary/bad-op-after-end.txt | 0 .../wabt/test/binary/bad-opcode-prefix.txt | 0 .../external}/wabt/test/binary/bad-opcode.txt | 0 .../test/binary/bad-section-ends-early.txt | 0 .../test/binary/bad-section-size-zero.txt | 0 .../test/binary/bad-segment-no-memory.txt | 0 .../wabt/test/binary/bad-simd-type.txt | 0 .../wabt/test/binary/bad-start-func.txt | 0 .../binary/bad-subsection-out-of-order.txt | 0 .../wabt/test/binary/bad-subsection-size.txt | 0 .../test/binary/bad-subsection-unfinished.txt | 0 .../wabt/test/binary/bad-too-many-locals.txt | 0 .../wabt/test/binary/bad-type-form.txt | 0 .../wabt/test/binary/bad-typecheck-fail.txt | 0 .../binary/bad-typecheck-missing-drop.txt | 0 .../wabt/test/binary/bad-version.txt | 0 .../external}/wabt/test/binary/basic.txt | 0 .../wabt/test/binary/duplicate-names.txt | 0 .../wabt/test/binary/gen-wasm-parse-error.txt | 0 .../ignore-custom-section-error-objdump.txt | 0 .../ignore-custom-section-error-wasm2wat.txt | 0 .../wabt/test/binary/invalid-name.txt | 0 .../wabt/test/binary/linking-section.txt | 0 .../external}/wabt/test/binary/names.txt | 0 .../wabt/test/binary/no-global-names.txt | 0 .../external}/wabt/test/binary/no-names.txt | 0 .../external}/wabt/test/binary/relocs.txt | 0 .../wabt/test/binary/user-section.txt | 0 .../external}/wabt/test/desugar/basic.txt | 0 .../wabt/test/desugar/implicit-func-type.txt | 0 .../external}/wabt/test/desugar/try.txt | 0 .../external}/wabt/test/dump/atomic.txt | 0 .../wabt/test/dump/bad-version-logging.txt | 0 .../external}/wabt/test/dump/bad-version.txt | 0 .../external}/wabt/test/dump/basic.txt | 0 .../wabt/test/dump/basic_dump_only.txt | 0 .../external}/wabt/test/dump/binary.txt | 0 .../wabt/test/dump/block-257-exprs-br.txt | 0 .../wabt/test/dump/block-257-exprs.txt | 0 .../external}/wabt/test/dump/block-multi.txt | 0 .../external}/wabt/test/dump/block.txt | 0 .../wabt/test/dump/br-block-named.txt | 0 .../external}/wabt/test/dump/br-block.txt | 0 .../wabt/test/dump/br-loop-inner-expr.txt | 0 .../wabt/test/dump/br-loop-inner.txt | 0 .../external}/wabt/test/dump/br-loop.txt | 0 .../external}/wabt/test/dump/brif-loop.txt | 0 .../external}/wabt/test/dump/brif.txt | 0 .../wabt/test/dump/brtable-empty.txt | 0 .../external}/wabt/test/dump/brtable.txt | 0 .../external}/wabt/test/dump/call.txt | 0 .../external}/wabt/test/dump/callimport.txt | 0 .../external}/wabt/test/dump/callindirect.txt | 0 .../external}/wabt/test/dump/cast.txt | 0 .../external}/wabt/test/dump/compare.txt | 0 .../external}/wabt/test/dump/const.txt | 0 .../external}/wabt/test/dump/convert-sat.txt | 0 .../external}/wabt/test/dump/convert.txt | 0 .../wabt/test/dump/current-memory.txt | 0 .../wabt/test/dump/debug-import-names.txt | 0 .../external}/wabt/test/dump/debug-names.txt | 0 .../external}/wabt/test/dump/dedupe-sig.txt | 0 .../external}/wabt/test/dump/drop.txt | 0 .../external}/wabt/test/dump/except.txt | 0 .../external}/wabt/test/dump/export-multi.txt | 0 .../external}/wabt/test/dump/expr-br.txt | 0 .../external}/wabt/test/dump/expr-brif.txt | 0 .../wabt/test/dump/func-exported.txt | 0 .../external}/wabt/test/dump/func-multi.txt | 0 .../external}/wabt/test/dump/func-named.txt | 0 .../wabt/test/dump/func-result-multi.txt | 0 .../external}/wabt/test/dump/getglobal.txt | 0 .../wabt/test/dump/getlocal-param.txt | 0 .../external}/wabt/test/dump/getlocal.txt | 0 .../external}/wabt/test/dump/global.txt | 0 .../external}/wabt/test/dump/grow-memory.txt | 0 .../external}/wabt/test/dump/hexfloat_f32.txt | 0 .../external}/wabt/test/dump/hexfloat_f64.txt | 0 .../external}/wabt/test/dump/if-multi.txt | 0 .../wabt/test/dump/if-then-else-list.txt | 0 .../external}/wabt/test/dump/if-then-list.txt | 0 .../external}/wabt/test/dump/if.txt | 0 .../wabt/test/dump/if_except-multi.txt | 0 .../external}/wabt/test/dump/if_except.txt | 0 .../external}/wabt/test/dump/import.txt | 0 .../dump/invalid-data-segment-no-memory.txt | 0 .../test/dump/invalid-data-segment-offset.txt | 0 .../dump/invalid-elem-segment-no-table.txt | 0 .../test/dump/invalid-elem-segment-offset.txt | 0 .../external}/wabt/test/dump/load-aligned.txt | 0 .../external}/wabt/test/dump/load.txt | 0 .../external}/wabt/test/dump/locals.txt | 0 .../wabt/test/dump/loop-257-exprs-br.txt | 0 .../wabt/test/dump/loop-257-exprs.txt | 0 .../external}/wabt/test/dump/loop-multi.txt | 0 .../external}/wabt/test/dump/loop.txt | 0 .../wabt/test/dump/memory-1-byte.txt | 0 .../wabt/test/dump/memory-data-size.txt | 0 .../external}/wabt/test/dump/memory-hex.txt | 0 .../external}/wabt/test/dump/memory.txt | 0 .../external}/wabt/test/dump/module-name.txt | 0 .../external}/wabt/test/dump/multi_file.txt | 0 .../wabt/test/dump/mutable-global.txt | 0 .../wabt/test/dump/no-canonicalize.txt | 0 .../external}/wabt/test/dump/nocheck.txt | 0 .../external}/wabt/test/dump/nop.txt | 0 .../external}/wabt/test/dump/param-multi.txt | 0 .../external}/wabt/test/dump/relocations.txt | 0 .../external}/wabt/test/dump/result.txt | 0 .../external}/wabt/test/dump/rethrow.txt | 0 .../external}/wabt/test/dump/return.txt | 0 .../external}/wabt/test/dump/select.txt | 0 .../external}/wabt/test/dump/setglobal.txt | 0 .../wabt/test/dump/setlocal-param.txt | 0 .../external}/wabt/test/dump/setlocal.txt | 0 .../external}/wabt/test/dump/signatures.txt | 0 .../external}/wabt/test/dump/start.txt | 0 .../wabt/test/dump/store-aligned.txt | 0 .../external}/wabt/test/dump/store.txt | 0 .../wabt/test/dump/string-escape.txt | 0 .../external}/wabt/test/dump/string-hex.txt | 0 .../external}/wabt/test/dump/table.txt | 0 .../external}/wabt/test/dump/tee_local.txt | 0 .../external}/wabt/test/dump/throw.txt | 0 .../external}/wabt/test/dump/try-multi.txt | 0 .../external}/wabt/test/dump/try.txt | 0 .../external}/wabt/test/dump/unary-extend.txt | 0 .../external}/wabt/test/dump/unary.txt | 0 .../external}/wabt/test/dump/unreachable.txt | 0 .../external}/wabt/test/find_exe.py | 0 .../wabt/test/gen-spec-empty-prefix.js | 0 .../external}/wabt/test/gen-spec-js.py | 0 .../wabt/test/gen-spec-js/action.txt | 0 .../test/gen-spec-js/assert_exhaustion.txt | 0 .../gen-spec-js/assert_malformed-quote.txt | 0 .../test/gen-spec-js/assert_malformed.txt | 0 .../wabt/test/gen-spec-js/assert_return.txt | 0 .../test/gen-spec-js/assert_return_nan.txt | 0 .../wabt/test/gen-spec-js/assert_trap.txt | 0 .../gen-spec-js/assert_uninstantiable.txt | 0 .../test/gen-spec-js/assert_unlinkable.txt | 0 .../external}/wabt/test/gen-spec-js/basic.txt | 0 .../wabt/test/gen-spec-js/many-modules.txt | 0 .../wabt/test/gen-spec-js/register.txt | 0 .../external}/wabt/test/gen-spec-prefix.js | 0 .../external}/wabt/test/gen-wasm.py | 0 .../wabt/test/help/spectest-interp.txt | 0 .../external}/wabt/test/help/wasm-interp.txt | 0 .../external}/wabt/test/help/wasm-objdump.txt | 0 .../wabt/test/help/wasm-opcodecnt.txt | 0 .../wabt/test/help/wasm-validate.txt | 0 .../external}/wabt/test/help/wasm2wat.txt | 0 .../external}/wabt/test/help/wast2json.txt | 0 .../external}/wabt/test/help/wat-desugar.txt | 0 .../external}/wabt/test/help/wat2wasm.txt | 0 .../wabt/test/interp/atomic-load.txt | 0 .../wabt/test/interp/atomic-rmw-add.txt | 0 .../wabt/test/interp/atomic-rmw-and.txt | 0 .../wabt/test/interp/atomic-rmw-cmpxchg.txt | 0 .../wabt/test/interp/atomic-rmw-or.txt | 0 .../wabt/test/interp/atomic-rmw-sub.txt | 0 .../wabt/test/interp/atomic-rmw-xchg.txt | 0 .../wabt/test/interp/atomic-rmw-xor.txt | 0 .../wabt/test/interp/atomic-store.txt | 0 .../wabt/test/interp/basic-logging.txt | 0 .../wabt/test/interp/basic-tracing.txt | 0 .../external}/wabt/test/interp/basic.txt | 0 .../external}/wabt/test/interp/binary.txt | 0 .../wabt/test/interp/block-multi.txt | 0 .../external}/wabt/test/interp/br.txt | 0 .../external}/wabt/test/interp/brif-loop.txt | 0 .../external}/wabt/test/interp/brif.txt | 0 .../external}/wabt/test/interp/brtable.txt | 0 .../wabt/test/interp/call-multi-result.txt | 0 .../wabt/test/interp/call-zero-args.txt | 0 .../external}/wabt/test/interp/call.txt | 0 .../wabt/test/interp/callimport-zero-args.txt | 0 .../wabt/test/interp/callindirect.txt | 0 .../external}/wabt/test/interp/cast.txt | 0 .../external}/wabt/test/interp/compare.txt | 0 .../wabt/test/interp/convert-sat.txt | 0 .../external}/wabt/test/interp/convert.txt | 0 .../external}/wabt/test/interp/empty.txt | 0 .../external}/wabt/test/interp/expr-block.txt | 0 .../external}/wabt/test/interp/expr-br.txt | 0 .../external}/wabt/test/interp/expr-brif.txt | 0 .../external}/wabt/test/interp/expr-if.txt | 0 .../external}/wabt/test/interp/if-multi.txt | 0 .../external}/wabt/test/interp/if.txt | 0 .../external}/wabt/test/interp/import.txt | 0 .../external}/wabt/test/interp/load.txt | 0 .../wabt/test/interp/logging-all-opcodes.txt | 0 .../external}/wabt/test/interp/loop-multi.txt | 0 .../external}/wabt/test/interp/loop.txt | 0 .../wabt/test/interp/memory-empty-segment.txt | 0 .../external}/wabt/test/interp/nested-if.txt | 0 .../wabt/test/interp/return-void.txt | 0 .../external}/wabt/test/interp/return.txt | 0 .../external}/wabt/test/interp/select.txt | 0 .../external}/wabt/test/interp/simd-basic.txt | 0 .../wabt/test/interp/simd-binary.txt | 0 .../wabt/test/interp/simd-bitselect.txt | 0 .../wabt/test/interp/simd-compare.txt | 0 .../external}/wabt/test/interp/simd-lane.txt | 0 .../wabt/test/interp/simd-load-store.txt | 0 .../external}/wabt/test/interp/simd-shift.txt | 0 .../external}/wabt/test/interp/simd-splat.txt | 0 .../external}/wabt/test/interp/simd-unary.txt | 0 .../external}/wabt/test/interp/start.txt | 0 .../external}/wabt/test/interp/store.txt | 0 .../wabt/test/interp/tracing-all-opcodes.txt | 0 .../wabt/test/interp/trap-with-callstack.txt | 0 .../wabt/test/interp/unary-extend.txt | 0 .../external}/wabt/test/interp/unary.txt | 0 .../wabt/test/interp/unreachable.txt | 0 .../external}/wabt/test/opcodecnt/basic.txt | 0 .../external}/wabt/test/opcodecnt/cutoff.txt | 0 .../wabt/test/opcodecnt/immediates.txt | 0 .../test/parse/assert/assert-after-module.txt | 0 .../assert/assert-return-arithmetic-nan.txt | 0 .../assert/assert-return-canonical-nan.txt | 0 .../assert/assertinvalid-binary-module.txt | 0 .../wabt/test/parse/assert/assertinvalid.txt | 0 .../test/parse/assert/assertmalformed.txt | 0 .../wabt/test/parse/assert/assertreturn.txt | 0 .../parse/assert/bad-assert-before-module.txt | 0 ...urn-arithmetic-nan-invalid-return-type.txt | 0 ...d-assert-return-arithmetic-nan-too-few.txt | 0 ...-assert-return-arithmetic-nan-too-many.txt | 0 ...return-arithmetic-nan-unknown-function.txt | 0 ...turn-canonical-nan-invalid-return-type.txt | 0 ...ad-assert-return-canonical-nan-too-few.txt | 0 ...d-assert-return-canonical-nan-too-many.txt | 0 ...-return-canonical-nan-unknown-function.txt | 0 .../assert/bad-assertreturn-non-const.txt | 0 .../parse/assert/bad-assertreturn-too-few.txt | 0 .../assert/bad-assertreturn-too-many.txt | 0 .../bad-assertreturn-unknown-function.txt | 0 .../parse/assert/bad-invoke-no-module.txt | 0 .../test/parse/assert/bad-invoke-too-few.txt | 0 .../test/parse/assert/bad-invoke-too-many.txt | 0 .../assert/bad-invoke-unknown-function.txt | 0 .../wabt/test/parse/assert/invoke.txt | 0 .../external}/wabt/test/parse/bad-crlf.txt | 0 .../wabt/test/parse/bad-error-long-line.txt | 0 .../wabt/test/parse/bad-error-long-token.txt | 0 .../wabt/test/parse/bad-single-semicolon.txt | 0 .../wabt/test/parse/bad-string-eof.txt | 0 .../wabt/test/parse/bad-string-escape.txt | 0 .../wabt/test/parse/bad-string-hex-escape.txt | 0 .../wabt/test/parse/bad-toplevel.txt | 0 .../external}/wabt/test/parse/basic.txt | 0 .../external}/wabt/test/parse/empty-file.txt | 0 .../wabt/test/parse/export-mutable-global.txt | 0 .../wabt/test/parse/expr/atomic-align.txt | 0 .../wabt/test/parse/expr/atomic-disabled.txt | 0 .../external}/wabt/test/parse/expr/atomic.txt | 0 .../parse/expr/bad-atomic-unnatural-align.txt | 0 .../test/parse/expr/bad-binary-one-expr.txt | 0 .../test/parse/expr/bad-block-end-label.txt | 0 .../parse/expr/bad-block-mismatch-label.txt | 0 .../test/parse/expr/bad-block-sig-multi.txt | 0 .../wabt/test/parse/expr/bad-br-bad-depth.txt | 0 .../test/parse/expr/bad-br-defined-later.txt | 0 .../test/parse/expr/bad-br-name-undefined.txt | 0 .../wabt/test/parse/expr/bad-br-name.txt | 0 .../wabt/test/parse/expr/bad-br-no-depth.txt | 0 .../wabt/test/parse/expr/bad-br-undefined.txt | 0 .../test/parse/expr/bad-brtable-bad-depth.txt | 0 .../test/parse/expr/bad-compare-one-expr.txt | 0 .../parse/expr/bad-const-f32-trailing.txt | 0 .../test/parse/expr/bad-const-i32-garbage.txt | 0 .../expr/bad-const-i32-just-negative-sign.txt | 0 .../parse/expr/bad-const-i32-overflow.txt | 0 .../parse/expr/bad-const-i32-trailing.txt | 0 .../parse/expr/bad-const-i32-underflow.txt | 0 .../parse/expr/bad-const-i64-overflow.txt | 0 .../bad-const-type-i32-in-non-simd-const.txt | 0 .../expr/bad-const-v128-nat-expected.txt | 0 .../expr/bad-const-v128-nat-overflow.txt | 0 .../expr/bad-const-v128-type-i32-expected.txt | 0 .../parse/expr/bad-convert-float-sign.txt | 0 .../parse/expr/bad-convert-int-no-sign.txt | 0 .../expr/bad-getglobal-name-undefined.txt | 0 .../parse/expr/bad-getglobal-undefined.txt | 0 .../expr/bad-getlocal-name-undefined.txt | 0 .../test/parse/expr/bad-getlocal-name.txt | 0 .../parse/expr/bad-getlocal-undefined.txt | 0 .../wabt/test/parse/expr/bad-if-end-label.txt | 0 .../test/parse/expr/bad-if-mismatch-label.txt | 0 .../wabt/test/parse/expr/bad-if-no-then.txt | 0 .../wabt/test/parse/expr/bad-if-sig-multi.txt | 0 .../parse/expr/bad-if_except-sig-multi.txt | 0 .../parse/expr/bad-load-align-misspelled.txt | 0 .../parse/expr/bad-load-align-negative.txt | 0 .../parse/expr/bad-load-align-not-pot.txt | 0 .../wabt/test/parse/expr/bad-load-align.txt | 0 .../test/parse/expr/bad-load-float-sign.txt | 0 .../parse/expr/bad-load-offset-negative.txt | 0 .../wabt/test/parse/expr/bad-load-type.txt | 0 .../test/parse/expr/bad-loop-end-label.txt | 0 .../parse/expr/bad-loop-mismatch-label.txt | 0 .../test/parse/expr/bad-loop-sig-multi.txt | 0 .../wabt/test/parse/expr/bad-nop.txt | 0 .../wabt/test/parse/expr/bad-return-multi.txt | 0 .../expr/bad-setglobal-name-undefined.txt | 0 .../parse/expr/bad-setglobal-undefined.txt | 0 .../expr/bad-setlocal-name-undefined.txt | 0 .../test/parse/expr/bad-setlocal-name.txt | 0 .../test/parse/expr/bad-setlocal-no-value.txt | 0 .../parse/expr/bad-setlocal-undefined.txt | 0 .../bad-simd-shuffle-lane-index-overflow.txt | 0 .../expr/bad-simd-shuffle-nat-expected.txt | 0 .../parse/expr/bad-store-align-not-pot.txt | 0 .../wabt/test/parse/expr/bad-store-align.txt | 0 .../test/parse/expr/bad-store-float.sign.txt | 0 .../parse/expr/bad-store-offset-negative.txt | 0 .../wabt/test/parse/expr/bad-store-type.txt | 0 .../parse/expr/bad-try-multiple-catch.txt | 0 .../wabt/test/parse/expr/bad-try-no-catch.txt | 0 .../test/parse/expr/bad-try-sig-multi.txt | 0 .../wabt/test/parse/expr/bad-unexpected.txt | 0 .../external}/wabt/test/parse/expr/binary.txt | 0 .../wabt/test/parse/expr/block-multi.txt | 0 .../wabt/test/parse/expr/block-named.txt | 0 .../wabt/test/parse/expr/block-return.txt | 0 .../external}/wabt/test/parse/expr/block.txt | 0 .../wabt/test/parse/expr/br-block.txt | 0 .../wabt/test/parse/expr/br-loop.txt | 0 .../wabt/test/parse/expr/br-named.txt | 0 .../external}/wabt/test/parse/expr/br.txt | 0 .../wabt/test/parse/expr/brif-named.txt | 0 .../external}/wabt/test/parse/expr/brif.txt | 0 .../wabt/test/parse/expr/brtable-multi.txt | 0 .../wabt/test/parse/expr/brtable-named.txt | 0 .../wabt/test/parse/expr/brtable.txt | 0 .../test/parse/expr/call-defined-later.txt | 0 .../wabt/test/parse/expr/call-name-prefix.txt | 0 .../wabt/test/parse/expr/call-named.txt | 0 .../external}/wabt/test/parse/expr/call.txt | 0 .../parse/expr/callimport-defined-later.txt | 0 .../wabt/test/parse/expr/callimport-named.txt | 0 .../wabt/test/parse/expr/callimport-type.txt | 0 .../wabt/test/parse/expr/callimport.txt | 0 .../test/parse/expr/callindirect-named.txt | 0 .../wabt/test/parse/expr/callindirect.txt | 0 .../external}/wabt/test/parse/expr/cast.txt | 0 .../wabt/test/parse/expr/compare.txt | 0 .../external}/wabt/test/parse/expr/const.txt | 0 .../test/parse/expr/convert-sat-disabled.txt | 0 .../wabt/test/parse/expr/convert-sat.txt | 0 .../wabt/test/parse/expr/convert.txt | 0 .../wabt/test/parse/expr/current-memory.txt | 0 .../external}/wabt/test/parse/expr/drop.txt | 0 .../test/parse/expr/exceptions-disabled.txt | 0 .../wabt/test/parse/expr/expr-br.txt | 0 .../wabt/test/parse/expr/expr-brif.txt | 0 .../wabt/test/parse/expr/getglobal-named.txt | 0 .../wabt/test/parse/expr/getglobal.txt | 0 .../parse/expr/getlocal-index-after-param.txt | 0 .../getlocal-index-mixed-named-unnamed.txt | 0 .../wabt/test/parse/expr/getlocal-named.txt | 0 .../test/parse/expr/getlocal-param-named.txt | 0 .../wabt/test/parse/expr/getlocal-param.txt | 0 .../wabt/test/parse/expr/getlocal.txt | 0 .../wabt/test/parse/expr/grow-memory.txt | 0 .../wabt/test/parse/expr/if-multi.txt | 0 .../wabt/test/parse/expr/if-return.txt | 0 .../wabt/test/parse/expr/if-then-br-named.txt | 0 .../wabt/test/parse/expr/if-then-br.txt | 0 .../test/parse/expr/if-then-else-br-named.txt | 0 .../wabt/test/parse/expr/if-then-else-br.txt | 0 .../test/parse/expr/if-then-else-list.txt | 0 .../wabt/test/parse/expr/if-then-else.txt | 0 .../external}/wabt/test/parse/expr/if.txt | 0 .../wabt/test/parse/expr/if_except-multi.txt | 0 .../wabt/test/parse/expr/if_except.txt | 0 .../wabt/test/parse/expr/load-aligned.txt | 0 .../wabt/test/parse/expr/load-offset.txt | 0 .../external}/wabt/test/parse/expr/load.txt | 0 .../wabt/test/parse/expr/loop-multi.txt | 0 .../wabt/test/parse/expr/loop-named.txt | 0 .../external}/wabt/test/parse/expr/loop.txt | 0 .../external}/wabt/test/parse/expr/nop.txt | 0 .../wabt/test/parse/expr/rethrow.txt | 0 .../wabt/test/parse/expr/return-block.txt | 0 .../wabt/test/parse/expr/return-if.txt | 0 .../wabt/test/parse/expr/return-void.txt | 0 .../external}/wabt/test/parse/expr/return.txt | 0 .../external}/wabt/test/parse/expr/select.txt | 0 .../wabt/test/parse/expr/setglobal-named.txt | 0 .../wabt/test/parse/expr/setglobal.txt | 0 .../parse/expr/setlocal-index-after-param.txt | 0 .../setlocal-index-mixed-named-unnamed.txt | 0 .../wabt/test/parse/expr/setlocal-named.txt | 0 .../test/parse/expr/setlocal-param-named.txt | 0 .../wabt/test/parse/expr/setlocal-param.txt | 0 .../wabt/test/parse/expr/setlocal.txt | 0 .../external}/wabt/test/parse/expr/simd.txt | 0 .../wabt/test/parse/expr/store-aligned.txt | 0 .../wabt/test/parse/expr/store-offset.txt | 0 .../external}/wabt/test/parse/expr/store.txt | 0 .../wabt/test/parse/expr/tee_local.txt | 0 .../external}/wabt/test/parse/expr/throw.txt | 0 .../wabt/test/parse/expr/try-multi.txt | 0 .../external}/wabt/test/parse/expr/try.txt | 0 .../test/parse/expr/unary-extend-disabled.txt | 0 .../wabt/test/parse/expr/unary-extend.txt | 0 .../external}/wabt/test/parse/expr/unary.txt | 0 .../wabt/test/parse/expr/unreachable.txt | 0 .../external}/wabt/test/parse/force-color.txt | 0 .../wabt/test/parse/func/bad-func-name.txt | 0 .../parse/func/bad-local-binding-no-type.txt | 0 .../test/parse/func/bad-local-binding.txt | 0 .../wabt/test/parse/func/bad-local-name.txt | 0 .../test/parse/func/bad-local-type-list.txt | 0 .../wabt/test/parse/func/bad-local-type.txt | 0 .../test/parse/func/bad-param-binding.txt | 0 .../wabt/test/parse/func/bad-param-name.txt | 0 .../parse/func/bad-param-redefinition.txt | 0 .../test/parse/func/bad-param-type-list.txt | 0 .../wabt/test/parse/func/bad-param.txt | 0 .../wabt/test/parse/func/bad-result-multi.txt | 0 .../wabt/test/parse/func/bad-result-type.txt | 0 .../func/bad-sig-param-type-mismatch.txt | 0 .../test/parse/func/bad-sig-params-empty.txt | 0 .../func/bad-sig-result-type-mismatch.txt | 0 .../func/bad-sig-result-type-not-void.txt | 0 .../parse/func/bad-sig-result-type-void.txt | 0 .../parse/func/bad-sig-too-few-params.txt | 0 .../parse/func/bad-sig-too-many-params.txt | 0 .../wabt/test/parse/func/func-named.txt | 0 .../wabt/test/parse/func/local-empty.txt | 0 .../wabt/test/parse/func/local-multi.txt | 0 .../external}/wabt/test/parse/func/local.txt | 0 .../wabt/test/parse/func/no-space.txt | 0 .../wabt/test/parse/func/param-binding.txt | 0 .../wabt/test/parse/func/param-multi.txt | 0 .../wabt/test/parse/func/param-type-1.txt | 0 .../wabt/test/parse/func/param-type-2.txt | 0 .../wabt/test/parse/func/result-empty.txt | 0 .../wabt/test/parse/func/result-multi.txt | 0 .../external}/wabt/test/parse/func/result.txt | 0 .../wabt/test/parse/func/sig-match.txt | 0 .../external}/wabt/test/parse/func/sig.txt | 0 .../wabt/test/parse/line-comment.txt | 0 .../parse/module/bad-binary-module-magic.txt | 0 .../parse/module/bad-export-func-empty.txt | 0 .../module/bad-export-func-name-undefined.txt | 0 .../parse/module/bad-export-func-name.txt | 0 .../module/bad-export-func-no-string.txt | 0 .../parse/module/bad-export-func-too-many.txt | 0 .../module/bad-export-func-undefined.txt | 0 .../bad-export-global-name-undefined.txt | 0 .../module/bad-export-global-undefined.txt | 0 .../bad-export-memory-name-undefined.txt | 0 .../module/bad-export-memory-undefined.txt | 0 .../bad-export-table-name-undefined.txt | 0 .../module/bad-export-table-undefined.txt | 0 .../parse/module/bad-func-redefinition.txt | 0 .../parse/module/bad-global-invalid-expr.txt | 0 .../module/bad-global-invalid-getglobal.txt | 0 .../module/bad-import-func-not-param.txt | 0 .../module/bad-import-func-not-result.txt | 0 .../module/bad-import-func-one-string.txt | 0 .../module/bad-import-func-redefinition.txt | 0 .../module/bad-import-global-redefinition.txt | 0 .../module/bad-import-memory-redefinition.txt | 0 .../module/bad-import-table-redefinition.txt | 0 .../parse/module/bad-import-table-shared.txt | 0 .../test/parse/module/bad-memory-empty.txt | 0 .../module/bad-memory-init-size-negative.txt | 0 .../module/bad-memory-init-size-too-big.txt | 0 .../parse/module/bad-memory-init-size.txt | 0 .../module/bad-memory-max-less-than-init.txt | 0 .../module/bad-memory-max-size-negative.txt | 0 .../module/bad-memory-max-size-too-big.txt | 0 .../test/parse/module/bad-memory-max-size.txt | 0 .../module/bad-memory-segment-address.txt | 0 .../parse/module/bad-memory-shared-nomax.txt | 0 .../test/parse/module/bad-memory-too-many.txt | 0 .../test/parse/module/bad-module-multi.txt | 0 .../test/parse/module/bad-module-no-close.txt | 0 .../parse/module/bad-module-with-assert.txt | 0 .../parse/module/bad-start-not-nullary.txt | 0 .../test/parse/module/bad-start-not-void.txt | 0 .../test/parse/module/bad-start-too-many.txt | 0 .../module/bad-table-invalid-function.txt | 0 .../test/parse/module/bad-table-too-many.txt | 0 .../wabt/test/parse/module/binary-module.txt | 0 .../wabt/test/parse/module/data-offset.txt | 0 .../wabt/test/parse/module/elem-offset.txt | 0 .../wabt/test/parse/module/except.txt | 0 .../wabt/test/parse/module/export-except.txt | 0 .../test/parse/module/export-func-multi.txt | 0 .../test/parse/module/export-func-named.txt | 0 .../wabt/test/parse/module/export-func.txt | 0 .../wabt/test/parse/module/export-global.txt | 0 .../test/parse/module/export-memory-multi.txt | 0 .../wabt/test/parse/module/export-memory.txt | 0 .../wabt/test/parse/module/export-table.txt | 0 .../wabt/test/parse/module/global.txt | 0 .../wabt/test/parse/module/import-except.txt | 0 .../parse/module/import-func-no-param.txt | 0 .../test/parse/module/import-func-type.txt | 0 .../wabt/test/parse/module/import-func.txt | 0 .../parse/module/import-global-getglobal.txt | 0 .../wabt/test/parse/module/import-global.txt | 0 .../parse/module/import-memory-shared.txt | 0 .../wabt/test/parse/module/import-memory.txt | 0 .../parse/module/import-mutable-global.txt | 0 .../wabt/test/parse/module/import-table.txt | 0 .../parse/module/memory-init-max-size.txt | 0 .../test/parse/module/memory-init-size.txt | 0 .../test/parse/module/memory-segment-1.txt | 0 .../test/parse/module/memory-segment-long.txt | 0 .../test/parse/module/memory-segment-many.txt | 0 .../module/memory-segment-multi-string.txt | 0 .../wabt/test/parse/module/memory-shared.txt | 0 .../wabt/test/parse/module/module-empty.txt | 0 .../wabt/test/parse/module/start-named.txt | 0 .../wabt/test/parse/module/start.txt | 0 .../wabt/test/parse/module/table-named.txt | 0 .../wabt/test/parse/module/table.txt | 0 .../test/parse/module/type-empty-param.txt | 0 .../wabt/test/parse/module/type-empty.txt | 0 .../test/parse/module/type-multi-param.txt | 0 .../wabt/test/parse/module/type-no-param.txt | 0 .../external}/wabt/test/parse/module/type.txt | 0 .../wabt/test/parse/nested-comments.txt | 0 .../wabt/test/parse/string-escape.txt | 0 .../external}/wabt/test/parse/string-hex.txt | 0 .../external}/wabt/test/regress/regress-1.txt | 0 .../wabt/test/regress/regress-10.txt | 0 .../wabt/test/regress/regress-11.txt | 0 .../wabt/test/regress/regress-12.txt | 0 .../wabt/test/regress/regress-13.txt | 0 .../wabt/test/regress/regress-14.txt | 0 .../wabt/test/regress/regress-15.txt | 0 .../wabt/test/regress/regress-16.txt | 0 .../wabt/test/regress/regress-17.txt | 0 .../wabt/test/regress/regress-18.txt | 0 .../wabt/test/regress/regress-19.txt | 0 .../external}/wabt/test/regress/regress-2.txt | 0 .../wabt/test/regress/regress-20.txt | 0 .../external}/wabt/test/regress/regress-3.txt | 0 .../external}/wabt/test/regress/regress-4.txt | 0 .../external}/wabt/test/regress/regress-5.txt | 0 .../external}/wabt/test/regress/regress-6.txt | 0 .../external}/wabt/test/regress/regress-7.txt | 0 .../external}/wabt/test/regress/regress-8.txt | 0 .../external}/wabt/test/regress/regress-9.txt | 0 .../test/roundtrip/apply-global-names.txt | 0 .../test/roundtrip/debug-import-names.txt | 0 .../test/roundtrip/debug-names-after-data.txt | 0 .../wabt/test/roundtrip/debug-names.txt | 0 .../wabt/test/roundtrip/fold-atomic.txt | 0 .../wabt/test/roundtrip/fold-basic.txt | 0 .../wabt/test/roundtrip/fold-block.txt | 0 .../roundtrip/fold-call-import-gen-names.txt | 0 .../wabt/test/roundtrip/fold-call.txt | 0 .../wabt/test/roundtrip/fold-fac.txt | 0 .../test/roundtrip/fold-getset-global.txt | 0 .../wabt/test/roundtrip/fold-getset-local.txt | 0 .../wabt/test/roundtrip/fold-if_except.txt | 0 .../wabt/test/roundtrip/fold-load-store.txt | 0 .../wabt/test/roundtrip/fold-nop.txt | 0 .../wabt/test/roundtrip/fold-rethrow.txt | 0 .../wabt/test/roundtrip/fold-throw.txt | 0 .../wabt/test/roundtrip/fold-try.txt | 0 .../wabt/test/roundtrip/fold-unreachable.txt | 0 .../wabt/test/roundtrip/func-index.txt | 0 .../test/roundtrip/generate-except-names.txt | 0 .../test/roundtrip/generate-existing-name.txt | 0 .../roundtrip/generate-from-export-name.txt | 0 .../roundtrip/generate-from-import-name.txt | 0 .../test/roundtrip/generate-func-names.txt | 0 .../roundtrip/generate-func-type-names.txt | 0 .../test/roundtrip/generate-global-names.txt | 0 .../roundtrip/generate-if-label-names.txt | 0 .../test/roundtrip/generate-import-names.txt | 0 .../test/roundtrip/generate-label-names.txt | 0 .../test/roundtrip/generate-local-names.txt | 0 .../test/roundtrip/generate-some-names.txt | 0 .../wabt/test/roundtrip/global-index.txt | 0 .../roundtrip/inline-export-func-name.txt | 0 .../test/roundtrip/inline-export-func.txt | 0 .../test/roundtrip/inline-export-global.txt | 0 .../test/roundtrip/inline-export-memory.txt | 0 .../test/roundtrip/inline-export-multi.txt | 0 .../test/roundtrip/inline-export-table.txt | 0 .../test/roundtrip/inline-import-export.txt | 0 .../test/roundtrip/inline-import-func.txt | 0 .../test/roundtrip/inline-import-global.txt | 0 .../test/roundtrip/inline-import-memory.txt | 0 .../test/roundtrip/inline-import-table.txt | 0 .../wabt/test/roundtrip/invalid-br-var.txt | 0 .../test/roundtrip/invalid-local-index.txt | 0 .../external}/wabt/test/roundtrip/label.txt | 0 .../wabt/test/roundtrip/memory-index.txt | 0 .../wabt/test/roundtrip/table-index.txt | 0 .../external}/wabt/test/run-roundtrip.py | 0 .../external}/wabt/test/run-spec-wasm2c.py | 0 .../external}/wabt/test/run-tests.py | 0 .../external}/wabt/test/spec-wasm2c-prefix.c | 0 .../external}/wabt/test/spec/address.txt | 0 .../external}/wabt/test/spec/align.txt | 0 .../external}/wabt/test/spec/binary.txt | 0 .../external}/wabt/test/spec/block.txt | 0 .../external}/wabt/test/spec/br.txt | 0 .../external}/wabt/test/spec/br_if.txt | 0 .../external}/wabt/test/spec/br_table.txt | 0 .../external}/wabt/test/spec/break-drop.txt | 0 .../external}/wabt/test/spec/call.txt | 0 .../wabt/test/spec/call_indirect.txt | 0 .../external}/wabt/test/spec/comments.txt | 0 .../external}/wabt/test/spec/const.txt | 0 .../external}/wabt/test/spec/conversions.txt | 0 .../external}/wabt/test/spec/custom.txt | 0 .../wabt/test/spec/custom_section.txt | 0 .../external}/wabt/test/spec/data.txt | 0 .../external}/wabt/test/spec/elem.txt | 0 .../external}/wabt/test/spec/endianness.txt | 0 .../external}/wabt/test/spec/exports.txt | 0 .../external}/wabt/test/spec/f32.txt | 0 .../external}/wabt/test/spec/f32_bitwise.txt | 0 .../external}/wabt/test/spec/f32_cmp.txt | 0 .../external}/wabt/test/spec/f64.txt | 0 .../external}/wabt/test/spec/f64_bitwise.txt | 0 .../external}/wabt/test/spec/f64_cmp.txt | 0 .../external}/wabt/test/spec/fac.txt | 0 .../external}/wabt/test/spec/float_exprs.txt | 0 .../wabt/test/spec/float_literals.txt | 0 .../external}/wabt/test/spec/float_memory.txt | 0 .../external}/wabt/test/spec/float_misc.txt | 0 .../external}/wabt/test/spec/forward.txt | 0 .../external}/wabt/test/spec/func.txt | 0 .../external}/wabt/test/spec/func_ptrs.txt | 0 .../external}/wabt/test/spec/get_local.txt | 0 .../external}/wabt/test/spec/globals.txt | 0 .../external}/wabt/test/spec/i32.txt | 0 .../external}/wabt/test/spec/i64.txt | 0 .../external}/wabt/test/spec/if.txt | 0 .../external}/wabt/test/spec/imports.txt | 0 .../wabt/test/spec/inline-module.txt | 0 .../external}/wabt/test/spec/int_exprs.txt | 0 .../external}/wabt/test/spec/int_literals.txt | 0 .../external}/wabt/test/spec/labels.txt | 0 .../wabt/test/spec/left-to-right.txt | 0 .../external}/wabt/test/spec/linking.txt | 0 .../external}/wabt/test/spec/loop.txt | 0 .../external}/wabt/test/spec/memory.txt | 0 .../wabt/test/spec/memory_redundancy.txt | 0 .../external}/wabt/test/spec/memory_trap.txt | 0 .../external}/wabt/test/spec/names.txt | 0 .../external}/wabt/test/spec/nop.txt | 0 .../external}/wabt/test/spec/resizing.txt | 0 .../external}/wabt/test/spec/return.txt | 0 .../external}/wabt/test/spec/select.txt | 0 .../external}/wabt/test/spec/set_local.txt | 0 .../wabt/test/spec/skip-stack-guard-page.txt | 0 .../external}/wabt/test/spec/stack.txt | 0 .../external}/wabt/test/spec/start.txt | 0 .../external}/wabt/test/spec/store_retval.txt | 0 .../external}/wabt/test/spec/switch.txt | 0 .../external}/wabt/test/spec/tee_local.txt | 0 .../external}/wabt/test/spec/token.txt | 0 .../external}/wabt/test/spec/traps.txt | 0 .../external}/wabt/test/spec/type.txt | 0 .../external}/wabt/test/spec/typecheck.txt | 0 .../external}/wabt/test/spec/unreachable.txt | 0 .../wabt/test/spec/unreached-invalid.txt | 0 .../external}/wabt/test/spec/unwind.txt | 0 .../wabt/test/spec/utf8-custom-section-id.txt | 0 .../wabt/test/spec/utf8-import-field.txt | 0 .../wabt/test/spec/utf8-import-module.txt | 0 .../wabt/test/spec/utf8-invalid-encoding.txt | 0 .../wabt/test/too-many-arguments.txt | 0 .../external}/wabt/test/two-commands.txt | 0 .../bad-assertreturn-invoke-type-mismatch.txt | 0 .../bad-assertreturn-type-mismatch.txt | 0 .../typecheck/bad-atomic-no-shared-memory.txt | 0 .../typecheck/bad-atomic-type-mismatch.txt | 0 .../typecheck/bad-binary-type-mismatch-1.txt | 0 .../typecheck/bad-binary-type-mismatch-2.txt | 0 .../typecheck/bad-block-multi-mismatch.txt | 0 .../typecheck/bad-brtable-type-mismatch.txt | 0 .../typecheck/bad-call-result-mismatch.txt | 0 .../test/typecheck/bad-call-type-mismatch.txt | 0 .../bad-callimport-type-mismatch.txt | 0 .../bad-callindirect-func-type-mismatch.txt | 0 .../bad-callindirect-type-mismatch.txt | 0 .../test/typecheck/bad-cast-type-mismatch.txt | 0 .../typecheck/bad-compare-type-mismatch-1.txt | 0 .../typecheck/bad-compare-type-mismatch-2.txt | 0 .../typecheck/bad-convert-type-mismatch.txt | 0 .../wabt/test/typecheck/bad-expr-if.txt | 0 .../bad-function-result-type-mismatch.txt | 0 .../bad-global-getglobal-type-mismatch.txt | 0 .../typecheck/bad-global-no-init-expr.txt | 0 .../typecheck/bad-global-type-mismatch.txt | 0 .../bad-grow-memory-type-mismatch.txt | 0 .../bad-if-condition-type-mismatch.txt | 0 .../test/typecheck/bad-if-multi-mismatch.txt | 0 .../test/typecheck/bad-if-type-mismatch.txt | 0 .../wabt/test/typecheck/bad-if-value-void.txt | 0 .../typecheck/bad-invoke-type-mismatch.txt | 0 .../test/typecheck/bad-load-type-mismatch.txt | 0 .../typecheck/bad-loop-multi-mismatch.txt | 0 .../wabt/test/typecheck/bad-nested-br.txt | 0 .../test/typecheck/bad-no-shared-memory.txt | 0 .../typecheck/bad-return-type-mismatch.txt | 0 .../wabt/test/typecheck/bad-select-cond.txt | 0 .../wabt/test/typecheck/bad-select-value0.txt | 0 .../wabt/test/typecheck/bad-select-value1.txt | 0 .../typecheck/bad-setlocal-type-mismatch.txt | 0 .../wabt/test/typecheck/bad-simd-lane.txt | 0 .../bad-store-index-type-mismatch.txt | 0 .../typecheck/bad-unary-type-mismatch.txt | 0 .../wabt/test/typecheck/br-multi.txt | 0 .../wabt/test/typecheck/br-table-loop.txt | 0 .../wabt/test/typecheck/brif-multi.txt | 0 .../wabt/test/typecheck/brtable-multi.txt | 0 .../wabt/test/typecheck/if-then-br.txt | 0 .../wabt/test/typecheck/if-value.txt | 0 .../test/typecheck/label-redefinition.txt | 0 .../wabt/test/typecheck/nested-br.txt | 0 .../external}/wabt/test/typecheck/nocheck.txt | 0 .../test/typecheck/return-drop-value-2.txt | 0 .../wabt/test/typecheck/return-drop-value.txt | 0 .../wabt/test/typecheck/return-value.txt | 0 .../external}/wabt/test/update-spec-tests.py | 0 .../external}/wabt/test/utils.py | 0 .../wabt/test/wasm2c/bad-enable-feature.txt | 0 .../wabt/test/wasm2c/spec/address.txt | 0 .../external}/wabt/test/wasm2c/spec/align.txt | 0 .../wabt/test/wasm2c/spec/binary.txt | 0 .../external}/wabt/test/wasm2c/spec/block.txt | 0 .../external}/wabt/test/wasm2c/spec/br.txt | 0 .../external}/wabt/test/wasm2c/spec/br_if.txt | 0 .../wabt/test/wasm2c/spec/br_table.txt | 0 .../wabt/test/wasm2c/spec/break-drop.txt | 0 .../external}/wabt/test/wasm2c/spec/call.txt | 0 .../wabt/test/wasm2c/spec/call_indirect.txt | 0 .../wabt/test/wasm2c/spec/comments.txt | 0 .../external}/wabt/test/wasm2c/spec/const.txt | 0 .../wabt/test/wasm2c/spec/conversions.txt | 0 .../wabt/test/wasm2c/spec/custom_section.txt | 0 .../wabt/test/wasm2c/spec/endianness.txt | 0 .../wabt/test/wasm2c/spec/exports.txt | 0 .../external}/wabt/test/wasm2c/spec/f32.txt | 0 .../wabt/test/wasm2c/spec/f32_bitwise.txt | 0 .../wabt/test/wasm2c/spec/f32_cmp.txt | 0 .../external}/wabt/test/wasm2c/spec/f64.txt | 0 .../wabt/test/wasm2c/spec/f64_bitwise.txt | 0 .../wabt/test/wasm2c/spec/f64_cmp.txt | 0 .../external}/wabt/test/wasm2c/spec/fac.txt | 0 .../wabt/test/wasm2c/spec/float_exprs.txt | 0 .../wabt/test/wasm2c/spec/float_literals.txt | 0 .../wabt/test/wasm2c/spec/float_memory.txt | 0 .../wabt/test/wasm2c/spec/float_misc.txt | 0 .../wabt/test/wasm2c/spec/forward.txt | 0 .../external}/wabt/test/wasm2c/spec/func.txt | 0 .../wabt/test/wasm2c/spec/func_ptrs.txt | 0 .../wabt/test/wasm2c/spec/get_local.txt | 0 .../wabt/test/wasm2c/spec/globals.txt | 0 .../external}/wabt/test/wasm2c/spec/i32.txt | 0 .../external}/wabt/test/wasm2c/spec/i64.txt | 0 .../external}/wabt/test/wasm2c/spec/if.txt | 0 .../wabt/test/wasm2c/spec/imports.txt | 0 .../wabt/test/wasm2c/spec/inline-module.txt | 0 .../wabt/test/wasm2c/spec/int_exprs.txt | 0 .../wabt/test/wasm2c/spec/int_literals.txt | 0 .../wabt/test/wasm2c/spec/labels.txt | 0 .../wabt/test/wasm2c/spec/left-to-right.txt | 0 .../wabt/test/wasm2c/spec/linking.txt | 0 .../external}/wabt/test/wasm2c/spec/loop.txt | 0 .../wabt/test/wasm2c/spec/memory.txt | 0 .../test/wasm2c/spec/memory_redundancy.txt | 0 .../wabt/test/wasm2c/spec/memory_trap.txt | 0 .../external}/wabt/test/wasm2c/spec/names.txt | 0 .../external}/wabt/test/wasm2c/spec/nop.txt | 0 .../wabt/test/wasm2c/spec/resizing.txt | 0 .../wabt/test/wasm2c/spec/return.txt | 0 .../wabt/test/wasm2c/spec/select.txt | 0 .../wabt/test/wasm2c/spec/set_local.txt | 0 .../wasm2c/spec/skip-stack-guard-page.txt | 0 .../external}/wabt/test/wasm2c/spec/stack.txt | 0 .../external}/wabt/test/wasm2c/spec/start.txt | 0 .../wabt/test/wasm2c/spec/store_retval.txt | 0 .../wabt/test/wasm2c/spec/switch.txt | 0 .../wabt/test/wasm2c/spec/tee_local.txt | 0 .../external}/wabt/test/wasm2c/spec/token.txt | 0 .../external}/wabt/test/wasm2c/spec/traps.txt | 0 .../external}/wabt/test/wasm2c/spec/type.txt | 0 .../wabt/test/wasm2c/spec/typecheck.txt | 0 .../wabt/test/wasm2c/spec/unreachable.txt | 0 .../test/wasm2c/spec/unreached-invalid.txt | 0 .../wabt/test/wasm2c/spec/unwind.txt | 0 .../wasm2c/spec/utf8-custom-section-id.txt | 0 .../test/wasm2c/spec/utf8-import-field.txt | 0 .../test/wasm2c/spec/utf8-import-module.txt | 0 .../wasm2c/spec/utf8-invalid-encoding.txt | 0 .../external}/wabt/ubsan.blacklist | 0 .../external}/wabt/wasm2c/README.md | 0 .../external}/wabt/wasm2c/examples/fac/fac.c | 0 .../external}/wabt/wasm2c/examples/fac/fac.h | 0 .../wabt/wasm2c/examples/fac/fac.wasm | Bin .../wabt/wasm2c/examples/fac/fac.wat | 0 .../external}/wabt/wasm2c/examples/fac/main.c | 0 .../external}/wabt/wasm2c/wasm-rt-impl.c | 0 .../external}/wabt/wasm2c/wasm-rt-impl.h | 0 .../external}/wabt/wasm2c/wasm-rt.h | 0 tools/include/compiler_options.hpp.in | 202 ++-- tools/include/eosio/gen.hpp | 20 +- tools/include/eosio/utils.hpp | 7 +- tools/init/CMakeLists.txt | 3 + tools/init/eosio-init.cpp | 234 +++++ tools/ld/CMakeLists.txt | 2 + tools/ld/eosio-ld.cpp.in | 18 +- 1153 files changed, 5442 insertions(+), 2721 deletions(-) create mode 100644 .buildkite/pipeline.yml create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yml create mode 100644 docs/guides/abi-generator-attributes.md create mode 100644 docs/guides/basic-usage.md create mode 100644 docs/guides/cmake.md create mode 100644 docs/guides/first-smart-contract.md create mode 100644 docs/guides/native-tester.md create mode 100644 docs/guides/upgrading-from-1.2-to-1.3.md create mode 100644 docs/tools/eosio-abidiff.md create mode 100644 docs/tools/eosio-abigen.md create mode 100644 docs/tools/eosio-cpp.md create mode 100644 docs/tools/eosio-init.md create mode 100644 docs/tools/eosio-ld.md delete mode 100644 examples/CMakeLists.txt create mode 100644 examples/hello/README.txt delete mode 100644 examples/hello/hello.clauses.md delete mode 100644 examples/hello/hello.cpp delete mode 100644 examples/hello/hello.hpp create mode 100644 examples/hello/include/hello.hpp rename examples/hello/{ => ricardian}/hello.contracts.md (81%) create mode 100644 examples/hello/src/CMakeLists.txt create mode 100644 examples/hello/src/hello.cpp create mode 100644 examples/hello/tests/CMakeLists.txt create mode 100644 examples/hello/tests/hello_test.cpp create mode 100644 examples/multi_index_example/README.txt create mode 100644 examples/multi_index_example/include/multi_index_example.hpp delete mode 100644 examples/multi_index_example/multi_index_example.cpp create mode 100644 examples/multi_index_example/ricardian/multi_index_example.contracts.md create mode 100644 examples/multi_index_example/src/CMakeLists.txt create mode 100644 examples/multi_index_example/src/multi_index_example.cpp create mode 100644 examples/send_inline/README.txt create mode 100644 examples/send_inline/include/send_inline.hpp create mode 100644 examples/send_inline/ricardian/send_inline.contracts.md delete mode 100644 examples/send_inline/send_inline.cpp create mode 100644 examples/send_inline/src/CMakeLists.txt create mode 100644 examples/send_inline/src/send_inline.cpp delete mode 100644 examples/template/CMakeLists.txt rename eosio.imports.in => imports/eosio.imports.in (99%) delete mode 100644 libraries/eosiolib/memory.h delete mode 100644 libraries/eosiolib/reflect.hpp create mode 100644 libraries/eosiolib/system.hpp create mode 100644 libraries/native/CMakeLists.txt create mode 100644 libraries/native/crt.cpp create mode 100644 libraries/native/crt.hpp create mode 100644 libraries/native/elf_crt.s create mode 100644 libraries/native/intrinsics.cpp create mode 100644 libraries/native/intrinsics.hpp create mode 100644 libraries/native/intrinsics_def.hpp create mode 100644 libraries/native/macho_crt.s create mode 160000 libraries/native/softfloat create mode 100644 libraries/native/tester.hpp rename ClangExternalProject.txt => modules/ClangExternalProject.txt (53%) create mode 100644 modules/EosioCDTMacros.cmake.in rename InstallClang.txt => modules/InstallCDT.cmake (79%) create mode 100644 modules/LibrariesExternalProject.txt create mode 100644 modules/TestsExternalProject.txt rename ToolsExternalProject.txt => modules/ToolsExternalProject.txt (59%) create mode 100644 tests/CMakeLists.txt create mode 100644 tests/unit/CMakeLists.txt create mode 100644 tests/unit/name_tests.cpp create mode 100644 tests/unit/print_tests.cpp create mode 100644 tests/unit/system_tests.cpp rename {external => tools/external}/CMakeLists.txt (100%) rename {external => tools/external}/wabt/.appveyor.yml (100%) rename {external => tools/external}/wabt/.clang-format (100%) rename {external => tools/external}/wabt/.gitmodules (100%) rename {external => tools/external}/wabt/.style.yapf (100%) rename {external => tools/external}/wabt/.travis.yml (100%) rename {external => tools/external}/wabt/CMakeLists.txt (98%) rename {external => tools/external}/wabt/Contributing.md (100%) rename {external => tools/external}/wabt/LICENSE (100%) rename {external => tools/external}/wabt/Makefile (100%) rename {external => tools/external}/wabt/README.md (100%) rename {external => tools/external}/wabt/cmake/FindRE2C.cmake (100%) rename {external => tools/external}/wabt/cmake/README.md (100%) rename {external => tools/external}/wabt/demo/custom.css (100%) rename {external => tools/external}/wabt/demo/index.html (100%) rename {external => tools/external}/wabt/demo/libwabt.js (100%) rename {external => tools/external}/wabt/demo/third_party/codemirror/LICENSE (100%) rename {external => tools/external}/wabt/demo/third_party/codemirror/codemirror.css (100%) rename {external => tools/external}/wabt/demo/third_party/codemirror/codemirror.js (100%) rename {external => tools/external}/wabt/demo/third_party/codemirror/javascript.js (100%) rename {external => tools/external}/wabt/demo/third_party/codemirror/simple-mode.js (100%) rename {external => tools/external}/wabt/demo/third_party/split/horizontal.png (100%) rename {external => tools/external}/wabt/demo/third_party/split/split.min.js (100%) rename {external => tools/external}/wabt/demo/third_party/split/vertical.png (100%) rename {external => tools/external}/wabt/demo/wasm2wat/demo.js (100%) rename {external => tools/external}/wabt/demo/wasm2wat/examples.js (100%) rename {external => tools/external}/wabt/demo/wasm2wat/index.html (100%) rename {external => tools/external}/wabt/demo/wast-mode.js (100%) rename {external => tools/external}/wabt/demo/wat2wasm/demo.js (100%) rename {external => tools/external}/wabt/demo/wat2wasm/examples.js (100%) rename {external => tools/external}/wabt/demo/wat2wasm/index.html (100%) rename {external => tools/external}/wabt/fuzz-in/wasm/stuff.wasm (100%) rename {external => tools/external}/wabt/fuzz-in/wast.dict (100%) rename {external => tools/external}/wabt/fuzz-in/wast/basic.txt (100%) rename {external => tools/external}/wabt/scripts/coverage.sh (100%) rename {external => tools/external}/wabt/scripts/fuzz-wasm2wat.sh (100%) rename {external => tools/external}/wabt/scripts/fuzz-wat2wasm.sh (100%) rename {external => tools/external}/wabt/scripts/gen-emscripten-exported-json.py (100%) rename {external => tools/external}/wabt/scripts/travis-before-install.sh (100%) rename {external => tools/external}/wabt/scripts/travis-build.sh (100%) rename {external => tools/external}/wabt/scripts/travis-common.sh (100%) rename {external => tools/external}/wabt/scripts/travis-emcc.sh (100%) rename {external => tools/external}/wabt/scripts/travis-test.sh (100%) rename {external => tools/external}/wabt/src/apply-names.cc (100%) rename {external => tools/external}/wabt/src/apply-names.h (100%) rename {external => tools/external}/wabt/src/binary-reader-interp.cc (100%) rename {external => tools/external}/wabt/src/binary-reader-interp.h (100%) rename {external => tools/external}/wabt/src/binary-reader-ir.cc (100%) rename {external => tools/external}/wabt/src/binary-reader-ir.h (100%) rename {external => tools/external}/wabt/src/binary-reader-logging.cc (100%) rename {external => tools/external}/wabt/src/binary-reader-logging.h (100%) rename {external => tools/external}/wabt/src/binary-reader-nop.h (100%) rename {external => tools/external}/wabt/src/binary-reader-objdump.cc (100%) rename {external => tools/external}/wabt/src/binary-reader-objdump.h (100%) rename {external => tools/external}/wabt/src/binary-reader-opcnt.cc (100%) rename {external => tools/external}/wabt/src/binary-reader-opcnt.h (100%) rename {external => tools/external}/wabt/src/binary-reader.cc (100%) rename {external => tools/external}/wabt/src/binary-reader.h (100%) rename {external => tools/external}/wabt/src/binary-writer-spec.cc (100%) rename {external => tools/external}/wabt/src/binary-writer-spec.h (100%) rename {external => tools/external}/wabt/src/binary-writer.cc (100%) rename {external => tools/external}/wabt/src/binary-writer.h (100%) rename {external => tools/external}/wabt/src/binary.cc (100%) rename {external => tools/external}/wabt/src/binary.h (100%) rename {external => tools/external}/wabt/src/binding-hash.cc (100%) rename {external => tools/external}/wabt/src/binding-hash.h (100%) rename {external => tools/external}/wabt/src/c-writer.cc (100%) rename {external => tools/external}/wabt/src/c-writer.h (100%) rename {external => tools/external}/wabt/src/cast.h (100%) rename {external => tools/external}/wabt/src/circular-array.h (100%) rename {external => tools/external}/wabt/src/color.cc (100%) rename {external => tools/external}/wabt/src/color.h (100%) rename {external => tools/external}/wabt/src/common.cc (100%) rename {external => tools/external}/wabt/src/common.h (100%) rename {external => tools/external}/wabt/src/config.cc (100%) rename {external => tools/external}/wabt/src/config.h.in (100%) rename {external => tools/external}/wabt/src/emscripten-exported.json (100%) rename {external => tools/external}/wabt/src/emscripten-helpers.cc (100%) rename {external => tools/external}/wabt/src/error-handler.cc (99%) rename {external => tools/external}/wabt/src/error-handler.h (100%) rename {external => tools/external}/wabt/src/expr-visitor.cc (100%) rename {external => tools/external}/wabt/src/expr-visitor.h (100%) rename {external => tools/external}/wabt/src/feature.cc (100%) rename {external => tools/external}/wabt/src/feature.def (100%) rename {external => tools/external}/wabt/src/feature.h (100%) rename {external => tools/external}/wabt/src/filenames.cc (100%) rename {external => tools/external}/wabt/src/filenames.h (100%) rename {external => tools/external}/wabt/src/generate-names.cc (100%) rename {external => tools/external}/wabt/src/generate-names.h (100%) rename {external => tools/external}/wabt/src/hash-util.cc (100%) rename {external => tools/external}/wabt/src/hash-util.h (100%) rename {external => tools/external}/wabt/src/interp.cc (100%) rename {external => tools/external}/wabt/src/interp.h (100%) rename {external => tools/external}/wabt/src/intrusive-list.h (100%) rename {external => tools/external}/wabt/src/ir.cc (100%) rename {external => tools/external}/wabt/src/ir.h (100%) rename {external => tools/external}/wabt/src/leb128.cc (100%) rename {external => tools/external}/wabt/src/leb128.h (100%) rename {external => tools/external}/wabt/src/lexer-source-line-finder.cc (100%) rename {external => tools/external}/wabt/src/lexer-source-line-finder.h (100%) rename {external => tools/external}/wabt/src/lexer-source.cc (100%) rename {external => tools/external}/wabt/src/lexer-source.h (100%) rename {external => tools/external}/wabt/src/literal.cc (100%) rename {external => tools/external}/wabt/src/literal.h (100%) rename {external => tools/external}/wabt/src/make-unique.h (100%) rename {external => tools/external}/wabt/src/opcode.cc (100%) rename {external => tools/external}/wabt/src/opcode.def (100%) rename {external => tools/external}/wabt/src/opcode.h (100%) rename {external => tools/external}/wabt/src/option-parser.cc (100%) rename {external => tools/external}/wabt/src/option-parser.h (100%) rename {external => tools/external}/wabt/src/prebuilt/wasm2c.include.c (100%) rename {external => tools/external}/wabt/src/prebuilt/wasm2c.include.h (100%) rename {external => tools/external}/wabt/src/prebuilt/wast-lexer-gen.cc (100%) rename {external => tools/external}/wabt/src/range.h (100%) rename {external => tools/external}/wabt/src/resolve-names.cc (100%) rename {external => tools/external}/wabt/src/resolve-names.h (100%) rename {external => tools/external}/wabt/src/result.h (100%) rename {external => tools/external}/wabt/src/stream.cc (100%) rename {external => tools/external}/wabt/src/stream.h (100%) rename {external => tools/external}/wabt/src/string-view.cc (100%) rename {external => tools/external}/wabt/src/string-view.h (100%) rename {external => tools/external}/wabt/src/test-circular-array.cc (100%) rename {external => tools/external}/wabt/src/test-filenames.cc (100%) rename {external => tools/external}/wabt/src/test-hexfloat.cc (100%) rename {external => tools/external}/wabt/src/test-intrusive-list.cc (100%) rename {external => tools/external}/wabt/src/test-literal.cc (100%) rename {external => tools/external}/wabt/src/test-string-view.cc (100%) rename {external => tools/external}/wabt/src/test-utf8.cc (100%) rename {external => tools/external}/wabt/src/test-wast-parser.cc (100%) rename {external => tools/external}/wabt/src/token.cc (100%) rename {external => tools/external}/wabt/src/token.def (100%) rename {external => tools/external}/wabt/src/token.h (100%) rename {external => tools/external}/wabt/src/tools/postpass.cc (100%) rename {external => tools/external}/wabt/src/tools/spectest-interp.cc (100%) rename {external => tools/external}/wabt/src/tools/stripbss.cc (100%) rename {external => tools/external}/wabt/src/tools/wasm-interp.cc (100%) rename {external => tools/external}/wabt/src/tools/wasm-objdump.cc (100%) rename {external => tools/external}/wabt/src/tools/wasm-opcodecnt.cc (100%) rename {external => tools/external}/wabt/src/tools/wasm-validate.cc (100%) rename {external => tools/external}/wabt/src/tools/wasm2c.cc (100%) rename {external => tools/external}/wabt/src/tools/wasm2wat.cc (100%) rename {external => tools/external}/wabt/src/tools/wast2json.cc (100%) rename {external => tools/external}/wabt/src/tools/wat-desugar.cc (100%) rename {external => tools/external}/wabt/src/tools/wat2wasm.cc (100%) rename {external => tools/external}/wabt/src/tracing.cc (100%) rename {external => tools/external}/wabt/src/tracing.h (100%) rename {external => tools/external}/wabt/src/type-checker.cc (100%) rename {external => tools/external}/wabt/src/type-checker.h (100%) rename {external => tools/external}/wabt/src/utf8.cc (100%) rename {external => tools/external}/wabt/src/utf8.h (100%) rename {external => tools/external}/wabt/src/validator.cc (100%) rename {external => tools/external}/wabt/src/validator.h (100%) rename {external => tools/external}/wabt/src/wabt.post.js (100%) rename {external => tools/external}/wabt/src/wasm2c.c.tmpl (100%) rename {external => tools/external}/wabt/src/wasm2c.h.tmpl (100%) rename {external => tools/external}/wabt/src/wasm2c_tmpl.py (100%) rename {external => tools/external}/wabt/src/wast-lexer.cc (100%) rename {external => tools/external}/wabt/src/wast-lexer.h (100%) rename {external => tools/external}/wabt/src/wast-parser-lexer-shared.cc (100%) rename {external => tools/external}/wabt/src/wast-parser-lexer-shared.h (100%) rename {external => tools/external}/wabt/src/wast-parser.cc (100%) rename {external => tools/external}/wabt/src/wast-parser.h (100%) rename {external => tools/external}/wabt/src/wat-writer.cc (100%) rename {external => tools/external}/wabt/src/wat-writer.h (100%) rename {external => tools/external}/wabt/test/README.md (100%) rename {external => tools/external}/wabt/test/binary/bad-data-size.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-duplicate-section-around-custom.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-duplicate-section.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-duplicate-subsection.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-export-func.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-extra-end.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-body-count.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-body-size.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-local-count.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-local-type.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-names-too-many.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-param-type.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-result-type.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-sig.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-function-too-many-results.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-import-sig.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-linking-metadata.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-logging-basic.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-magic.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-memory-init-max-size.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-memory-init-size.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-memory-max-size.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-name-section-invalid-index.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-name-section-location.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-names-duplicate-locals.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-names-duplicates.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-names-function-locals-out-of-order.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-names-locals-out-of-order.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-names-out-of-order.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-op-after-end.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-opcode-prefix.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-opcode.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-section-ends-early.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-section-size-zero.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-segment-no-memory.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-simd-type.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-start-func.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-subsection-out-of-order.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-subsection-size.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-subsection-unfinished.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-too-many-locals.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-type-form.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-typecheck-fail.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-typecheck-missing-drop.txt (100%) rename {external => tools/external}/wabt/test/binary/bad-version.txt (100%) rename {external => tools/external}/wabt/test/binary/basic.txt (100%) rename {external => tools/external}/wabt/test/binary/duplicate-names.txt (100%) rename {external => tools/external}/wabt/test/binary/gen-wasm-parse-error.txt (100%) rename {external => tools/external}/wabt/test/binary/ignore-custom-section-error-objdump.txt (100%) rename {external => tools/external}/wabt/test/binary/ignore-custom-section-error-wasm2wat.txt (100%) rename {external => tools/external}/wabt/test/binary/invalid-name.txt (100%) rename {external => tools/external}/wabt/test/binary/linking-section.txt (100%) rename {external => tools/external}/wabt/test/binary/names.txt (100%) rename {external => tools/external}/wabt/test/binary/no-global-names.txt (100%) rename {external => tools/external}/wabt/test/binary/no-names.txt (100%) rename {external => tools/external}/wabt/test/binary/relocs.txt (100%) rename {external => tools/external}/wabt/test/binary/user-section.txt (100%) rename {external => tools/external}/wabt/test/desugar/basic.txt (100%) rename {external => tools/external}/wabt/test/desugar/implicit-func-type.txt (100%) rename {external => tools/external}/wabt/test/desugar/try.txt (100%) rename {external => tools/external}/wabt/test/dump/atomic.txt (100%) rename {external => tools/external}/wabt/test/dump/bad-version-logging.txt (100%) rename {external => tools/external}/wabt/test/dump/bad-version.txt (100%) rename {external => tools/external}/wabt/test/dump/basic.txt (100%) rename {external => tools/external}/wabt/test/dump/basic_dump_only.txt (100%) rename {external => tools/external}/wabt/test/dump/binary.txt (100%) rename {external => tools/external}/wabt/test/dump/block-257-exprs-br.txt (100%) rename {external => tools/external}/wabt/test/dump/block-257-exprs.txt (100%) rename {external => tools/external}/wabt/test/dump/block-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/block.txt (100%) rename {external => tools/external}/wabt/test/dump/br-block-named.txt (100%) rename {external => tools/external}/wabt/test/dump/br-block.txt (100%) rename {external => tools/external}/wabt/test/dump/br-loop-inner-expr.txt (100%) rename {external => tools/external}/wabt/test/dump/br-loop-inner.txt (100%) rename {external => tools/external}/wabt/test/dump/br-loop.txt (100%) rename {external => tools/external}/wabt/test/dump/brif-loop.txt (100%) rename {external => tools/external}/wabt/test/dump/brif.txt (100%) rename {external => tools/external}/wabt/test/dump/brtable-empty.txt (100%) rename {external => tools/external}/wabt/test/dump/brtable.txt (100%) rename {external => tools/external}/wabt/test/dump/call.txt (100%) rename {external => tools/external}/wabt/test/dump/callimport.txt (100%) rename {external => tools/external}/wabt/test/dump/callindirect.txt (100%) rename {external => tools/external}/wabt/test/dump/cast.txt (100%) rename {external => tools/external}/wabt/test/dump/compare.txt (100%) rename {external => tools/external}/wabt/test/dump/const.txt (100%) rename {external => tools/external}/wabt/test/dump/convert-sat.txt (100%) rename {external => tools/external}/wabt/test/dump/convert.txt (100%) rename {external => tools/external}/wabt/test/dump/current-memory.txt (100%) rename {external => tools/external}/wabt/test/dump/debug-import-names.txt (100%) rename {external => tools/external}/wabt/test/dump/debug-names.txt (100%) rename {external => tools/external}/wabt/test/dump/dedupe-sig.txt (100%) rename {external => tools/external}/wabt/test/dump/drop.txt (100%) rename {external => tools/external}/wabt/test/dump/except.txt (100%) rename {external => tools/external}/wabt/test/dump/export-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/expr-br.txt (100%) rename {external => tools/external}/wabt/test/dump/expr-brif.txt (100%) rename {external => tools/external}/wabt/test/dump/func-exported.txt (100%) rename {external => tools/external}/wabt/test/dump/func-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/func-named.txt (100%) rename {external => tools/external}/wabt/test/dump/func-result-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/getglobal.txt (100%) rename {external => tools/external}/wabt/test/dump/getlocal-param.txt (100%) rename {external => tools/external}/wabt/test/dump/getlocal.txt (100%) rename {external => tools/external}/wabt/test/dump/global.txt (100%) rename {external => tools/external}/wabt/test/dump/grow-memory.txt (100%) rename {external => tools/external}/wabt/test/dump/hexfloat_f32.txt (100%) rename {external => tools/external}/wabt/test/dump/hexfloat_f64.txt (100%) rename {external => tools/external}/wabt/test/dump/if-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/if-then-else-list.txt (100%) rename {external => tools/external}/wabt/test/dump/if-then-list.txt (100%) rename {external => tools/external}/wabt/test/dump/if.txt (100%) rename {external => tools/external}/wabt/test/dump/if_except-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/if_except.txt (100%) rename {external => tools/external}/wabt/test/dump/import.txt (100%) rename {external => tools/external}/wabt/test/dump/invalid-data-segment-no-memory.txt (100%) rename {external => tools/external}/wabt/test/dump/invalid-data-segment-offset.txt (100%) rename {external => tools/external}/wabt/test/dump/invalid-elem-segment-no-table.txt (100%) rename {external => tools/external}/wabt/test/dump/invalid-elem-segment-offset.txt (100%) rename {external => tools/external}/wabt/test/dump/load-aligned.txt (100%) rename {external => tools/external}/wabt/test/dump/load.txt (100%) rename {external => tools/external}/wabt/test/dump/locals.txt (100%) rename {external => tools/external}/wabt/test/dump/loop-257-exprs-br.txt (100%) rename {external => tools/external}/wabt/test/dump/loop-257-exprs.txt (100%) rename {external => tools/external}/wabt/test/dump/loop-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/loop.txt (100%) rename {external => tools/external}/wabt/test/dump/memory-1-byte.txt (100%) rename {external => tools/external}/wabt/test/dump/memory-data-size.txt (100%) rename {external => tools/external}/wabt/test/dump/memory-hex.txt (100%) rename {external => tools/external}/wabt/test/dump/memory.txt (100%) rename {external => tools/external}/wabt/test/dump/module-name.txt (100%) rename {external => tools/external}/wabt/test/dump/multi_file.txt (100%) rename {external => tools/external}/wabt/test/dump/mutable-global.txt (100%) rename {external => tools/external}/wabt/test/dump/no-canonicalize.txt (100%) rename {external => tools/external}/wabt/test/dump/nocheck.txt (100%) rename {external => tools/external}/wabt/test/dump/nop.txt (100%) rename {external => tools/external}/wabt/test/dump/param-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/relocations.txt (100%) rename {external => tools/external}/wabt/test/dump/result.txt (100%) rename {external => tools/external}/wabt/test/dump/rethrow.txt (100%) rename {external => tools/external}/wabt/test/dump/return.txt (100%) rename {external => tools/external}/wabt/test/dump/select.txt (100%) rename {external => tools/external}/wabt/test/dump/setglobal.txt (100%) rename {external => tools/external}/wabt/test/dump/setlocal-param.txt (100%) rename {external => tools/external}/wabt/test/dump/setlocal.txt (100%) rename {external => tools/external}/wabt/test/dump/signatures.txt (100%) rename {external => tools/external}/wabt/test/dump/start.txt (100%) rename {external => tools/external}/wabt/test/dump/store-aligned.txt (100%) rename {external => tools/external}/wabt/test/dump/store.txt (100%) rename {external => tools/external}/wabt/test/dump/string-escape.txt (100%) rename {external => tools/external}/wabt/test/dump/string-hex.txt (100%) rename {external => tools/external}/wabt/test/dump/table.txt (100%) rename {external => tools/external}/wabt/test/dump/tee_local.txt (100%) rename {external => tools/external}/wabt/test/dump/throw.txt (100%) rename {external => tools/external}/wabt/test/dump/try-multi.txt (100%) rename {external => tools/external}/wabt/test/dump/try.txt (100%) rename {external => tools/external}/wabt/test/dump/unary-extend.txt (100%) rename {external => tools/external}/wabt/test/dump/unary.txt (100%) rename {external => tools/external}/wabt/test/dump/unreachable.txt (100%) rename {external => tools/external}/wabt/test/find_exe.py (100%) rename {external => tools/external}/wabt/test/gen-spec-empty-prefix.js (100%) rename {external => tools/external}/wabt/test/gen-spec-js.py (100%) rename {external => tools/external}/wabt/test/gen-spec-js/action.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_exhaustion.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_malformed-quote.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_malformed.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_return.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_return_nan.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_trap.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_uninstantiable.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/assert_unlinkable.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/basic.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/many-modules.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-js/register.txt (100%) rename {external => tools/external}/wabt/test/gen-spec-prefix.js (100%) rename {external => tools/external}/wabt/test/gen-wasm.py (100%) rename {external => tools/external}/wabt/test/help/spectest-interp.txt (100%) rename {external => tools/external}/wabt/test/help/wasm-interp.txt (100%) rename {external => tools/external}/wabt/test/help/wasm-objdump.txt (100%) rename {external => tools/external}/wabt/test/help/wasm-opcodecnt.txt (100%) rename {external => tools/external}/wabt/test/help/wasm-validate.txt (100%) rename {external => tools/external}/wabt/test/help/wasm2wat.txt (100%) rename {external => tools/external}/wabt/test/help/wast2json.txt (100%) rename {external => tools/external}/wabt/test/help/wat-desugar.txt (100%) rename {external => tools/external}/wabt/test/help/wat2wasm.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-load.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-add.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-and.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-cmpxchg.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-or.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-sub.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-xchg.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-rmw-xor.txt (100%) rename {external => tools/external}/wabt/test/interp/atomic-store.txt (100%) rename {external => tools/external}/wabt/test/interp/basic-logging.txt (100%) rename {external => tools/external}/wabt/test/interp/basic-tracing.txt (100%) rename {external => tools/external}/wabt/test/interp/basic.txt (100%) rename {external => tools/external}/wabt/test/interp/binary.txt (100%) rename {external => tools/external}/wabt/test/interp/block-multi.txt (100%) rename {external => tools/external}/wabt/test/interp/br.txt (100%) rename {external => tools/external}/wabt/test/interp/brif-loop.txt (100%) rename {external => tools/external}/wabt/test/interp/brif.txt (100%) rename {external => tools/external}/wabt/test/interp/brtable.txt (100%) rename {external => tools/external}/wabt/test/interp/call-multi-result.txt (100%) rename {external => tools/external}/wabt/test/interp/call-zero-args.txt (100%) rename {external => tools/external}/wabt/test/interp/call.txt (100%) rename {external => tools/external}/wabt/test/interp/callimport-zero-args.txt (100%) rename {external => tools/external}/wabt/test/interp/callindirect.txt (100%) rename {external => tools/external}/wabt/test/interp/cast.txt (100%) rename {external => tools/external}/wabt/test/interp/compare.txt (100%) rename {external => tools/external}/wabt/test/interp/convert-sat.txt (100%) rename {external => tools/external}/wabt/test/interp/convert.txt (100%) rename {external => tools/external}/wabt/test/interp/empty.txt (100%) rename {external => tools/external}/wabt/test/interp/expr-block.txt (100%) rename {external => tools/external}/wabt/test/interp/expr-br.txt (100%) rename {external => tools/external}/wabt/test/interp/expr-brif.txt (100%) rename {external => tools/external}/wabt/test/interp/expr-if.txt (100%) rename {external => tools/external}/wabt/test/interp/if-multi.txt (100%) rename {external => tools/external}/wabt/test/interp/if.txt (100%) rename {external => tools/external}/wabt/test/interp/import.txt (100%) rename {external => tools/external}/wabt/test/interp/load.txt (100%) rename {external => tools/external}/wabt/test/interp/logging-all-opcodes.txt (100%) rename {external => tools/external}/wabt/test/interp/loop-multi.txt (100%) rename {external => tools/external}/wabt/test/interp/loop.txt (100%) rename {external => tools/external}/wabt/test/interp/memory-empty-segment.txt (100%) rename {external => tools/external}/wabt/test/interp/nested-if.txt (100%) rename {external => tools/external}/wabt/test/interp/return-void.txt (100%) rename {external => tools/external}/wabt/test/interp/return.txt (100%) rename {external => tools/external}/wabt/test/interp/select.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-basic.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-binary.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-bitselect.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-compare.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-lane.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-load-store.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-shift.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-splat.txt (100%) rename {external => tools/external}/wabt/test/interp/simd-unary.txt (100%) rename {external => tools/external}/wabt/test/interp/start.txt (100%) rename {external => tools/external}/wabt/test/interp/store.txt (100%) rename {external => tools/external}/wabt/test/interp/tracing-all-opcodes.txt (100%) rename {external => tools/external}/wabt/test/interp/trap-with-callstack.txt (100%) rename {external => tools/external}/wabt/test/interp/unary-extend.txt (100%) rename {external => tools/external}/wabt/test/interp/unary.txt (100%) rename {external => tools/external}/wabt/test/interp/unreachable.txt (100%) rename {external => tools/external}/wabt/test/opcodecnt/basic.txt (100%) rename {external => tools/external}/wabt/test/opcodecnt/cutoff.txt (100%) rename {external => tools/external}/wabt/test/opcodecnt/immediates.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assert-after-module.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assert-return-arithmetic-nan.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assert-return-canonical-nan.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assertinvalid-binary-module.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assertinvalid.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assertmalformed.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/assertreturn.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-before-module.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assertreturn-non-const.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assertreturn-too-few.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assertreturn-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-assertreturn-unknown-function.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-invoke-no-module.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-invoke-too-few.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-invoke-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/bad-invoke-unknown-function.txt (100%) rename {external => tools/external}/wabt/test/parse/assert/invoke.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-crlf.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-error-long-line.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-error-long-token.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-single-semicolon.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-string-eof.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-string-escape.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-string-hex-escape.txt (100%) rename {external => tools/external}/wabt/test/parse/bad-toplevel.txt (100%) rename {external => tools/external}/wabt/test/parse/basic.txt (100%) rename {external => tools/external}/wabt/test/parse/empty-file.txt (100%) rename {external => tools/external}/wabt/test/parse/export-mutable-global.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/atomic-align.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/atomic-disabled.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/atomic.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-atomic-unnatural-align.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-binary-one-expr.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-block-end-label.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-block-mismatch-label.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-block-sig-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-br-bad-depth.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-br-defined-later.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-br-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-br-name.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-br-no-depth.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-br-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-brtable-bad-depth.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-compare-one-expr.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-f32-trailing.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-i32-garbage.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-i32-just-negative-sign.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-i32-overflow.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-i32-trailing.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-i32-underflow.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-i64-overflow.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-v128-nat-expected.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-v128-nat-overflow.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-const-v128-type-i32-expected.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-convert-float-sign.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-convert-int-no-sign.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-getglobal-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-getglobal-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-getlocal-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-getlocal-name.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-getlocal-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-if-end-label.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-if-mismatch-label.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-if-no-then.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-if-sig-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-if_except-sig-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-align-misspelled.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-align-negative.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-align-not-pot.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-align.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-float-sign.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-offset-negative.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-load-type.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-loop-end-label.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-loop-mismatch-label.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-loop-sig-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-nop.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-return-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-setglobal-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-setglobal-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-setlocal-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-setlocal-name.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-setlocal-no-value.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-setlocal-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-simd-shuffle-nat-expected.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-store-align-not-pot.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-store-align.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-store-float.sign.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-store-offset-negative.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-store-type.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-try-multiple-catch.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-try-no-catch.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-try-sig-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/bad-unexpected.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/binary.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/block-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/block-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/block-return.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/block.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/br-block.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/br-loop.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/br-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/br.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/brif-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/brif.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/brtable-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/brtable-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/brtable.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/call-defined-later.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/call-name-prefix.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/call-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/call.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/callimport-defined-later.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/callimport-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/callimport-type.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/callimport.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/callindirect-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/callindirect.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/cast.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/compare.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/const.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/convert-sat-disabled.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/convert-sat.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/convert.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/current-memory.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/drop.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/exceptions-disabled.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/expr-br.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/expr-brif.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getglobal-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getglobal.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getlocal-index-after-param.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getlocal-index-mixed-named-unnamed.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getlocal-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getlocal-param-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getlocal-param.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/getlocal.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/grow-memory.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-return.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-then-br-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-then-br.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-then-else-br-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-then-else-br.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-then-else-list.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if-then-else.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if_except-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/if_except.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/load-aligned.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/load-offset.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/load.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/loop-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/loop-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/loop.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/nop.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/rethrow.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/return-block.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/return-if.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/return-void.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/return.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/select.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setglobal-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setglobal.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setlocal-index-after-param.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setlocal-index-mixed-named-unnamed.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setlocal-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setlocal-param-named.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setlocal-param.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/setlocal.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/simd.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/store-aligned.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/store-offset.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/store.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/tee_local.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/throw.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/try-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/try.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/unary-extend-disabled.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/unary-extend.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/unary.txt (100%) rename {external => tools/external}/wabt/test/parse/expr/unreachable.txt (100%) rename {external => tools/external}/wabt/test/parse/force-color.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-func-name.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-local-binding-no-type.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-local-binding.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-local-name.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-local-type-list.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-local-type.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-param-binding.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-param-name.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-param-redefinition.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-param-type-list.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-param.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-result-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-result-type.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-param-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-params-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-result-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-result-type-not-void.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-result-type-void.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-too-few-params.txt (100%) rename {external => tools/external}/wabt/test/parse/func/bad-sig-too-many-params.txt (100%) rename {external => tools/external}/wabt/test/parse/func/func-named.txt (100%) rename {external => tools/external}/wabt/test/parse/func/local-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/func/local-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/func/local.txt (100%) rename {external => tools/external}/wabt/test/parse/func/no-space.txt (100%) rename {external => tools/external}/wabt/test/parse/func/param-binding.txt (100%) rename {external => tools/external}/wabt/test/parse/func/param-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/func/param-type-1.txt (100%) rename {external => tools/external}/wabt/test/parse/func/param-type-2.txt (100%) rename {external => tools/external}/wabt/test/parse/func/result-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/func/result-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/func/result.txt (100%) rename {external => tools/external}/wabt/test/parse/func/sig-match.txt (100%) rename {external => tools/external}/wabt/test/parse/func/sig.txt (100%) rename {external => tools/external}/wabt/test/parse/line-comment.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-binary-module-magic.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-func-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-func-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-func-name.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-func-no-string.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-func-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-func-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-global-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-global-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-memory-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-memory-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-table-name-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-export-table-undefined.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-func-redefinition.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-global-invalid-expr.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-global-invalid-getglobal.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-func-not-param.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-func-not-result.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-func-one-string.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-func-redefinition.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-global-redefinition.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-memory-redefinition.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-table-redefinition.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-import-table-shared.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-init-size-negative.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-init-size-too-big.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-init-size.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-max-less-than-init.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-max-size-negative.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-max-size-too-big.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-max-size.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-segment-address.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-shared-nomax.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-memory-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-module-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-module-no-close.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-module-with-assert.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-start-not-nullary.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-start-not-void.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-start-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-table-invalid-function.txt (100%) rename {external => tools/external}/wabt/test/parse/module/bad-table-too-many.txt (100%) rename {external => tools/external}/wabt/test/parse/module/binary-module.txt (100%) rename {external => tools/external}/wabt/test/parse/module/data-offset.txt (100%) rename {external => tools/external}/wabt/test/parse/module/elem-offset.txt (100%) rename {external => tools/external}/wabt/test/parse/module/except.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-except.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-func-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-func-named.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-func.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-global.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-memory-multi.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-memory.txt (100%) rename {external => tools/external}/wabt/test/parse/module/export-table.txt (100%) rename {external => tools/external}/wabt/test/parse/module/global.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-except.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-func-no-param.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-func-type.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-func.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-global-getglobal.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-global.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-memory-shared.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-memory.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-mutable-global.txt (100%) rename {external => tools/external}/wabt/test/parse/module/import-table.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-init-max-size.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-init-size.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-segment-1.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-segment-long.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-segment-many.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-segment-multi-string.txt (100%) rename {external => tools/external}/wabt/test/parse/module/memory-shared.txt (100%) rename {external => tools/external}/wabt/test/parse/module/module-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/module/start-named.txt (100%) rename {external => tools/external}/wabt/test/parse/module/start.txt (100%) rename {external => tools/external}/wabt/test/parse/module/table-named.txt (100%) rename {external => tools/external}/wabt/test/parse/module/table.txt (100%) rename {external => tools/external}/wabt/test/parse/module/type-empty-param.txt (100%) rename {external => tools/external}/wabt/test/parse/module/type-empty.txt (100%) rename {external => tools/external}/wabt/test/parse/module/type-multi-param.txt (100%) rename {external => tools/external}/wabt/test/parse/module/type-no-param.txt (100%) rename {external => tools/external}/wabt/test/parse/module/type.txt (100%) rename {external => tools/external}/wabt/test/parse/nested-comments.txt (100%) rename {external => tools/external}/wabt/test/parse/string-escape.txt (100%) rename {external => tools/external}/wabt/test/parse/string-hex.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-1.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-10.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-11.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-12.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-13.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-14.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-15.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-16.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-17.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-18.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-19.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-2.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-20.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-3.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-4.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-5.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-6.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-7.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-8.txt (100%) rename {external => tools/external}/wabt/test/regress/regress-9.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/apply-global-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/debug-import-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/debug-names-after-data.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/debug-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-atomic.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-basic.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-block.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-call-import-gen-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-call.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-fac.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-getset-global.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-getset-local.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-if_except.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-load-store.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-nop.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-rethrow.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-throw.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-try.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/fold-unreachable.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/func-index.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-except-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-existing-name.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-from-export-name.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-from-import-name.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-func-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-func-type-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-global-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-if-label-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-import-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-label-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-local-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/generate-some-names.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/global-index.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-export-func-name.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-export-func.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-export-global.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-export-memory.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-export-multi.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-export-table.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-import-export.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-import-func.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-import-global.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-import-memory.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/inline-import-table.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/invalid-br-var.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/invalid-local-index.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/label.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/memory-index.txt (100%) rename {external => tools/external}/wabt/test/roundtrip/table-index.txt (100%) rename {external => tools/external}/wabt/test/run-roundtrip.py (100%) rename {external => tools/external}/wabt/test/run-spec-wasm2c.py (100%) rename {external => tools/external}/wabt/test/run-tests.py (100%) rename {external => tools/external}/wabt/test/spec-wasm2c-prefix.c (100%) rename {external => tools/external}/wabt/test/spec/address.txt (100%) rename {external => tools/external}/wabt/test/spec/align.txt (100%) rename {external => tools/external}/wabt/test/spec/binary.txt (100%) rename {external => tools/external}/wabt/test/spec/block.txt (100%) rename {external => tools/external}/wabt/test/spec/br.txt (100%) rename {external => tools/external}/wabt/test/spec/br_if.txt (100%) rename {external => tools/external}/wabt/test/spec/br_table.txt (100%) rename {external => tools/external}/wabt/test/spec/break-drop.txt (100%) rename {external => tools/external}/wabt/test/spec/call.txt (100%) rename {external => tools/external}/wabt/test/spec/call_indirect.txt (100%) rename {external => tools/external}/wabt/test/spec/comments.txt (100%) rename {external => tools/external}/wabt/test/spec/const.txt (100%) rename {external => tools/external}/wabt/test/spec/conversions.txt (100%) rename {external => tools/external}/wabt/test/spec/custom.txt (100%) rename {external => tools/external}/wabt/test/spec/custom_section.txt (100%) rename {external => tools/external}/wabt/test/spec/data.txt (100%) rename {external => tools/external}/wabt/test/spec/elem.txt (100%) rename {external => tools/external}/wabt/test/spec/endianness.txt (100%) rename {external => tools/external}/wabt/test/spec/exports.txt (100%) rename {external => tools/external}/wabt/test/spec/f32.txt (100%) rename {external => tools/external}/wabt/test/spec/f32_bitwise.txt (100%) rename {external => tools/external}/wabt/test/spec/f32_cmp.txt (100%) rename {external => tools/external}/wabt/test/spec/f64.txt (100%) rename {external => tools/external}/wabt/test/spec/f64_bitwise.txt (100%) rename {external => tools/external}/wabt/test/spec/f64_cmp.txt (100%) rename {external => tools/external}/wabt/test/spec/fac.txt (100%) rename {external => tools/external}/wabt/test/spec/float_exprs.txt (100%) rename {external => tools/external}/wabt/test/spec/float_literals.txt (100%) rename {external => tools/external}/wabt/test/spec/float_memory.txt (100%) rename {external => tools/external}/wabt/test/spec/float_misc.txt (100%) rename {external => tools/external}/wabt/test/spec/forward.txt (100%) rename {external => tools/external}/wabt/test/spec/func.txt (100%) rename {external => tools/external}/wabt/test/spec/func_ptrs.txt (100%) rename {external => tools/external}/wabt/test/spec/get_local.txt (100%) rename {external => tools/external}/wabt/test/spec/globals.txt (100%) rename {external => tools/external}/wabt/test/spec/i32.txt (100%) rename {external => tools/external}/wabt/test/spec/i64.txt (100%) rename {external => tools/external}/wabt/test/spec/if.txt (100%) rename {external => tools/external}/wabt/test/spec/imports.txt (100%) rename {external => tools/external}/wabt/test/spec/inline-module.txt (100%) rename {external => tools/external}/wabt/test/spec/int_exprs.txt (100%) rename {external => tools/external}/wabt/test/spec/int_literals.txt (100%) rename {external => tools/external}/wabt/test/spec/labels.txt (100%) rename {external => tools/external}/wabt/test/spec/left-to-right.txt (100%) rename {external => tools/external}/wabt/test/spec/linking.txt (100%) rename {external => tools/external}/wabt/test/spec/loop.txt (100%) rename {external => tools/external}/wabt/test/spec/memory.txt (100%) rename {external => tools/external}/wabt/test/spec/memory_redundancy.txt (100%) rename {external => tools/external}/wabt/test/spec/memory_trap.txt (100%) rename {external => tools/external}/wabt/test/spec/names.txt (100%) rename {external => tools/external}/wabt/test/spec/nop.txt (100%) rename {external => tools/external}/wabt/test/spec/resizing.txt (100%) rename {external => tools/external}/wabt/test/spec/return.txt (100%) rename {external => tools/external}/wabt/test/spec/select.txt (100%) rename {external => tools/external}/wabt/test/spec/set_local.txt (100%) rename {external => tools/external}/wabt/test/spec/skip-stack-guard-page.txt (100%) rename {external => tools/external}/wabt/test/spec/stack.txt (100%) rename {external => tools/external}/wabt/test/spec/start.txt (100%) rename {external => tools/external}/wabt/test/spec/store_retval.txt (100%) rename {external => tools/external}/wabt/test/spec/switch.txt (100%) rename {external => tools/external}/wabt/test/spec/tee_local.txt (100%) rename {external => tools/external}/wabt/test/spec/token.txt (100%) rename {external => tools/external}/wabt/test/spec/traps.txt (100%) rename {external => tools/external}/wabt/test/spec/type.txt (100%) rename {external => tools/external}/wabt/test/spec/typecheck.txt (100%) rename {external => tools/external}/wabt/test/spec/unreachable.txt (100%) rename {external => tools/external}/wabt/test/spec/unreached-invalid.txt (100%) rename {external => tools/external}/wabt/test/spec/unwind.txt (100%) rename {external => tools/external}/wabt/test/spec/utf8-custom-section-id.txt (100%) rename {external => tools/external}/wabt/test/spec/utf8-import-field.txt (100%) rename {external => tools/external}/wabt/test/spec/utf8-import-module.txt (100%) rename {external => tools/external}/wabt/test/spec/utf8-invalid-encoding.txt (100%) rename {external => tools/external}/wabt/test/too-many-arguments.txt (100%) rename {external => tools/external}/wabt/test/two-commands.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-assertreturn-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-atomic-no-shared-memory.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-atomic-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-binary-type-mismatch-1.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-binary-type-mismatch-2.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-block-multi-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-brtable-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-call-result-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-call-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-callimport-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-callindirect-func-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-callindirect-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-cast-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-compare-type-mismatch-1.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-compare-type-mismatch-2.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-convert-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-expr-if.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-function-result-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-global-getglobal-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-global-no-init-expr.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-global-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-grow-memory-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-if-condition-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-if-multi-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-if-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-if-value-void.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-invoke-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-load-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-loop-multi-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-nested-br.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-no-shared-memory.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-return-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-select-cond.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-select-value0.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-select-value1.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-setlocal-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-simd-lane.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-store-index-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/bad-unary-type-mismatch.txt (100%) rename {external => tools/external}/wabt/test/typecheck/br-multi.txt (100%) rename {external => tools/external}/wabt/test/typecheck/br-table-loop.txt (100%) rename {external => tools/external}/wabt/test/typecheck/brif-multi.txt (100%) rename {external => tools/external}/wabt/test/typecheck/brtable-multi.txt (100%) rename {external => tools/external}/wabt/test/typecheck/if-then-br.txt (100%) rename {external => tools/external}/wabt/test/typecheck/if-value.txt (100%) rename {external => tools/external}/wabt/test/typecheck/label-redefinition.txt (100%) rename {external => tools/external}/wabt/test/typecheck/nested-br.txt (100%) rename {external => tools/external}/wabt/test/typecheck/nocheck.txt (100%) rename {external => tools/external}/wabt/test/typecheck/return-drop-value-2.txt (100%) rename {external => tools/external}/wabt/test/typecheck/return-drop-value.txt (100%) rename {external => tools/external}/wabt/test/typecheck/return-value.txt (100%) rename {external => tools/external}/wabt/test/update-spec-tests.py (100%) rename {external => tools/external}/wabt/test/utils.py (100%) rename {external => tools/external}/wabt/test/wasm2c/bad-enable-feature.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/address.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/align.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/binary.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/block.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/br.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/br_if.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/br_table.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/break-drop.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/call.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/call_indirect.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/comments.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/const.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/conversions.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/custom_section.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/endianness.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/exports.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/f32.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/f32_bitwise.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/f32_cmp.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/f64.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/f64_bitwise.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/f64_cmp.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/fac.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/float_exprs.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/float_literals.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/float_memory.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/float_misc.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/forward.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/func.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/func_ptrs.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/get_local.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/globals.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/i32.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/i64.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/if.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/imports.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/inline-module.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/int_exprs.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/int_literals.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/labels.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/left-to-right.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/linking.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/loop.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/memory.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/memory_redundancy.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/memory_trap.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/names.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/nop.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/resizing.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/return.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/select.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/set_local.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/skip-stack-guard-page.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/stack.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/start.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/store_retval.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/switch.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/tee_local.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/token.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/traps.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/type.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/typecheck.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/unreachable.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/unreached-invalid.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/unwind.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/utf8-custom-section-id.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/utf8-import-field.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/utf8-import-module.txt (100%) rename {external => tools/external}/wabt/test/wasm2c/spec/utf8-invalid-encoding.txt (100%) rename {external => tools/external}/wabt/ubsan.blacklist (100%) rename {external => tools/external}/wabt/wasm2c/README.md (100%) rename {external => tools/external}/wabt/wasm2c/examples/fac/fac.c (100%) rename {external => tools/external}/wabt/wasm2c/examples/fac/fac.h (100%) rename {external => tools/external}/wabt/wasm2c/examples/fac/fac.wasm (100%) rename {external => tools/external}/wabt/wasm2c/examples/fac/fac.wat (100%) rename {external => tools/external}/wabt/wasm2c/examples/fac/main.c (100%) rename {external => tools/external}/wabt/wasm2c/wasm-rt-impl.c (100%) rename {external => tools/external}/wabt/wasm2c/wasm-rt-impl.h (100%) rename {external => tools/external}/wabt/wasm2c/wasm-rt.h (100%) create mode 100644 tools/init/CMakeLists.txt create mode 100644 tools/init/eosio-init.cpp diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml new file mode 100644 index 0000000000..9c79580728 --- /dev/null +++ b/.buildkite/pipeline.yml @@ -0,0 +1,214 @@ +steps: + - command: | + echo "+++ :hammer: Building" && \ + echo 1 | ./build.sh && \ + echo "--- Compressing build directory :compression:" && \ + tar -pczf build.tar.gz build/ + artifact_paths: "build.tar.gz" + label: ":darwin: High Sierra Build" + agents: + role: "macos-builder" + os: "high-sierra" + timeout: 120 + + - command: | + echo "+++ :hammer: Building" && \ + echo 1 | ./build.sh && \ + echo "--- Compressing build directory :compression:" && \ + tar -pczf build.tar.gz build/ + artifact_paths: "build.tar.gz" + label: ":darwin: Mojave Build" + agents: + role: "builder" + os: "mojave" + timeout: 120 + + - command: | + echo "+++ :hammer: Building" && \ + echo 1 | ./build.sh && \ + echo "--- Compressing build directory :compression:" && \ + tar -pczf build.tar.gz build/ + artifact_paths: "build.tar.gz" + label: ":ubuntu: 18.04 Build" + agents: + queue: "automation-large-builder-fleet" + plugins: + docker#v2.0.0: + image: "eosio/ci:ubuntu18" + workdir: /data/job + timeout: 120 + + - command: | + echo "+++ :hammer: Building" && \ + echo 1 | ./build.sh && \ + echo "--- Compressing build directory :compression:" && \ + tar -pczf build.tar.gz build/ + artifact_paths: "build.tar.gz" + label: ":fedora: Build" + agents: + queue: "automation-large-builder-fleet" + plugins: + docker#v2.0.0: + image: "eosio/ci:fedora" + workdir: /data/job + timeout: 120 + + - command: | + echo "+++ :hammer: Building" && \ + echo 1 | ./build.sh && \ + echo "--- Compressing build directory :compression:" && \ + tar -pczf build.tar.gz build/ + artifact_paths: "build.tar.gz" + label: ":centos: Build" + agents: + queue: "automation-large-builder-fleet" + plugins: + docker#v2.0.0: + image: "eosio/ci:centos" + workdir: /data/job + timeout: 120 + + - command: | + echo "+++ :hammer: Building" && \ + echo 1 | ./build.sh && \ + echo "--- Compressing build directory :compression:" && \ + tar -pczf build.tar.gz build/ + artifact_paths: "build.tar.gz" + label: ":aws: Build" + agents: + queue: "automation-large-builder-fleet" + plugins: + docker#v2.0.0: + image: "eosio/ci:amazonlinux" + workdir: /data/job + timeout: 120 + + - wait + + - command: | + echo "--- :arrow_down: Downloading build directory" && \ + buildkite-agent artifact download "build.tar.gz" . --step ":darwin: High Sierra Build" && \ + tar -zxf build.tar.gz && \ + echo "+++ :package: Starting package build" && \ + ln -s "$(pwd)" /data/job && cd /data/job/build/packages && bash generate_package.sh brew + label: ":darwin: High Sierra Package Builder" + agents: + role: "macos-builder" + os: "high-sierra" + artifact_paths: + - "build/packages/*.tar.gz" + timeout: 15 + + - command: | + echo "--- :arrow_down: Downloading build directory" && \ + buildkite-agent artifact download "build.tar.gz" . --step ":darwin: Mojave Build" && \ + tar -zxf build.tar.gz && \ + echo "+++ :package: Starting package build" && \ + ln -s "$(pwd)" /data/job && cd /data/job/build/packages && bash generate_package.sh brew + label: ":darwin: Mojave Package Builder" + agents: + role: "builder" + os: "mojave" + artifact_paths: + - "build/packages/*.tar.gz" + timeout: 15 + + - command: | + echo "--- :arrow_down: Downloading build directory" && \ + buildkite-agent artifact download "build.tar.gz" . --step ":ubuntu: 18.04 Build" && \ + tar -zxf build.tar.gz && \ + echo "+++ :package: Starting package build" && \ + cd /data/job/build/packages && bash generate_package.sh deb + label: ":ubuntu: 18.04 Package builder" + agents: + queue: "automation-large-builder-fleet" + artifact_paths: + - "build/packages/*.deb" + plugins: + docker#v1.4.0: + image: "eosio/ci:ubuntu18" + workdir: /data/job + env: + OS: "ubuntu-18.04" + PKGTYPE: "deb" + timeout: 15 + + - command: | + echo "--- :arrow_down: Downloading build directory" && \ + buildkite-agent artifact download "build.tar.gz" . --step ":fedora: Build" && \ + tar -zxf build.tar.gz && \ + echo "+++ :package: Starting package build" && \ + yum install -y rpm-build && \ + mkdir -p /root/rpmbuild/BUILD && \ + mkdir -p /root/rpmbuild/BUILDROOT && \ + mkdir -p /root/rpmbuild/RPMS && \ + mkdir -p /root/rpmbuild/SOURCES && \ + mkdir -p /root/rpmbuild/SPECS && \ + mkdir -p /root/rpmbuild/SRPMS && \ + cd /data/job/build/packages && bash generate_package.sh rpm + label: ":fedora: Package builder" + agents: + queue: "automation-large-builder-fleet" + artifact_paths: + - "build/packages/x86_64/*.rpm" + plugins: + docker#v1.4.0: + image: "eosio/ci:fedora" + workdir: /data/job + env: + OS: "fedora" + PKGTYPE: "rpm" + timeout: 15 + + - command: | + echo "--- :arrow_down: Downloading build directory" && \ + buildkite-agent artifact download "build.tar.gz" . --step ":centos: Build" && \ + tar -zxf build.tar.gz && \ + echo "+++ :package: Starting package build" && \ + yum install -y rpm-build && \ + mkdir -p /root/rpmbuild/BUILD && \ + mkdir -p /root/rpmbuild/BUILDROOT && \ + mkdir -p /root/rpmbuild/RPMS && \ + mkdir -p /root/rpmbuild/SOURCES && \ + mkdir -p /root/rpmbuild/SPECS && \ + mkdir -p /root/rpmbuild/SRPMS && \ + cd /data/job/build/packages && bash generate_package.sh rpm + label: ":centos: Package builder" + agents: + queue: "automation-large-builder-fleet" + artifact_paths: + - "build/packages/x86_64/*.rpm" + plugins: + docker#v1.4.0: + image: "eosio/ci:centos" + workdir: /data/job + env: + OS: "centos" + PKGTYPE: "rpm" + timeout: 15 + + - wait + + - command: | + echo "--- :arrow_down: Downloading package" && \ + buildkite-agent artifact download "build/packages/*.deb" docker/dev/. --step ":ubuntu: 18.04 Package builder" && \ + echo "--- :key: AUTHENTICATING GOOGLE SERVICE ACCOUNT" && \ + gcloud --quiet auth activate-service-account b1-automation-svc@b1-automation-dev.iam.gserviceaccount.com --key-file=/etc/gcp-service-account.json && \ + docker-credential-gcr configure-docker && \ + echo "--- :hammer_and_wrench: BUILDING BUILD IMAGE" && \ + cd docker/dev && \ + docker build -t eosio/cdt:latest -t eosio/cdt:$BUILDKITE_COMMIT . && \ + docker tag eosio/cdt:$BUILDKITE_COMMIT gcr.io/b1-automation-dev/eosio/cdt:$BUILDKITE_COMMIT && \ + docker tag eosio/cdt:latest gcr.io/b1-automation-dev/eosio/cdt:latest && \ + echo "--- :hand: PUSHING DOCKER IMAGES" && \ + docker push gcr.io/b1-automation-dev/eosio/cdt:$BUILDKITE_COMMIT && \ + docker push gcr.io/b1-automation-dev/eosio/cdt:latest && \ + echo "--- :thought_balloon: TRASHING OLD IMAGES" && \ + docker rmi eosio/cdt:$BUILDKITE_COMMIT && \ + docker rmi eosio/cdt:latest && \ + docker rmi gcr.io/b1-automation-dev/eosio/cdt:$BUILDKITE_COMMIT && \ + docker rmi gcr.io/b1-automation-dev/eosio/cdt:latest + label: "Docker build builder" + agents: + queue: "automation-docker-builder-fleet" + timeout: 300 \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 39be7bc0f5..9b0f8369c1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,3 +9,6 @@ [submodule "eosio_llvm"] path = eosio_llvm url = https://github.com/eosio/llvm +[submodule "libraries/native/softfloat"] + path = libraries/native/softfloat + url = https://github.com/EOSIO/berkeley-softfloat-3.git diff --git a/CMakeLists.txt b/CMakeLists.txt index ca7d62a69e..e2371806e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,31 @@ cmake_minimum_required(VERSION 3.5) project(eosio_cdt) +find_program(SCCACHE_FOUND sccache) +if (SCCACHE_FOUND) + message(STATUS "Using sccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE sccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK sccache) +else() + find_program(CCACHE_FOUND ccache) + if (CCACHE_FOUND) + message(STATUS "Using ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + endif() +endif() + + set(VERSION_MAJOR 2) set(VERSION_MINOR 0) -set(VERSION_PATCH 1) +set(VERSION_PATCH 2) +#set(VERSION_SUFFIX ) + +if (VERSION_SUFFIX) + set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}") +else() + set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}") +endif() if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) message(WARNING "CMAKE_INSTALL_PREFIX is set to default path of ${CMAKE_INSTALL_PREFIX}, resetting to ${CMAKE_INSTALL_PREFIX}/eosio.cdt") @@ -14,41 +36,41 @@ endif() include(GNUInstallDirs) -include(ClangExternalProject.txt) -include(ToolsExternalProject.txt) - -add_subdirectory(external) +include(modules/ClangExternalProject.txt) +include(modules/ToolsExternalProject.txt) set(WASM_SDK_BUILD true) ### Configure the EosioWasmToolchain.cmakes set(CDT_ROOT_DIR ${CMAKE_BINARY_DIR}) configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/eosio.cdt-config.cmake @ONLY) +configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioCDTMacros.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake @ONLY) set(CDT_ROOT_DIR ${CMAKE_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio.cdt) +install(FILES ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) +configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}/cmake/eosio.cdt) +install(FILES ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchain.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) +install(FILES ${CMAKE_BINARY_DIR}/modules/EosioCDTMacros.cmake DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/cmake/eosio.cdt) set(CDT_ROOT_DIR "_PREFIX_") +configure_file(${CMAKE_SOURCE_DIR}/modules/EosioCDTMacros.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioCDTMacrosPackage.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/EosioWasmToolchain.cmake.in ${CMAKE_BINARY_DIR}/modules/EosioWasmToolchainPackage.cmake @ONLY) configure_file(${CMAKE_SOURCE_DIR}/modules/eosio.cdt-config.cmake ${CMAKE_BINARY_DIR}/modules/eosio.cdt-config.cmake.package @ONLY) -list(APPEND CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt") -include(EosioWasmToolchain) - -add_subdirectory(libraries) +include(modules/LibrariesExternalProject.txt) -include(InstallClang.txt) +include(modules/InstallCDT.cmake) -configure_file(${CMAKE_SOURCE_DIR}/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.imports COPYONLY) +configure_file(${CMAKE_SOURCE_DIR}/imports/eosio.imports.in ${CMAKE_BINARY_DIR}/eosio.imports COPYONLY) install(FILES ${CMAKE_BINARY_DIR}/eosio.imports DESTINATION ${CMAKE_INSTALL_PREFIX}) configure_file(${CMAKE_SOURCE_DIR}/scripts/ricardeos/ricardeos.py ${CMAKE_BINARY_DIR}/scripts/ricardeos.py COPYONLY) install(FILES ${CMAKE_BINARY_DIR}/scripts/ricardeos.py DESTINATION ${CMAKE_INSTALL_PREFIX}/scripts) +# section for package construction set(VENDOR "boscore.io") set(PROJECT_NAME "eosio.cdt") set(DESC "Toolchain and supporting tools for the EOS.IO platform") @@ -63,6 +85,12 @@ configure_file(${CMAKE_SOURCE_DIR}/scripts/generate_tarball.sh ${CMAKE_BINARY_DI # add licenses configure_file(${CMAKE_SOURCE_DIR}/eosio_llvm/LICENSE.TXT ${CMAKE_BINARY_DIR}/licenses/llvm.license COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/libraries/boost/boost.license ${CMAKE_BINARY_DIR}/licenses/boost.license COPYONLY) -configure_file(${CMAKE_SOURCE_DIR}/external/wabt/LICENSE ${CMAKE_BINARY_DIR}/licenses/wabt.license COPYONLY) +configure_file(${CMAKE_SOURCE_DIR}/tools/external/wabt/LICENSE ${CMAKE_BINARY_DIR}/licenses/wabt.license COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/tools/jsoncons/LICENSE ${CMAKE_BINARY_DIR}/licenses/jsoncons.license COPYONLY) configure_file(${CMAKE_SOURCE_DIR}/LICENSE ${CMAKE_BINARY_DIR}/licenses/eosio.cdt.license COPYONLY) + +include(modules/TestsExternalProject.txt) + +include(CTest) +enable_testing() +add_subdirectory(tests) diff --git a/LICENSE b/LICENSE index 55e80764e3..1516b96cbd 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2018, Respective Authors all rights reserved. +Copyright (c) 2019 Respective Authors all rights reserved. The MIT License diff --git a/README.md b/README.md index 51c94d5cf8..ac30f61887 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,12 @@ # BOSCore.CDT (Contract Development Toolkit) ## BOSCore.CDT Version: v2.0.1 -### Basic EOSIO.CDT Version: 1.4.1 +## Basic EOSIO.CDT Version: 1.5.0 + +## Use BOSCore CDT docker image to build smart conrtacts + +**In order to speed up the progress of contracts development, BOSCore supply complied docker image.** +**By CDT docker image, you can start build you contracts without build BOSCore.CDT firstly. Please check [README](docker/README.md).** + EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that EOSIO.CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. @@ -12,269 +18,63 @@ EOSIO.CDT currently supports Mac OS X brew, Linux x86_64 Debian packages, and Li **If you have previously installed EOSIO.CDT, please run the `uninstall` script (it is in the directory where you cloned EOSIO.CDT) before downloading and using the binary releases.** - -### Guided Installation (Building from Scratch) +#### Mac OS X Brew Install ```sh -$ git clone --recursive https://github.com/boscore/bos.cdt -$ cd bos.cdt -$ ./build.sh -$ sudo ./install.sh +$ brew tap eosio/eosio.cdt +$ brew install eosio.cdt ``` -### Building your first smart contract -- Navigate to the hello folder in examples (./examples/hello). -- You should then see the hello.cpp file -- Now run the compiler +#### Mac OS X Brew Uninstall ```sh -$ eosio-cpp -abigen hello.cpp -o hello.wasm +$ brew remove eosio.cdt ``` -- Or with CMake +#### Debian Package Install ```sh -$ mkdir build -$ cd build -$ cmake .. -$ make +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1_amd64.deb +$ sudo apt install ./eosio.cdt-1.5.0-1_amd64.deb ``` -This will generate two files: -* The compiled binary wasm (hello.wasm) -* The generated ABI file (hello.abi) - -#### using eosio-abigen alone -To generate an ABI with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `--output` and generating against the contract name `--contract`. - -Example: -```bash -$ eosio-abigen hello.cpp --contract=hello --output=hello.abi +#### Debian Package Uninstall +```sh +$ sudo apt remove eosio.cdt ``` -This will generate one file: -* The generated ABI file (hello.abi) - -## Differences between Version 1.2.x and Version 1.3.x - -### eosiolib C API -- Removed the following typedefs to `uint64_t`: - - `account_name` - - `permission_name` - - `scope_name` - - `table_name` - - `action_name` -- Added a `uint64_t` typedef called `capi_name` to replace the removed typedefs above: - - These have been replaced by `capi_name` and as a practice should not be used when writing C++ contract code. Instead, the new version of the `eosio::name` type from the eosiolib C++ API should be used to replace these instances. This decision was made because of bad implicit casting issues with `uint64_t` and the new pattern should allow for better type safety. -- Removed `symbol_name` typedef: - - This has no C equivalent to replace it. When writing C++ contract code, the `eosio::symbol_code` struct should be used instead. As with the previously mentioned named types, this was removed and replaced with `eosio::symbol_code` to allow for better type safety in contracts. To use a symbol, i.e. symbol name and precision, use the `eosio::symbol` class. -- Removed `time` and `weight_type` typedefs. -- Removed the `transaction_id_type` and `block_id_type` typedefs. -- Removed the `account_permission` struct. -- Renamed the following typedefs: - - `checksum160` -> `capi_checksum160` - - `checksum256` -> `capi_checksum256` - - `checksum512` -> `capi_checksum512` - - `public_key` -> `capi_public_key` - - `signature` -> `capi_signature` -- Removed the non-existent intrinsics declarations `require_write_lock` and `require_read_lock`. - -### eosiolib C++ API -- Removed eosiolib/vector.hpp: - - Removed alias `eosio::vector` and typedef `bytes`. - - Going forward contract writers should include `` from the STL and use `std::vector` instead of bytes. -- Removed eosiolib/types.hpp. -- Removed eosiolib/optional.hpp. Use `std::optional` as a replacement. -- Removed eosiolib/core_symbol.hpp. The contract writer should explicitly specify the symbol. -- Added eosiolib/name.hpp. - -#### eosiolib/types.hpp -- Moved the typedef `eosio::extensions_types` to eosiolib/transaction.hpp. -- Removed comparison functions for `checksum` structs. -- Removal of `eosio::char_to_symbol`, `eosio::string_to_name`, `eosio::name_suffix` functions -- Removal of the `N` macro. The `""_n` operator or the `name` constructor should be used as a type safe replacement. Example: `N(foo)` -> `"foo"_n`, or `N(foo)` -> `name("foo")`. -- Moved `eosio::name` struct definition and `""_n` operator to eosiolib/name.hpp. - -#### eosiolib/name.hpp -- Removed implicit and explicit conversions to `uint64_t`. -- Added `enum class` `eosio::name::raw` which is implicitly converted from an `eosio::name` (used for template non-type parameters). -- Added `bool` conversion operator for conditionally testing if a name is empty. -- All constructors are now `constexpr`. These take either a `uint64_t`, an `eosio::name::raw` or a `std::string_view`. -- Added `constexpr` methods `eosio::name::length` and `eosio::name::suffix`. -- Added equivalence, inverted equivalence and less than operators to `eosio::name`. - -#### eosiolib/symbol.hpp -- Removed `eosio::symbol_type` struct and replaced with `eosio::symbol` class. -- Added struct `eosio::symbol_code`: - - Added two `constexpr` constructors that take either a raw `uint64_t` or an `std::string_view`. - - Added `constexpr` methods `is_valid`, `length` and `raw`. - - Added a print method. - - Added `bool` conversion operator to test is `symbol_code` is empty. -- Removed `eosio::string_to_symbol`, `eosio::is_valid_symbol`, `eosio::symbol_name_length` functions. -- Removed the `S` macro. The symbol constructor should be used as a type safe replacement. Example: `S(4,SYS)` -> `symbol(symbol_code("SYS"), 4)` (or simply `symbol("SYS", 4)` as of v1.3.1). -- Added struct `eosio::symbol`: - - Added three `constexpr` constructors that take either a raw `uint64_t`, `symbol_code` and a `uint8_t` precision or an `std::string_view` and a `uint8_t` precision. - - Added `constexpr` methods `is_valid`, `precision`, `code`, and `raw`. These, respectively, check if the `symbol` is valid, get the `uint8_t` precision, get the `symbol_code` part of the `symbol`, and get the raw `uint64_t` representation of `symbol`. - - Added equivalence, inverted equivalence and less than operators to `eosio::symbol`. -- Modified struct `eosio::extended_symbol`: - - Restricted fields to private. - - Added `constexpr` constructor that takes a `eosio::symbol` and an `eosio::name`. - - Added `constexpr` methods `get_symbol` and `get_contract`. - - Made existing comparison operators `constexpr`. - -#### eosiolib/asset.hpp -- The main constructor now requires a `int64_t` (quantity) and `eosio::symbol` explicitly. -- The default constructor no longer initializes the instance to a valid zero quantity asset with a symbol equivalent to "core symbol". Instead the default constructed `eosio::asset` is a bit representation of all zeros (which will cause `is_valid` to fail) so that check is bypassed to allow for `multi_index` and `datastream` to work. -- Old contracts that use `eosio::asset()` should be changed to either use the core symbol of the specific chain they are targeting i.e. `eosio::asset(0, symbol(symbol_code("SYS"),4))`. To reduce writing `symbol(symbol_code("SYS"),4)` over and over, a `constexpr` function to return the symbol or `constexpr` global variable should be used. - -#### eosiolib/contract.hpp -- The constructor for `eosio::contract` now takes an `eosio::name` for the receiver, an `eosio::name` for the code, and a `eosio::datastream` for the datastream used for the contract. The last argument is for manually unpacking an action, see the section on `eosio::ignore` for a more indepth usage. - -#### eosiolib/dispatcher.hpp -- Renamed the macro `EOSIO_ABI` to `EOSIO_DISPATCH` as this is more descriptive of what this macro actually does. -- Modified the definition of `EOSIO_DISPATCH` to work with the new constructor for `eosio::contract`. - -#### eosiolib/multi_index.hpp -- The first template parameter for `indexed_by` now requires the argument be convertible to `eosio::name::raw` (replacing `uint64_t`). -- The first template parameter for `multi_index` now requires the argument be convertible to `eosio::name::raw` (replacing `uint64_t`). -- The constructor now takes an `eosio::name` type for the code (replacing `uint64_t`). Scope is still `uint64_t`. -- Various other replacements of `uint64_t` to `eosio::name`. - -#### eosiolib/singleton.hpp -- The first template parameter for `eosio::singleton` now requires the argument be convertible to `eosio::name::raw` (replacing `uint64_t`). -- The constructor now takes an `eosio::name` type for the code. -- In the methods `get_or_create` and `set`, the argument `bill_to_account` is now of type `eosio::name` (replacing `uint64_t`). - -#### eosiolib/action.hpp -- Added C++ function `eosio::require_auth`. -- Added C++ function `eosio::has_auth`. -- Added C++ function `eosio::is_account`. -- Redefined `eosio::permission_level` to use `eosio::name` in place of `uint64_t`. -- Removed the macro `ACTION`. (The identifier `ACTION` has been reused for another macro described below in the Macros section.) - -#### eosiolib/permission.hpp - - The optional provided_keys argument of the function `eosio::check_transaction_authorization` is now of the type `std::set` rather than the type `std::set`. C++ contract code should most likely be using the `eosio::public_key` struct (defined in "eosiolib/public_key.hpp") if they need to deal with EOSIO-compatible public keys rather than the `capi_public_key` struct (now renamed from its original name of `::public_key`) from the eosiolib C API. Note that existing contract code that just referred to the type `public_key` without namespace qualification may have accidentally been using the `capi_public_key` struct and therefore should ideally be modified to use the `eosio::public_key` C++ type. - - The `account` and `permission` arguments of `eosio::check_transaction_authorization` are both `eosio::name` now instead of `uint64_t`. - -#### eosiolib/ignore.hpp -- Added new type `ignore`: - - This type acts as a placeholder for actions that don't want to deserialize their fields but want the types to be reflected in the ABI. - ```c - ACTION action(ignore) { some_type st; _ds >> st; } - ``` -- Added new type `ignore_wrapper`: - - This allows for calling `SEND_INLINE_ACTION` with `ignore_wrapper(some_value)` against an action with an `ignore` of matching types. - -### Macros -- Added `ACTION` macro which is simply a shortcut for `[[eosio::action]] void`. -- Added `TABLE` macro which is simply a shortcut for `struct [[eosio::table]]`. -- Added `CONTRACT` macro which is simply a shortcut for `class [[eosio::contract]]`. - -### CMake -- Added `eosio.cdt-config.cmake` to allow for `find_package(eosio.cdt)`. See eosio.cdt/examples/hello or eosio.cdt/examples/template for an example. -- Added new macro `add_contract`. This new contract takes a contract name, cmake target, then any normal arguments you would give to `add_executable`. See eosio.cdt/examples/hello or eosio.cdt/examples/template. -- New version checking mechanism is included. See eosio.contracts/CMakeLists.txt to see this in use. - -### libc -- Replaced `printf`, `sprintf`, and `snprintf` with new minimal variants. This allows contracts to use these functions without causing stack overflow issues. - -### libcxx -- Removed `sstream` with the intent to return this after more has been done. -- Added `__cxa_pure_virtual` to allow for pure virtual methods in contract classes. -- `std::to_string` now works without the issues of stack overflows. - -### attributes -- Added `[[eosio::ignore]]` attribute to flag a type as being ignored by the deserializer. This attribute is primarily only used for internal use within eosiolib. -- Added `[[eosio::contract]]` attribute. This new attribute is used to mark a contract class as "contract" with the name being either the C++ name of the class or a user specified name (i.e. `[[eosio::contract("somecontract")]]`). This attribute can also be used in conjunction with the `eosio::action` and `eosio::table` attributes for tables that you would like to define outside of the `eosio::contract` class. This is used in conjunction with either the raw `eosio-cpp` option `--contract `, `-o .wasm` or with CMake `add_contract`. It acts as a filter enabling contract developers to include a header file with attributes from another contract (e.g. eosio.token) while generating an ABI devoid of those actions and tables. - ```c++ - #include - using namespace eosio; - CONTRACT test : public eosio::contract { - public: - using contract::contract; - ACTION acta(){} - TABLE taba { - uint64_t a; - float b; - uint64_t primary_key() const { return a; } - }; - }; - struct [[eosio::table, eosio::contract("test")]] - tabb { - uint64_t a; - int b; - }; - typedef eosio::multi_index<"testtaba"_n, test::taba> table_a; - typedef eosio::multi_index<"testtabb"_n, tabb> table_b; - EOSIO_DISPATCH( test, (acta) ) - ``` - The above code will produce the tables `testtaba` and `testtabb` in your ABI. Example: `eosio-cpp -abigen test.cpp -o test.wasm` will mark this compilation and ABI generation for the `eosio::contract` `test`. The same thing can be done with `eosio-cpp -abigen test.cpp -o test_contract.wasm --contract test` or with the CMake command `add_contract( test, test_contract, test.cpp )`. Either of the previous two approaches will produce a test_contract.wasm and test_contract.abi generated under the context of the contract name of `test`. - -### Boost -- Boost is now part of the library. No more external dependence on Boost and all system inclusion are within it's `sysroot`. (Boost will be removed in a future release.) - - -## ABI generator attributes -Unlike the old ABI generator tool, the new tool uses C++11 or GNU style attributes to mark ```actions``` and ```tables```. -#### [[eosio::action]] -This attribute marks either a struct or a method as an action. -Example (four ways to declare an action for ABI generation): -```c++ -// this is the C++11 and greater style attribute -[[eosio::action]] -void testa( name n ) { - // do something -} - -// this is the GNU style attribute, this can be used in C code and prior to C++ 11 -__attribute__((eosio_action)) -void testa( name n ){ - // do something -} - -struct [[eosio::action]] testa { - name n; - EOSLIB_SERIALIZE( testa, (n) ) -}; - -struct __attribute__((eosio_action)) testa { - name n; - EOSLIB_SERIALIZE( testa, (n) ) -}; +#### Fedora RPM Package Install +```sh +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1.fc27.x86_64.rpm +$ sudo yum install ./eosio.cdt-1.5.0-1.fc27.x86_64.rpm ``` -If your action name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::action("")]]``` -Example (two ways to declare a table for ABI generation): -```c++ -struct [[eosio::table]] testtable { - uint64_t owner; - /* all other fields */ -}; - -struct __attribute__((eosio_table)) testtable { - uint64_t owner; - /* all other fields */ -}; +#### Fedora RPM Package Uninstall +```sh +$ sudo yum remove eosio.cdt +``` -typedef eosio::multi_index<"tablename"_n, testtable> testtable_t; +#### Centos RPM Package Install +```sh +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1.el7.x86_64.rpm +$ sudo yum install ./eosio.cdt-1.5.0-1.el7.x86_64.rpm ``` -If you don't want to use the multi-index you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]```. -For an example contract of ABI generation please see the file ./examples/abigen_test/test.cpp. You can generate the ABI for this file with `eosio-abigen test.cpp --output=test.abi`. +#### Centos RPM Package Uninstall +```sh +$ sudo yum remove eosio.cdt +``` -### Fixing an ABI or Writing an ABI Manually -- The sections to the ABI are pretty simple to understand and the syntax is purely JSON, so it is reasonable to write an ABI file manually. -- The ABI generation will never be completely perfect for every contract written. Advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions. So having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. -- Please refer to [developers.eos.io "How to Write an ABI File"](https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi) to learn about the different sections of an ABI. +### Guided Installation (Building from Scratch) +```sh +$ git clone --recursive https://github.com/boscore/bos.cdt +$ cd bos.cdt +$ ./build.sh +$ sudo ./install.sh +``` -### Adding Ricardian Contracts and Clauses to ABI -- As of EOSIO.CDT v1.4.0 the ABI generator will try to automatically import contracts and clauses into the generated ABI. There are a few caveats to this, one is a strict naming policy of the files and an HTML tag used to mark each Ricardian contract and each clause. -- The Ricardian contracts should be housed in a file with the name .contracts.md and the clauses should be in a file named .clauses.md. - - For each Ricardian contract the header `

ActionName

` should be used, as this directs the ABI generator to attach this Ricardian contract to the specified action. - - For each Ricardian clause the header `

ClauseID

` should be used, as this directs the ABI generator to the clause id and the subsequent body. - - The option `-R` has been added to eosio-cpp and eosio-abigen to add "resource" paths to search from, so you can place these files in any directory structure you like and use `-R` in the same vein as `-I` for include paths. - - To see these in use please see ./examples/hello/hello.contracts.md and ./examples/hello/hello.clauses.md. - ### Installed Tools --- -* [eosio-cpp](#eosio-cpp) -* [eosio-cc](#eosio-cc) -* [eosio-ld](#eosio-ld) +* eosio-cpp +* eosio-cc +* eosio-ld +* eosio-init * eosio-abigen +* eosio-abidiff * eosio-pp (post processing pass for WASM, automatically runs with eosio-cpp and eosio-ld) * eosio-wasm2wast * eosio-wast2wasm @@ -282,146 +82,3 @@ For an example contract of ABI generation please see the file ./examples/abigen_ * eosio-ar * eosio-objdump * eosio-readelf - -### Usage ---- -To compile an EOSIO smart contract, the preferred method is to use the template CMakeLists.txt in the examples folder. - - -For example: - -In `CMakeLists.txt`: -``` -cmake_minimum_required(VERSION 3.5) -project(test_example VERSION 1.0.0) - -find_package(eosio.cdt) - -add_contract( test test test.cpp ) -``` - - -In `test.cpp`: - -``` -#include -using namespace eosio; - -CONTRACT test : public eosio::contract { -public: - using contract::contract; - - ACTION testact( name test ) { - } -}; - -EOSIO_DISPATCH( test, (testact) ) -``` - -To manually compile the source code, use `eosio-cpp/eosio-cc` and `eosio-ld` as if it were __clang__ and __lld__. All the includes and options specific to EOSIO and CDT are baked in. - -### eosio-cpp ---- -```bash -OVERVIEW: eosio-cpp (Eosio C++ -> WebAssembly compiler) -USAGE: eosio-cpp [options] ... - -OPTIONS: - -C - Include comments in preprocessed output - -CC - Include comments from within macros in preprocessed output - -D= - Define to (or 1 if omitted) - -E - Only run the preprocessor - -I= - Add directory to include search path - -L= - Add directory to library search path - -O= - Optimization level s, 0-3 - -S - Only run preprocess and compilation steps - -U= - Undefine macro - -W= - Enable the specified warning - -c - Only run preprocess, compile, and assemble steps - -dD - Print macro definitions in -E mode in addition to normal output - -dI - Print include directives in -E mode in addition to normal outpu - -dM - Print macro definitions in -E mode instead to normal output - -emit-ast - Emit Clang AST files for source inputs - -emit-llvm - Use the LLVM representation for assembler and object files - -faligned-allocation - Enable C++17 aligned allocation functions - -fcoroutine-ts - Enable support for the C++ Coroutines TS - -finline-functions - Inline suitable functions - -finline-hint-functions - Inline functions which are (explicitly or implicitly) marked inline - -fmerge-all-constants - Allow merging of constants - -fno-cfl-aa - Disable CFL Alias Analysis - -fno-elide-constructors - Disable C++ copy constructor elision - -fno-lto - Disable LTO - -fstack-protector - Enable stack protectors for functions potentially vulnerable to stack smashing - -fstack-protector-all - Force the usage of stack protectors for all functions - -fstack-protector-strong - Use a strong heuristic to apply stack protectors to functions - -fstrict-enums - Enable optimizations based on the strict definition of an enum's value range - -fstrict-return - Always treat control flow paths that fall off the end of a non-void function as unreachable - -fstrict-vtable-pointers - Enable optimizations based on the strict rules for overwriting polymorphic C++ objects - -include= - Include file before parsing - -isysroot= - Set the system root directory (usually /) - -l= - Root name of library to link - -lto-opt= - LTO Optimization level (O0-O3) - -o= - Write output to - -std= - Language standard to compile for - -v - Show commands to run and use verbose output - -w - Suppress all warnings - -Generic Options: - - -help - Display available options (-help-hidden for more) - -help-list - Display list of available options (-help-list-hidden for more) - -version - Display the version of this program -``` - -### eosio-ld ---- -```bash -OVERVIEW: eosio-ld (WebAssembly linker) -USAGE: eosio-ld [options] ... - -OPTIONS: - -Generic Options: - - -help - Display available options (-help-hidden for more) - -help-list - Display list of available options (-help-list-hidden for more) - -version - Display the version of this program - -eosio.ld options: - - -L= - Add directory to library search path - -fno-cfl-aa - Disable CFL Alias Analysis - -fno-lto - Disable LTO - -fno-post-pass - Don't run post processing pass - -fno-stack-first - Don't set the stack first in memory - -l= - Root name of library to link - -lto-opt= - LTO Optimization level (O0-O3) - -o= - Write output to - ``` - -### eosio-abigen ---- -```bash -USAGE: eosio-abigen [options] [... ] - -OPTIONS: - -Generic Options: - - -help - Display available options (-help-hidden for more) - -help-list - Display list of available options (-help-list-hidden for more) - -version - Display the version of this program - -eosio-abigen: -generates an ABI from C++ project input - - -extra-arg= - Additional argument to append to the compiler command line - -extra-arg-before= - Additional argument to prepend to the compiler command line - -output= - Set the output filename and fullpath - -p= - Build path -``` - -License ----- - -MIT diff --git a/build.sh b/build.sh index 61706337a1..0b128706fa 100755 --- a/build.sh +++ b/build.sh @@ -13,6 +13,15 @@ export TEMP_DIR="/tmp" TEMP_DIR='/tmp' DISK_MIN=10 +# Use current directory's tmp directory if noexec is enabled for /tmp +if (mount | grep "/tmp " | grep --quiet noexec); then + mkdir -p $SOURCE_DIR/tmp + TEMP_DIR="${SOURCE_DIR}/tmp" + rm -rf $SOURCE_DIR/tmp/* +else # noexec wasn't found + TEMP_DIR="/tmp" +fi + unamestr=`uname` if [[ "${unamestr}" == 'Darwin' ]]; then BOOST=/usr/local @@ -63,7 +72,7 @@ if [[ `uname` == 'Darwin' ]]; then read -ra FREE_MEM <<< "$FREE_MEM" FREE_MEM=$((${FREE_MEM[2]%?}*(4096))) # free pages * page size else - FREE_MEM=`LANG=C free | grep "Mem:" | awk '{print $4}'` + FREE_MEM=`LC_ALL=C free | grep "Mem:" | awk '{print $4}'` fi CORES_AVAIL=`getconf _NPROCESSORS_ONLN` diff --git a/docker/Dockerfile b/docker/Dockerfile index 42f2af2f66..ff356bd992 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,25 @@ FROM boscore/builder as builder ARG branch=master -RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates curl wget git cmake python3 g++ && rm -rf /var/lib/apt/lists/* +ENV OPENSSL_ROOT_DIR /usr/include/openssl -RUN cd / && git clone --depth 1 -b $branch https://github.com/boscore/bos.cdt.git --recursive \ +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates curl wget git cmake python3 g++ vim net-tools lsof wget curl supervisor + + +RUN cd / && git clone --depth 1 -b master https://github.com/boscore/bos.git --recursive \ + && cd /bos \ + && ./eosio_build.sh -s BOS \ + && ./eosio_install.sh \ + && cd .. \ + && rm -rf ./bos + +RUN cd / && git clone -b $branch https://github.com/boscore/bos.cdt.git --recursive \ && cd /bos.cdt/ \ && ./build.sh \ && ./install.sh \ && cd .. \ && rm -rf ./bos.cdt +RUN rm -rf /var/lib/apt/lists/* + +USER root \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 0000000000..ec4ed9d2b5 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,18 @@ +## Usage: How to use BOSCore CDT Docker image to build contracts +- save [docker-compose.yml](./docker-compose.yml) file into path `~/boscdt/` +- call `cd ~/boscdt/` +- call `docker-compose up -d` to start the CDT docker +- call `docker-compose exec boscdt bash` will enter the docker container +- call `cd /data` will go into the host machine mounted path `~/boscdt/` +- call `exit` to exit the docker contrainer +- copy your contract folders into `~/boscdt/` +- call `docker-compose exec boscdt bash` and `cd /data/` you will find you contract folders +- enjoy to compile the contracts + + +## DIY: How to build self BOSCore CDT Docker image +- modify the [Dockerfile](./Dockerfile) and add yourself commands +- call `docker build -t XXXX/boscdt:vx.x.x --build-arg branch=release/v2.0.x --build-arg symbol=BOS --no-cache .` +- maybe you should push your docker image by call `docker push XXXX/boscdt:vx.x.x` +- change [docker-compose.yml](./docker-compose.yml) `image` into `XXXX/boscdt:vx.x.x` +- follow `Usage: How to use BOSCore CDT Docker image to build contracts` to use yourself docker image \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000000..dddfa6345a --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,11 @@ +version: "3" + +services: + boscdt: + image: boscore/cdt:latest + command: /bin/bash + hostname: boscdt + stdin_open: true + tty: true + volumes: + - .:/data \ No newline at end of file diff --git a/docs/guides/abi-generator-attributes.md b/docs/guides/abi-generator-attributes.md new file mode 100644 index 0000000000..d7da23181d --- /dev/null +++ b/docs/guides/abi-generator-attributes.md @@ -0,0 +1,60 @@ +## ABI generator attributes +Unlike the old ABI generator tool, the new tool uses C++11 or GNU style attributes to mark ```actions``` and ```tables```. +#### [[eosio::action]] +This attribute marks either a struct or a method as an action. +Example (four ways to declare an action for ABI generation): +```c++ +// this is the C++11 and greater style attribute +[[eosio::action]] +void testa( name n ) { + // do something +} + +// this is the GNU style attribute, this can be used in C code and prior to C++ 11 +__attribute__((eosio_action)) +void testa( name n ){ + // do something +} + +struct [[eosio::action]] testa { + name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; + +struct __attribute__((eosio_action)) testa { + name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; +``` +If your action name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::action("")]]``` + +Example (two ways to declare a table for ABI generation): +``` +struct [[eosio::table]] testtable { + uint64_t owner; + /* all other fields */ +}; + +struct __attribute__((eosio_table)) testtable { + uint64_t owner; + /* all other fields */ +}; + +typedef eosio::multi_index<"tablename"_n, testtable> testtable_t; +``` +If you don't want to use the multi-index you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]```. + +For an example contract of ABI generation please see the file ./examples/abigen_test/test.cpp. You can generate the ABI for this file with `eosio-abigen test.cpp --output=test.abi`. + +### Fixing an ABI or Writing an ABI Manually +- The sections to the ABI are pretty simple to understand and the syntax is purely JSON, so it is reasonable to write an ABI file manually. +- The ABI generation will never be completely perfect for every contract written. Advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions. So having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. +- Please refer to [developers.eos.io "How to Write an ABI File"](https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi) to learn about the different sections of an ABI. + +### Adding Ricardian Contracts and Clauses to ABI +- As of EOSIO.CDT v1.4.0 the ABI generator will try to automatically import contracts and clauses into the generated ABI. There are a few caveats to this, one is a strict naming policy of the files and an HTML tag used to mark each Ricardian contract and each clause. +- The Ricardian contracts should be housed in a file with the name .contracts.md and the clauses should be in a file named .clauses.md. + - For each Ricardian contract the header `

ActionName

` should be used, as this directs the ABI generator to attach this Ricardian contract to the specified action. + - For each Ricardian clause the header `

ClauseID

` should be used, as this directs the ABI generator to the clause id and the subsequent body. + - The option `-R` has been added to eosio-cpp and eosio-abigen to add "resource" paths to search from, so you can place these files in any directory structure you like and use `-R` in the same vein as `-I` for include paths. + - To see these in use please see ./examples/hello/hello.contracts.md and ./examples/hello/hello.clauses.md. diff --git a/docs/guides/basic-usage.md b/docs/guides/basic-usage.md new file mode 100644 index 0000000000..9810028a57 --- /dev/null +++ b/docs/guides/basic-usage.md @@ -0,0 +1,37 @@ + +### Usage +--- +#### CMakeLists.txt +To compile an EOSIO smart contract with CMake you'll need a CMake file. The template `CMakeLists.txt` in the examples folder is a good boilerplate. + +For example: + +In `CMakeLists.txt`: +``` +cmake_minimum_required(VERSION 3.5) +project(test_example VERSION 1.0.0) + +find_package(eosio.cdt) + +add_contract( test test test.cpp ) +``` + + +In `test.cpp`: + +``` +#include +using namespace eosio; + +CONTRACT test : public eosio::contract { +public: + using contract::contract; + + ACTION testact( name test ) { + } +}; + +EOSIO_DISPATCH( test, (testact) ) +``` + +To manually compile the source code, use [`eosio-cpp/eosio-cc`](/tools/eosio-cpp.html) and [`eosio-ld`](/tools/eosio-ld.html) as if it were __clang__ and __lld__. All the includes and options specific to EOSIO and CDT are baked in. diff --git a/docs/guides/cmake.md b/docs/guides/cmake.md new file mode 100644 index 0000000000..f916545f6a --- /dev/null +++ b/docs/guides/cmake.md @@ -0,0 +1,38 @@ +#### CMakeLists.txt +To compile an EOSIO smart contract with CMake you'll need a CMake file. The new `eosio-init` tool can be used to generate the directory structure stub .hpp/.cpp files and subsequent cmake files. Or the template `CMakeLists.txt` in the examples folder is a good boilerplate for manual usage. + +For example: + +In `CMakeLists.txt`: +``` +cmake_minimum_required(VERSION 3.5) +project(test_example VERSION 1.0.0) + +find_package(eosio.cdt) + +add_contract( test test test.cpp ) +``` + + +In `test.cpp`: + +``` +#include +using namespace eosio; + +CONTRACT test : public eosio::contract { +public: + using contract::contract; + + ACTION testact( name test ) { + } +}; + +EOSIO_DISPATCH( test, (testact) ) +``` + +### CMake Macros +- `add_contract` is used to build your smart contract and generate an ABI, the first parameter is the contract name, the second is the cmake target name, and the rest are the CPP files needed to build the contract. +- `target_ricardian_directory` can be used to add the directory where your ricardian contracts live to a specific cmake target. +- (new for native tester) `add_native_library` and `add_native_executable` CMake macros have been added (these are a drop in replacement for add_library and add_executable). + diff --git a/docs/guides/first-smart-contract.md b/docs/guides/first-smart-contract.md new file mode 100644 index 0000000000..3082f3adb1 --- /dev/null +++ b/docs/guides/first-smart-contract.md @@ -0,0 +1,28 @@ +### Building your first smart contract +- Navigate to the hello folder in examples (./examples/hello). +- You should then see the hello.cpp file +- Now run the compiler +```sh +$ eosio-cpp -abigen hello.cpp -o hello.wasm +``` +- Or with CMake +```sh +$ mkdir build +$ cd build +$ cmake .. +$ make +``` +This will generate two files: +* The compiled binary wasm (hello.wasm) +* The generated ABI file (hello.abi) + +#### using eosio-abigen alone +To generate an ABI with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `--output` and generating against the contract name `--contract`. + +Example: +```bash +$ eosio-abigen hello.cpp --contract=hello --output=hello.abi +``` + +This will generate one file: +* The generated ABI file (hello.abi) diff --git a/docs/guides/native-tester.md b/docs/guides/native-tester.md new file mode 100644 index 0000000000..a809962ca1 --- /dev/null +++ b/docs/guides/native-tester.md @@ -0,0 +1,119 @@ +## Native Tester/Compilation +As of v1.5.0 native compilation can be performed and a new set of libraries to facilitate native testing and native "scratch pad" compilation. `eosio-cc\cpp` and `eosio-ld` now support building "smart contracts" and unit tests natively for quick tests to help facilitate faster development \(note the default implementations of eosio `intrinsics` are currently asserts that state they are unavailable, these are user definable.\) + +#### Getting Started +Once you have your smart contract written then a test source file can be written. + +`hello.hpp` +```c++ +#include + +using namespace eosio; + +CONTRACT hello : public eosio::contract { + public: + using contract::contract; + + ACTION hi( name user ); + + // accessor for external contracts to easily send inline actions to your contract + using hi_action = action_wrapper<"hi"_n, &hello::hi>; +}; +``` + +and then a quick test +`hello_test.cpp` +```c++ +#include +#include + +#include + +using namespace eosio; +using namespace eosio::native; + +EOSIO_TEST_BEGIN(hello_test) + // These can be redefined by the user to suit there needs per unit test + // the idea is that in a future release we will have a base library that + // initializes these to "useable" default implementations and probably + // helpers to more easily define read_action_data and action_data_size intrinsics + // like these" + intrinsics::set_intrinsic( + [](void* m, uint32_t len) { + check(len <= sizeof(eosio::name), "failed from read_action_data"); + *((eosio::name*)m) = "hello"_n; + return len; + }); + + intrinsics::set_intrinsic( + []() { + return (uint32_t)sizeof(eosio::name); + }); + + intrinsics::set_intrinsic( + [](capi_name nm) { + }); + + + // "Name : hello" should be in the print buffer + CHECK_PRINT("Name : hello", + []() { + apply("test"_n.value, "test"_n.value, "hi"_n.value); + }); + + // should not assert + apply("test"_n.value, "test"_n.value, "check"_n.value); + + name nm = "null"_n; + intrinsics::set_intrinsic( + [&](void* m, uint32_t len) { + check(len <= sizeof(eosio::name), "failed from read_action_data"); + *((eosio::name*)m) = nm; + return len; + }); + + REQUIRE_ASSERT( "check name not equal to `hello`", + []() { + // should assert + apply("test"_n.value, "test"_n.value, "check"_n.value); + }); + +EOSIO_TEST_END + +// boilerplate main, this will be generated in a future release +int main(int argc, char** argv) { + silence_output(true); + EOSIO_TEST(hello_test); + return has_failed(); +} +``` + +Every `intrinsic` that is defined for eosio (prints, require_auth, etc.) is redefinable given the `intrinsics::set_intrinsics()` functions. These take a lambda whose arguments and return type should match that of the intrinsic you are trying to define. This gives the contract writer the flexibility to modify behavior to suit the unit test being written. A sister function `intrinsics::get_intrinsics()` will return the function object that currently defines the behavior for said intrinsic. This pattern can be used to mock functionality and allow for easier testing of smart contracts. For more information please see, either the `./tests` directory or `./examples/hello/tests/hello_test.cpp` for working examples. + +### Compiling Native Code +- Raw `eosio-cpp` to compile the test or program the only addition needed to the command line is to add the flag `-fnative` this will then generate native code instead of `wasm` code. +- Via CMake + - `add_native_library` and `add_native_executable` CMake macros have been added (these are a drop in replacement for add_library and add_executable). + +### Eosio.CDT Native Tester API +- CHECK_ASSERT(...) : This macro will check whether a particular assert has occured and flag the tests as failed but allow the rest of the tests to run. + - This is called either by + - `CHECK_ASSERT("", [](){ whatever_function(); })` + - `CHECK_ASSERT([](std::string msg){ user defined comparison function }, [](){ whatever_function(); })` +- CHECK_PRINT(...) : This macro will check whether the print buffer holds the string that is expected and flag the tests as failed but allow the rest of the test to run. + - This is called either by + - `CHECK_PRINT("", [](){ whatever_function(); })` + - `CHECK_PRINT([](std::string print_buffer){ user defined comparison function }, [](){ whatever_function(); })` +- CHECK_EQUAL(X, Y) : This macro will check whether two inputs equal eachother and fail the test but allow the rest of the test to continue. +- REQUIRE_ASSERT(...) : This macro will check whether a particular assert has occured and flag the tests as failed and halt the test on failure. + - This is called either by + - `REQUIRE_ASSERT("", [](){ whatever_function(); })` + - `REQUIRE_ASSERT([](std::string msg){ user defined comparison function }, [](){ whatever_function(); })` +- REQUIRE_PRINT(...) : This macro will check whether the print buffer holds the string that is expected and flag the tests as failed and halt the test on failure. + - This is called either by + - `REQUIRE_PRINT("", [](){ whatever_function(); })` + - `REQUIRE_PRINT([](std::string print_buffer){ user defined comparison function }, [](){ whatever_function(); })` +- REQUIRE_EQUAL(X, Y) : This macro will check whether two inputs `X` and `Y` equal eachother and fail the test and halt the test on failure. +- EOSIO_TEST_BEGIN(X) : This macro defines the beginning of a unit test and assigns `X` as the symbolic name of that test. +- EOSIO_TEST_END : This macro defines the end of a unit test. +- EOSIO_TEST(X) : This is used to run a particular named unit test `X` in the main function. diff --git a/docs/guides/upgrading-from-1.2-to-1.3.md b/docs/guides/upgrading-from-1.2-to-1.3.md new file mode 100644 index 0000000000..d76ef1f15e --- /dev/null +++ b/docs/guides/upgrading-from-1.2-to-1.3.md @@ -0,0 +1,226 @@ +## Version 1.3 + +### eosiolib C API +- Removed the following typedefs to `uint64_t`: + - `account_name` + - `permission_name` + - `scope_name` + - `table_name` + - `action_name` +- Added a `uint64_t` typedef called `capi_name` to replace the removed typedefs above: + - These have been replaced by `capi_name` and as a practice should not be used when writing C++ contract code. Instead, the new version of the `eosio::name` type from the eosiolib C++ API should be used to replace these instances. This decision was made because of bad implicit casting issues with `uint64_t` and the new pattern should allow for better type safety. +- Removed `symbol_name` typedef: + - This has no C equivalent to replace it. When writing C++ contract code, the `eosio::symbol_code` struct should be used instead. As with the previously mentioned named types, this was removed and replaced with `eosio::symbol_code` to allow for better type safety in contracts. To use a symbol, i.e. symbol name and precision, use the `eosio::symbol` class. +- Removed `time` and `weight_type` typedefs. +- Removed the `transaction_id_type` and `block_id_type` typedefs. +- Removed the `account_permission` struct. +- Renamed the following typedefs: + - `checksum160` -> `capi_checksum160` + - `checksum256` -> `capi_checksum256` + - `checksum512` -> `capi_checksum512` + - `public_key` -> `capi_public_key` + - `signature` -> `capi_signature` +- Removed the non-existent intrinsics declarations `require_write_lock` and `require_read_lock`. + +### eosiolib C++ API +- Removed eosiolib/vector.hpp: + - Removed alias `eosio::vector` and typedef `bytes`. + - Going forward contract writers should include `` from the STL and use `std::vector` instead of bytes. +- Removed eosiolib/types.hpp. +- Removed eosiolib/optional.hpp. Use `std::optional` as a replacement. +- Removed eosiolib/core_symbol.hpp. The contract writer should explicitly specify the symbol. +- Added eosiolib/name.hpp. + +#### eosiolib/types.hpp +- Moved the typedef `eosio::extensions_types` to eosiolib/transaction.hpp. +- Removed comparison functions for `checksum` structs. +- Removal of `eosio::char_to_symbol`, `eosio::string_to_name`, `eosio::name_suffix` functions +- Removal of the `N` macro. The `""_n` operator or the `name` constructor should be used as a type safe replacement. Example: `N(foo)` -> `"foo"_n`, or `N(foo)` -> `name("foo")`. +- Moved `eosio::name` struct definition and `""_n` operator to eosiolib/name.hpp. + +#### eosiolib/name.hpp +- Removed implicit and explicit conversions to `uint64_t`. +- Added `enum class` `eosio::name::raw` which is implicitly converted from an `eosio::name` (used for template non-type parameters). +- Added `bool` conversion operator for conditionally testing if a name is empty. +- All constructors are now `constexpr`. These take either a `uint64_t`, an `eosio::name::raw` or a `std::string_view`. +- Added `constexpr` methods `eosio::name::length` and `eosio::name::suffix`. +- Added equivalence, inverted equivalence and less than operators to `eosio::name`. + +#### eosiolib/symbol.hpp +- Removed `eosio::symbol_type` struct and replaced with `eosio::symbol` class. +- Added struct `eosio::symbol_code`: + - Added two `constexpr` constructors that take either a raw `uint64_t` or an `std::string_view`. + - Added `constexpr` methods `is_valid`, `length` and `raw`. + - Added a print method. + - Added `bool` conversion operator to test is `symbol_code` is empty. +- Removed `eosio::string_to_symbol`, `eosio::is_valid_symbol`, `eosio::symbol_name_length` functions. +- Removed the `S` macro. The symbol constructor should be used as a type safe replacement. Example: `S(4,SYS)` -> `symbol(symbol_code("SYS"), 4)` (or simply `symbol("SYS", 4)` as of v1.3.1). +- Added struct `eosio::symbol`: + - Added three `constexpr` constructors that take either a raw `uint64_t`, `symbol_code` and a `uint8_t` precision or an `std::string_view` and a `uint8_t` precision. + - Added `constexpr` methods `is_valid`, `precision`, `code`, and `raw`. These, respectively, check if the `symbol` is valid, get the `uint8_t` precision, get the `symbol_code` part of the `symbol`, and get the raw `uint64_t` representation of `symbol`. + - Added equivalence, inverted equivalence and less than operators to `eosio::symbol`. +- Modified struct `eosio::extended_symbol`: + - Restricted fields to private. + - Added `constexpr` constructor that takes a `eosio::symbol` and an `eosio::name`. + - Added `constexpr` methods `get_symbol` and `get_contract`. + - Made existing comparison operators `constexpr`. + +#### eosiolib/asset.hpp +- The main constructor now requires a `int64_t` (quantity) and `eosio::symbol` explicitly. +- The default constructor no longer initializes the instance to a valid zero quantity asset with a symbol equivalent to "core symbol". Instead the default constructed `eosio::asset` is a bit representation of all zeros (which will cause `is_valid` to fail) so that check is bypassed to allow for `multi_index` and `datastream` to work. +- Old contracts that use `eosio::asset()` should be changed to either use the core symbol of the specific chain they are targeting i.e. `eosio::asset(0, symbol(symbol_code("SYS"),4))`. To reduce writing `symbol(symbol_code("SYS"),4)` over and over, a `constexpr` function to return the symbol or `constexpr` global variable should be used. + +#### eosiolib/contract.hpp +- The constructor for `eosio::contract` now takes an `eosio::name` for the receiver, an `eosio::name` for the code, and a `eosio::datastream` for the datastream used for the contract. The last argument is for manually unpacking an action, see the section on `eosio::ignore` for a more indepth usage. + +#### eosiolib/dispatcher.hpp +- Renamed the macro `EOSIO_ABI` to `EOSIO_DISPATCH` as this is more descriptive of what this macro actually does. +- Modified the definition of `EOSIO_DISPATCH` to work with the new constructor for `eosio::contract`. + +#### eosiolib/multi_index.hpp +- The first template parameter for `indexed_by` now requires the argument be convertible to `eosio::name::raw` (replacing `uint64_t`). +- The first template parameter for `multi_index` now requires the argument be convertible to `eosio::name::raw` (replacing `uint64_t`). +- The constructor now takes an `eosio::name` type for the code (replacing `uint64_t`). Scope is still `uint64_t`. +- Various other replacements of `uint64_t` to `eosio::name`. + +#### eosiolib/singleton.hpp +- The first template parameter for `eosio::singleton` now requires the argument be convertible to `eosio::name::raw` (replacing `uint64_t`). +- The constructor now takes an `eosio::name` type for the code. +- In the methods `get_or_create` and `set`, the argument `bill_to_account` is now of type `eosio::name` (replacing `uint64_t`). + +#### eosiolib/action.hpp +- Added C++ function `eosio::require_auth`. +- Added C++ function `eosio::has_auth`. +- Added C++ function `eosio::is_account`. +- Redefined `eosio::permission_level` to use `eosio::name` in place of `uint64_t`. +- Removed the macro `ACTION`. (The identifier `ACTION` has been reused for another macro described below in the Macros section.) + +#### eosiolib/permission.hpp + - The optional provided_keys argument of the function `eosio::check_transaction_authorization` is now of the type `std::set` rather than the type `std::set`. C++ contract code should most likely be using the `eosio::public_key` struct (defined in "eosiolib/public_key.hpp") if they need to deal with EOSIO-compatible public keys rather than the `capi_public_key` struct (now renamed from its original name of `::public_key`) from the eosiolib C API. Note that existing contract code that just referred to the type `public_key` without namespace qualification may have accidentally been using the `capi_public_key` struct and therefore should ideally be modified to use the `eosio::public_key` C++ type. + - The `account` and `permission` arguments of `eosio::check_permission_authorization` are both `eosio::name` now instead of `uint64_t`. + +#### eosiolib/ignore.hpp +- Added new type `ignore`: + - This type acts as a placeholder for actions that don't want to deserialize their fields but want the types to be reflected in the ABI. + ``` + ACTION action(ignore) { some_type st; _ds >> st; } + ``` +- Added new type `ignore_wrapper`: + - This allows for calling `SEND_INLINE_ACTION` with `ignore_wrapper(some_value)` against an action with an `ignore` of matching types. + +### Macros +- Added `ACTION` macro which is simply a shortcut for `[[eosio::action]] void`. +- Added `TABLE` macro which is simply a shortcut for `struct [[eosio::table]]`. +- Added `CONTRACT` macro which is simply a shortcut for `class [[eosio::contract]]`. + +### CMake +- Added `eosio.cdt-config.cmake` to allow for `find_package(eosio.cdt)`. See eosio.cdt/examples/hello or eosio.cdt/examples/template for an example. +- Added new macro `add_contract`. This new contract takes a contract name, cmake target, then any normal arguments you would give to `add_executable`. See eosio.cdt/examples/hello or eosio.cdt/examples/template. +- New version checking mechanism is included. See eosio.contracts/CMakeLists.txt to see this in use. + +### libc +- Replaced `printf`, `sprintf`, and `snprintf` with new minimal variants. This allows contracts to use these functions without causing stack overflow issues. + +### libcxx +- Removed `sstream` with the intent to return this after more has been done. +- Added `__cxa_pure_virtual` to allow for pure virtual methods in contract classes. +- `std::to_string` now works without the issues of stack overflows. + +### attributes +- Added `[[eosio::ignore]]` attribute to flag a type as being ignored by the deserializer. This attribute is primarily only used for internal use within eosiolib. +- Added `[[eosio::contract]]` attribute. This new attribute is used to mark a contract class as "contract" with the name being either the C++ name of the class or a user specified name (i.e. `[[eosio::contract("somecontract")]]`). This attribute can also be used in conjunction with the `eosio::action` and `eosio::table` attributes for tables that you would like to define outside of the `eosio::contract` class. This is used in conjunction with either the raw `eosio-cpp` option `--contract `, `-o .wasm` or with CMake `add_contract`. It acts as a filter enabling contract developers to include a header file with attributes from another contract (e.g. eosio.token) while generating an ABI devoid of those actions and tables. + ```c++ + #include + using namespace eosio; + CONTRACT test : public eosio::contract { + public: + using contract::contract; + ACTION acta(){} + TABLE taba { + uint64_t a; + float b; + uint64_t primary_key() const { return a; } + }; + }; + struct [[eosio::table, eosio::contract("test")]] + tabb { + uint64_t a; + int b; + }; + typedef eosio::multi_index<"testtaba"_n, test::taba> table_a; + typedef eosio::multi_index<"testtabb"_n, tabb> table_b; + EOSIO_DISPATCH( test, (acta) ) + ``` + The above code will produce the tables `testtaba` and `testtabb` in your ABI. Example: `eosio-cpp -abigen test.cpp -o test.wasm` will mark this compilation and ABI generation for the `eosio::contract` `test`. The same thing can be done with `eosio-cpp -abigen test.cpp -o test_contract.wasm --contract test` or with the CMake command `add_contract( test, test_contract, test.cpp )`. Either of the previous two approaches will produce a test_contract.wasm and test_contract.abi generated under the context of the contract name of `test`. + +### Boost +- Boost is now part of the library. No more external dependence on Boost and all system inclusion are within it's `sysroot`. (Boost will be removed in a future release.) + + +## ABI generator attributes +Unlike the old ABI generator tool, the new tool uses C++11 or GNU style attributes to mark ```actions``` and ```tables```. +#### [[eosio::action]] +This attribute marks either a struct or a method as an action. +Example (four ways to declare an action for ABI generation): +```c++ +// this is the C++11 and greater style attribute +[[eosio::action]] +void testa( name n ) { + // do something +} + +// this is the GNU style attribute, this can be used in C code and prior to C++ 11 +__attribute__((eosio_action)) +void testa( name n ){ + // do something +} + +struct [[eosio::action]] testa { + name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; + +struct __attribute__((eosio_action)) testa { + name n; + EOSLIB_SERIALIZE( testa, (n) ) +}; +``` +If your action name is not a valid [EOSIO name](https://developers.eos.io/eosio-cpp/docs/naming-conventions) you can explicitly specify the name in the attribute ```c++ [[eosio::action("")]]``` + +Example (two ways to declare a table for ABI generation): +``` +struct [[eosio::table]] testtable { + uint64_t owner; + /* all other fields */ +}; + +struct __attribute__((eosio_table)) testtable { + uint64_t owner; + /* all other fields */ +}; + +typedef eosio::multi_index<"tablename"_n, testtable> testtable_t; +``` +If you don't want to use the multi-index you can explicitly specify the name in the attribute ```c++ [[eosio::table("")]]```. + +For an example contract of ABI generation please see the file ./examples/abigen_test/test.cpp. You can generate the ABI for this file with `eosio-abigen test.cpp --output=test.abi`. + +### Fixing an ABI or Writing an ABI Manually +- The sections to the ABI are pretty simple to understand and the syntax is purely JSON, so it is reasonable to write an ABI file manually. +- The ABI generation will never be completely perfect for every contract written. Advanced features of the newest version of the ABI will require manual construction of the ABI, and odd and advanced C++ patterns could capsize the generators type deductions. So having a good knowledge of how to write an ABI should be an essential piece of knowledge of a smart contract writer. +- Please refer to [developers.eos.io "How to Write an ABI File"](https://developers.eos.io/eosio-cpp/docs/how-to-write-an-abi) to learn about the different sections of an ABI. + +### Adding Ricardian Contracts and Clauses to ABI +- As of EOSIO.CDT v1.4.0 the ABI generator will try to automatically import contracts and clauses into the generated ABI. There are a few caveats to this, one is a strict naming policy of the files and an HTML tag used to mark each Ricardian contract and each clause. +- The Ricardian contracts should be housed in a file with the name .contracts.md and the clauses should be in a file named .clauses.md. + - For each Ricardian contract the header `

ActionName

` should be used, as this directs the ABI generator to attach this Ricardian contract to the specified action. + - For each Ricardian clause the header `

ClauseID

` should be used, as this directs the ABI generator to the clause id and the subsequent body. + - The option `-R` has been added to eosio-cpp and eosio-abigen to add "resource" paths to search from, so you can place these files in any directory structure you like and use `-R` in the same vein as `-I` for include paths. + - To see these in use please see ./examples/hello/hello.contracts.md and ./examples/hello/hello.clauses.md. + + + +License +---- + +MIT diff --git a/docs/tools/eosio-abidiff.md b/docs/tools/eosio-abidiff.md new file mode 100644 index 0000000000..bcb93ac8f9 --- /dev/null +++ b/docs/tools/eosio-abidiff.md @@ -0,0 +1,24 @@ +# eosio-abidiff + +Tool to diff two ABI files to flag and output differences. +To report differences with ```eosio-abidiff```, you only need to pass the two ABI file names as command line arguments. + +Example: +```bash +$ eosio-abidiff hello.abi old_hello.abi +``` + +This will generate dump the report output to the console. +--- +``` +OVERVIEW: eosio-abidiff +USAGE: eosio-abidiff [options] ... ... + +OPTIONS: + +Generic Options: + + -help - Display available options (-help-hidden for more) + -help-list - Display list of available options (-help-list-hidden for more) + -version - Display the version of this program +``` diff --git a/docs/tools/eosio-abigen.md b/docs/tools/eosio-abigen.md new file mode 100644 index 0000000000..7e383368ff --- /dev/null +++ b/docs/tools/eosio-abigen.md @@ -0,0 +1,31 @@ +# eosio-abigen + +To generate an ABI with ```eosio-abigen```, only requires that you give the main '.cpp' file to compile and the output filename `--output` and generating against the contract name `--contract`. + +Example: +```bash +$ eosio-abigen hello.cpp --contract=hello --output=hello.abi +``` + +This will generate one file: +* The generated ABI file (hello.abi) +--- +``` +USAGE: eosio-abigen [options] [... ] + +OPTIONS: + +Generic Options: + + -help - Display available options (-help-hidden for more) + -help-list - Display list of available options (-help-list-hidden for more) + -version - Display the version of this program + +eosio-abigen: +generates an ABI from C++ project input + + -extra-arg= - Additional argument to append to the compiler command line + -extra-arg-before= - Additional argument to prepend to the compiler command line + -output= - Set the output filename and fullpath + -p= - Build path +``` diff --git a/docs/tools/eosio-cpp.md b/docs/tools/eosio-cpp.md new file mode 100644 index 0000000000..6ebab10a56 --- /dev/null +++ b/docs/tools/eosio-cpp.md @@ -0,0 +1,73 @@ +### Usage +--- +To manually compile the source code, use `eosio-cpp/eosio-cc` and `eosio-ld` as if it were __clang__ and __lld__. All the includes and options specific to EOSIO and CDT are baked in. + +###$ eosio-cpp +--- +``` +USAGE: eosio-cpp [options] ... + +OPTIONS: + +Generic Options: + + -help - Display available options (-help-hidden for more) + -help-list - Display list of available options (-help-list-hidden for more) + -version - Display the version of this program + +compiler options: + + -C - Include comments in preprocessed output + -CC - Include comments from within macros in preprocessed output + -D= - Define to (or 1 if omitted) + -E - Only run the preprocessor + -I= - Add directory to include search path + -L= - Add directory to library search path + -MD - Write depfile containing user and system headers + -MF= - Write depfile output + -MMD - Write depfile containing user + -MT= - Specify name of main file output in depfile + -O= - Optimization level s, 0-3 + -R= - Add a resource path for inclusion + -S - Only run preprocess and compilation steps + -U= - Undefine macro + -W= - Enable the specified warning + -abigen - Generate ABI + -abigen_output= - ABIGEN output + -c - Only run preprocess, compile, and assemble steps + -contract= - Contract name + -dD - Print macro definitions in -E mode in addition to normal output + -dI - Print include directives in -E mode in addition to normal output + -dM - Print macro definitions in -E mode instead to normal output + -emit-ast - Emit Clang AST files for source inputs + -emit-llvm - Use the LLVM representation for assembler and object files + -faligned-allocation - Enable C++17 aligned allocation functions + -fasm - Assemble file for x86-64 + -fcolor-diagnostics - Use colors in diagnostics + -fcoroutine-ts - Enable support for the C++ Coroutines TS + -finline-functions - Inline suitable functions + -finline-hint-functions - Inline functions which are (explicitly or implicitly) marked inline + -fmerge-all-constants - Allow merging of constants + -fnative - Compile and link for x86-64 + -fno-cfl-aa - Disable CFL Alias Analysis + -fno-elide-constructors - Disable C++ copy constructor elision + -fno-lto - Disable LTO + -fno-post-pass - Don't run post processing pass + -fno-stack-first - Don't set the stack first in memory + -fstack-protector - Enable stack protectors for functions potentially vulnerable to stack smashing + -fstack-protector-all - Force the usage of stack protectors for all functions + -fstack-protector-strong - Use a strong heuristic to apply stack protectors to functions + -fstrict-enums - Enable optimizations based on the strict definition of an enum's value range + -fstrict-return - Always treat control flow paths that fall off the end of a non-void function as unreachable + -fstrict-vtable-pointers - Enable optimizations based on the strict rules for overwriting polymorphic C++ objects + -fuse-main - Use main as entry + -include= - Include file before parsing + -isystem= - Add directory to SYSTEM include search path + -l= - Root name of library to link + -lto-opt= - LTO Optimization level (O0-O3) + -o= - Write output to + -std= - Language standard to compile for + -sysroot= - Set the system root directory + -v - Show commands to run and use verbose output + -w - Suppress all warnings +``` diff --git a/docs/tools/eosio-init.md b/docs/tools/eosio-init.md new file mode 100644 index 0000000000..f721ba33b4 --- /dev/null +++ b/docs/tools/eosio-init.md @@ -0,0 +1,30 @@ +# eosio-init + +This tool is used to generate a skeleton smart contract and directory structure. +To generate a new smart contract project you can either generate a "bare" project (no CMake) or the default is to generate a CMake project. +Example: +```bash +$ eosio-abigen hello.cpp --contract=hello --output=hello.abi +``` + +This will generate one file: +* The generated ABI file (hello.abi) +--- +``` +USAGE: eosio-init [options] + +OPTIONS: + +Generic Options: + + -help - Display available options (-help-hidden for more) + -help-list - Display list of available options (-help-list-hidden for more) + -version - Display the version of this program + +eosio-init: +generates an eosio smart contract project + + -bare - produces only a skeleton smart contract without CMake support + -path= - directory to place the project + -project= - output project name +``` diff --git a/docs/tools/eosio-ld.md b/docs/tools/eosio-ld.md new file mode 100644 index 0000000000..41c29e2532 --- /dev/null +++ b/docs/tools/eosio-ld.md @@ -0,0 +1,27 @@ +### eosio-ld +--- +``` +USAGE: eosio-ld [options] ... + +OPTIONS: + +Generic Options: + + -help - Display available options (-help-hidden for more) + -help-list - Display list of available options (-help-list-hidden for more) + -version - Display the version of this program + +ld options: + + -L= - Add directory to library search path + -fasm - Assemble file for x86-64 + -fnative - Compile and link for x86-64 + -fno-cfl-aa - Disable CFL Alias Analysis + -fno-lto - Disable LTO + -fno-post-pass - Don't run post processing pass + -fno-stack-first - Don't set the stack first in memory + -fuse-main - Use main as entry + -l= - Root name of library to link + -lto-opt= - LTO Optimization level (O0-O3) + -o= - Write output to +``` diff --git a/eosio_llvm b/eosio_llvm index 9d682f7ebb..798a37dc0d 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit 9d682f7ebbdc50c2ad620f46d04d2aa94523f8f3 +Subproject commit 798a37dc0de68ba4fd5bb2988e45f7d022b3bb65 diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt deleted file mode 100644 index 765ad65c3f..0000000000 --- a/examples/CMakeLists.txt +++ /dev/null @@ -1,2 +0,0 @@ -add_subdirectory(hello) -add_subdirectory(exchange) diff --git a/examples/hello/CMakeLists.txt b/examples/hello/CMakeLists.txt index 6967f04328..709ed0591c 100644 --- a/examples/hello/CMakeLists.txt +++ b/examples/hello/CMakeLists.txt @@ -1,10 +1,34 @@ -cmake_minimum_required(VERSION 3.5) -project(hello_example VERSION 1.0.0) +include(ExternalProject) +# if no cdt root is given use default path +if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) + find_package(eosio.cdt) +endif() -find_package(eosio.cdt) +ExternalProject_Add( + hello_project + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src + BINARY_DIR ${CMAKE_BINARY_DIR}/hello + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 +) -### Generate the wasm and abi -add_contract( hello hello hello.cpp ) +ExternalProject_Add( + hello_tests_project + SOURCE_DIR ${CMAKE_SOURCE_DIR}/tests + BINARY_DIR ${CMAKE_BINARY_DIR}/tests + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 +) -### add the path to where the ricardian contracts/clauses are found -target_compile_options( hello.wasm PUBLIC -R${CMAKE_CURRENT_SOURCE_DIR} ) +### add a new test +include (CTest) +enable_testing() +add_test(hello_test ${CMAKE_BINARY_DIR}/tests/hello_test) diff --git a/examples/hello/README.txt b/examples/hello/README.txt new file mode 100644 index 0000000000..b200d54092 --- /dev/null +++ b/examples/hello/README.txt @@ -0,0 +1,12 @@ +--- hello Project --- + + - How to Build - + - cd to 'build' directory + - run the command 'cmake ..' + - run the command 'make' + + - After build - + - The built smart contract is under the 'hello' directory in the 'build' directory + - You can then do a 'set contract' action with 'cleos' and point in to the './build/hello' directory + + - Additions to CMake should be done to the CMakeLists.txt in the './src' directory and not in the top level CMakeLists.txt \ No newline at end of file diff --git a/examples/hello/hello.clauses.md b/examples/hello/hello.clauses.md deleted file mode 100644 index 6ce1d19527..0000000000 --- a/examples/hello/hello.clauses.md +++ /dev/null @@ -1,40 +0,0 @@ -

Warranty

-The invoker of the contract action shall uphold its Obligations under this Contract in a timely and workmanlike manner, using knowledge and recommendations for performing the services which meet generally acceptable standards set forth by EOS.IO Blockchain Block Producers. - -

Default

-The occurrence of any of the following shall constitute a material default under this Contract: - -

Remedies

-In addition to any and all other rights a party may have available according to law, if a party defaults by failing to substantially perform any provision, term or condition of this Contract, the other party may terminate the Contract by providing written notice to the defaulting party. This notice shall describe with sufficient detail the nature of the default. The party receiving such notice shall promptly be removed from being a Block Producer and this Contract shall be automatically terminated. - -

ForceMajeure

-If performance of this Contract or any obligation under this Contract is prevented, restricted, or interfered with by causes beyond either party's reasonable control ("Force Majeure"), and if the party unable to carry out its obligations gives the other party prompt written notice of such event, then the obligations of the party invoking this provision shall be suspended to the extent necessary by such event. The term Force Majeure shall include, without limitation, acts of God, fire, explosion, vandalism, storm or other similar occurrence, orders or acts of military or civil authority, or by national emergencies, insurrections, riots, or wars, or strikes, lock-outs, work stoppages, or supplier failures. The excused party shall use reasonable efforts under the circumstances to avoid or remove such causes of non-performance and shall proceed to perform with reasonable dispatch whenever such causes are removed or ceased. An act or omission shall be deemed within the reasonable control of a party if committed, omitted, or caused by such party, or its employees, officers, agents, or affiliates. - -

DisputeResolution

-Any controversies or disputes arising out of or relating to this Contract will be resolved by binding arbitration under the default rules set forth by the EOS.IO Blockchain. The arbitrator's award will be final, and judgment may be entered upon it by any court having proper jurisdiction. - -

Agreement

-This Contract contains the entire agreement of the parties, and there are no other promises or conditions in any other agreement whether oral or written concerning the subject matter of this Contract. This Contract supersedes any prior written or oral agreements between the parties. - -

Severability

-If any provision of this Contract will be held to be invalid or unenforceable for any reason, the remaining provisions will continue to be valid and enforceable. If a court finds that any provision of this Contract is invalid or unenforceable, but that by limiting such provision it would become valid and enforceable, then such provision will be deemed to be written, construed, and enforced as so limited. - -

Amendment

-This Contract may be modified or amended in writing by mutual agreement between the parties, if the writing is signed by the party obligated under the amendment. - -

GoverningLaw

-This Contract shall be construed in accordance with the Maxims of Equity. - -

Notice

-Any notice or communication required or permitted under this Contract shall be sufficiently given if delivered to a verifiable email address or to such other email address as one party may have publicly furnished in writing, or published on a broadcast contract provided by this blockchain for purposes of providing notices of this type. -

WaiverOfContractualRight

-The failure of either party to enforce any provision of this Contract shall not be construed as a waiver or limitation of that party's right to subsequently enforce and compel strict compliance with every provision of this Contract. - -

ArbitratorsFeesToPrevailingParty

-In any action arising hereunder or any separate action pertaining to the validity of this Agreement, both sides shall pay half the initial cost of arbitration, and the prevailing party shall be awarded reasonable arbitrator's fees and costs. - -

ConstructionAndInterpretation

-The rule requiring construction or interpretation against the drafter is waived. The document shall be deemed as if it were drafted by both parties in a mutual effort. - -

InWitnessWhereof

-In witness whereof, the parties hereto have caused this Agreement to be executed by themselves or their duly authorized representatives as of the date of execution, and authorized as proven by the cryptographic signature on the transaction that invokes this contract. diff --git a/examples/hello/hello.cpp b/examples/hello/hello.cpp deleted file mode 100644 index 1f98925579..0000000000 --- a/examples/hello/hello.cpp +++ /dev/null @@ -1,8 +0,0 @@ -#include "hello.hpp" -using namespace eosio; - -ACTION hello::hi( name user ) { - print_f( "Hello % from hello", user ); -} - -EOSIO_DISPATCH( hello, (hi) ) diff --git a/examples/hello/hello.hpp b/examples/hello/hello.hpp deleted file mode 100644 index e31b99c5c2..0000000000 --- a/examples/hello/hello.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#include - -using namespace eosio; - -CONTRACT hello : public eosio::contract { - public: - using contract::contract; - - ACTION hi( name user ); - - // accessor for external contracts to easily send inline actions to your contract - using hi_action = action_wrapper<"hi"_n, &hello::hi>; -}; diff --git a/examples/hello/include/hello.hpp b/examples/hello/include/hello.hpp new file mode 100644 index 0000000000..e88be85ce0 --- /dev/null +++ b/examples/hello/include/hello.hpp @@ -0,0 +1,13 @@ +#include +using namespace eosio; + +CONTRACT hello : public contract { + public: + using contract::contract; + + ACTION hi( name nm ); + ACTION check( name nm ); + + using hi_action = action_wrapper<"hi"_n, &hello::hi>; + using check_action = action_wrapper<"check"_n, &hello::check>; +}; diff --git a/examples/hello/hello.contracts.md b/examples/hello/ricardian/hello.contracts.md similarity index 81% rename from examples/hello/hello.contracts.md rename to examples/hello/ricardian/hello.contracts.md index 6571acdc30..f08d9791a5 100644 --- a/examples/hello/hello.contracts.md +++ b/examples/hello/ricardian/hello.contracts.md @@ -1,7 +1,6 @@ -

- hi -

-### Parameters +

hi

+ +Stub for hi action's ricardian contractrameters Input parameters: * `user` (string to include in the output) diff --git a/examples/hello/src/CMakeLists.txt b/examples/hello/src/CMakeLists.txt new file mode 100644 index 0000000000..defc82f35a --- /dev/null +++ b/examples/hello/src/CMakeLists.txt @@ -0,0 +1,8 @@ +project(hello) + +set(EOSIO_WASM_OLD_BEHAVIOR "Off") +find_package(eosio.cdt) + +add_contract( hello hello hello.cpp ) +target_include_directories( hello PUBLIC ${CMAKE_SOURCE_DIR}/../include ) +target_ricardian_directory( hello ${CMAKE_SOURCE_DIR}/../ricardian ) diff --git a/examples/hello/src/hello.cpp b/examples/hello/src/hello.cpp new file mode 100644 index 0000000000..3b37825303 --- /dev/null +++ b/examples/hello/src/hello.cpp @@ -0,0 +1,11 @@ +#include +ACTION hello::hi( name nm ) { + print_f("Name : %\n", nm); +} + +ACTION hello::check( name nm ) { + print_f("Name : %\n", nm); + eosio::check(nm == "hello"_n, "check name not equal to `hello`"); +} + +EOSIO_DISPATCH( hello, (hi)(check) ) diff --git a/examples/hello/tests/CMakeLists.txt b/examples/hello/tests/CMakeLists.txt new file mode 100644 index 0000000000..d5cf720ceb --- /dev/null +++ b/examples/hello/tests/CMakeLists.txt @@ -0,0 +1,4 @@ +project(hello_tests) +find_package(eosio.cdt) +add_native_executable(hello_test hello_test.cpp ${CMAKE_SOURCE_DIR}/../src/hello.cpp) +target_include_directories(hello_test PUBLIC ${CMAKE_SOURCE_DIR}/../include) diff --git a/examples/hello/tests/hello_test.cpp b/examples/hello/tests/hello_test.cpp new file mode 100644 index 0000000000..e29236c4a9 --- /dev/null +++ b/examples/hello/tests/hello_test.cpp @@ -0,0 +1,62 @@ +#include +#include + +#include + +using namespace eosio; +using namespace eosio::native; + +EOSIO_TEST_BEGIN(hello_test) + // These can be redefined by the user to suit there needs per unit test + // the idea is that in a future release we will have a base library that + // initializes these to "useable" default implementations and probably + // helpers to more easily define read_action_data and action_data_size intrinsics + // like these + intrinsics::set_intrinsic( + [](void* m, uint32_t len) { + check(len <= sizeof(eosio::name), "failed from read_action_data"); + *((eosio::name*)m) = "hello"_n; + return len; + }); + + intrinsics::set_intrinsic( + []() { + return (uint32_t)sizeof(eosio::name); + }); + + intrinsics::set_intrinsic( + [](capi_name nm) { + }); + + + // "Name : hello" should be in the print buffer + CHECK_PRINT("Name : hello", + []() { + apply("test"_n.value, "test"_n.value, "hi"_n.value); + }); + + // should not assert + apply("test"_n.value, "test"_n.value, "check"_n.value); + + name nm = "null"_n; + intrinsics::set_intrinsic( + [&](void* m, uint32_t len) { + check(len <= sizeof(eosio::name), "failed from read_action_data"); + *((eosio::name*)m) = nm; + return len; + }); + + REQUIRE_ASSERT( "check name not equal to `hello`", + []() { + // should assert + apply("test"_n.value, "test"_n.value, "check"_n.value); + }); + +EOSIO_TEST_END + +// boilerplate main, this will be generated in a future release +int main(int argc, char** argv) { + silence_output(true); + EOSIO_TEST(hello_test); + return has_failed(); +} diff --git a/examples/multi_index_example/CMakeLists.txt b/examples/multi_index_example/CMakeLists.txt index 6630ece6da..b7f45efd98 100644 --- a/examples/multi_index_example/CMakeLists.txt +++ b/examples/multi_index_example/CMakeLists.txt @@ -1,6 +1,17 @@ -cmake_minimum_required(VERSION 3.5) -project(hello_example VERSION 1.0.0) +include(ExternalProject) +# if no cdt root is given use default path +if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) + find_package(eosio.cdt) +endif() -find_package(eosio.cdt) - -add_contract( multi_index_example mie multi_index_example.cpp ) +ExternalProject_Add( + multi_index_example_project + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src + BINARY_DIR ${CMAKE_BINARY_DIR}/multi_index_example + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 +) \ No newline at end of file diff --git a/examples/multi_index_example/README.txt b/examples/multi_index_example/README.txt new file mode 100644 index 0000000000..844225edaa --- /dev/null +++ b/examples/multi_index_example/README.txt @@ -0,0 +1,12 @@ +--- multi_index_example Project --- + + - How to Build - + - cd to 'build' directory + - run the command 'cmake ..' + - run the command 'make' + + - After build - + - The built smart contract is under the 'multi_index_example' directory in the 'build' directory + - You can then do a 'set contract' action with 'cleos' and point in to the './build/multi_index_example' directory + + - Additions to CMake should be done to the CMakeLists.txt in the './src' directory and not in the top level CMakeLists.txt \ No newline at end of file diff --git a/examples/multi_index_example/include/multi_index_example.hpp b/examples/multi_index_example/include/multi_index_example.hpp new file mode 100644 index 0000000000..49a8fe0b34 --- /dev/null +++ b/examples/multi_index_example/include/multi_index_example.hpp @@ -0,0 +1,30 @@ +#include +using namespace eosio; + +CONTRACT multi_index_example : public contract { + public: + using contract::contract; + multi_index_example( name receiver, name code, datastream ds ) + : contract(receiver, code, ds), testtab(receiver, receiver.value) {} + + ACTION set(name user); + ACTION print( name user ); + ACTION bysec( name secid ); + ACTION mod( name user, uint32_t n ); + + TABLE test_table { + name test_primary; + name secondary; + uint64_t datum; + uint64_t primary_key()const { return test_primary.value; } + uint64_t by_secondary()const { return secondary.value; } + }; + + typedef eosio::multi_index<"testtaba"_n, test_table, eosio::indexed_by<"secid"_n, eosio::const_mem_fun>> test_tables; + + using set_action = action_wrapper<"set"_n, &multi_index_example::set>; + using print_action = action_wrapper<"print"_n, &multi_index_example::print>; + using bysec_action = action_wrapper<"bysec"_n, &multi_index_example::bysec>; + using mod_action = action_wrapper<"mod"_n, &multi_index_example::mod>; + test_tables testtab; +}; diff --git a/examples/multi_index_example/multi_index_example.cpp b/examples/multi_index_example/multi_index_example.cpp deleted file mode 100644 index c5b458758b..0000000000 --- a/examples/multi_index_example/multi_index_example.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include - -using namespace eosio; - -/* you can use this method of declaration */ -//class [[eosio::contract]] multi_index_example : public contract { -/* or this method of declaration if you don't want to use the c++ class name */ -//class [[eosio::contract("")]] multi_index_example : public contract { -CONTRACT multi_index_example : public contract { - public: - using contract::contract; - multi_index_example( name receiver, name code, datastream ds ) - : contract(receiver, code, ds), testtab(receiver, receiver.value) {} - -// [[eosio::action]] -// void set( name user ) { - ACTION set(name user) { - auto itr = testtab.find(user.value); - if ( itr == testtab.end() ) { - testtab.emplace( _self, [&]( auto& u ) { - u.test_primary = user; - u.secondary = "second"_n; - u.datum = 0; - }); - } - } - -// [[eosio::action]] -// void print( name user ) { - ACTION print( name user ) { - auto itr = testtab.find(user.value); - eosio_assert( itr != testtab.end(), "test table not set" ); - eosio::print_f("Test Table : {%, %, %}\n", itr->test_primary, itr->secondary, itr->datum); - } - -// [[eosio::action]] -// void bysec( name user ) { - ACTION bysec( name secid ) { - auto idx = testtab.get_index<"secid"_n>(); - for ( auto itr = idx.begin(); itr != idx.end(); itr++ ) { - print( itr->test_primary ); - } - } - -// [[eosio::action]] -// void mod( name user, uint32_t n ) { - ACTION mod( name user, uint32_t n ) { - auto itr = testtab.find(user.value); - eosio_assert( itr != testtab.end(), "test table not set" ); - testtab.modify( itr, _self, [&]( auto& row ) { - row.secondary = user; - row.datum = n; - }); - } - -// struct [[eosio::table]] test_table { - TABLE test_table { - name test_primary; - name secondary; - uint64_t datum; - uint64_t primary_key()const { return test_primary.value; } - uint64_t by_secondary()const { return secondary.value; } - }; - - typedef eosio::multi_index<"testtaba"_n, test_table, eosio::indexed_by<"secid"_n, eosio::const_mem_fun>> test_tables; - - using set_action = action_wrapper<"set"_n, &multi_index_example::set>; - using print_action = action_wrapper<"print"_n, &multi_index_example::print>; - using bysec_action = action_wrapper<"bysec"_n, &multi_index_example::bysec>; - using mod_action = action_wrapper<"mod"_n, &multi_index_example::mod>; - private: - test_tables testtab; -}; - -EOSIO_DISPATCH( multi_index_example, (set)(print)(mod)(bysec) ) diff --git a/examples/multi_index_example/ricardian/multi_index_example.contracts.md b/examples/multi_index_example/ricardian/multi_index_example.contracts.md new file mode 100644 index 0000000000..5c7d6556a7 --- /dev/null +++ b/examples/multi_index_example/ricardian/multi_index_example.contracts.md @@ -0,0 +1,3 @@ +

hi

+ +Stub for hi action's ricardian contract \ No newline at end of file diff --git a/examples/multi_index_example/src/CMakeLists.txt b/examples/multi_index_example/src/CMakeLists.txt new file mode 100644 index 0000000000..0889faf997 --- /dev/null +++ b/examples/multi_index_example/src/CMakeLists.txt @@ -0,0 +1,8 @@ +project(multi_index_example) + +set(EOSIO_WASM_OLD_BEHAVIOR "Off") +find_package(eosio.cdt) + +add_contract( multi_index_example multi_index_example multi_index_example.cpp ) +target_include_directories( multi_index_example PUBLIC ${CMAKE_SOURCE_DIR}/../include ) +target_ricardian_directory( multi_index_example ${CMAKE_SOURCE_DIR}/../ricardian ) \ No newline at end of file diff --git a/examples/multi_index_example/src/multi_index_example.cpp b/examples/multi_index_example/src/multi_index_example.cpp new file mode 100644 index 0000000000..c473200dcd --- /dev/null +++ b/examples/multi_index_example/src/multi_index_example.cpp @@ -0,0 +1,37 @@ +#include +ACTION multi_index_example::set( name user ) { + auto itr = testtab.find(user.value); + if ( itr == testtab.end() ) { + testtab.emplace( _self, [&]( auto& u ) { + u.test_primary = user; + u.secondary = "second"_n; + u.datum = 0; + }); + } +} + +ACTION multi_index_example::print( name user ) { + auto itr = testtab.find(user.value); + eosio_assert( itr != testtab.end(), "test table not set" ); + eosio::print_f("Test Table : {%, %, %}\n", itr->test_primary, itr->secondary, itr->datum); +} + +ACTION multi_index_example::bysec( name secid ) { + auto idx = testtab.get_index<"secid"_n>(); + for ( auto itr = idx.begin(); itr != idx.end(); itr++ ) { + print( itr->test_primary ); + } +} + + +ACTION multi_index_example::mod( name user, uint32_t n ) { + auto itr = testtab.find(user.value); + eosio_assert( itr != testtab.end(), "test table not set" ); + testtab.modify( itr, _self, [&]( auto& row ) { + row.secondary = user; + row.datum = n; + }); +} + + +EOSIO_DISPATCH( multi_index_example, (set)(print)(mod)(bysec) ) diff --git a/examples/send_inline/CMakeLists.txt b/examples/send_inline/CMakeLists.txt index 2e0ea7a063..2d33f42da5 100644 --- a/examples/send_inline/CMakeLists.txt +++ b/examples/send_inline/CMakeLists.txt @@ -1,9 +1,17 @@ -cmake_minimum_required(VERSION 3.5) -project(hello_example VERSION 1.0.0) +include(ExternalProject) +# if no cdt root is given use default path +if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) + find_package(eosio.cdt) +endif() -find_package(eosio.cdt) - -### Generate the wasm and abi -add_contract( send_inline send_inline send_inline.cpp ) - -target_include_directories( send_inline.wasm PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/../hello ) +ExternalProject_Add( + send_inline_project + SOURCE_DIR ${CMAKE_SOURCE_DIR}/src + BINARY_DIR ${CMAKE_BINARY_DIR}/send_inline + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 +) \ No newline at end of file diff --git a/examples/send_inline/README.txt b/examples/send_inline/README.txt new file mode 100644 index 0000000000..cf339a7835 --- /dev/null +++ b/examples/send_inline/README.txt @@ -0,0 +1,12 @@ +--- send_inline Project --- + + - How to Build - + - cd to 'build' directory + - run the command 'cmake ..' + - run the command 'make' + + - After build - + - The built smart contract is under the 'send_inline' directory in the 'build' directory + - You can then do a 'set contract' action with 'cleos' and point in to the './build/send_inline' directory + + - Additions to CMake should be done to the CMakeLists.txt in the './src' directory and not in the top level CMakeLists.txt \ No newline at end of file diff --git a/examples/send_inline/include/send_inline.hpp b/examples/send_inline/include/send_inline.hpp new file mode 100644 index 0000000000..c29463ef19 --- /dev/null +++ b/examples/send_inline/include/send_inline.hpp @@ -0,0 +1,11 @@ +#include +using namespace eosio; + +CONTRACT send_inline : public contract { + public: + using contract::contract; + + ACTION test( name user, name inline_code ); + + using test_action = action_wrapper<"test"_n, &send_inline::test>; +}; diff --git a/examples/send_inline/ricardian/send_inline.contracts.md b/examples/send_inline/ricardian/send_inline.contracts.md new file mode 100644 index 0000000000..5c7d6556a7 --- /dev/null +++ b/examples/send_inline/ricardian/send_inline.contracts.md @@ -0,0 +1,3 @@ +

hi

+ +Stub for hi action's ricardian contract \ No newline at end of file diff --git a/examples/send_inline/send_inline.cpp b/examples/send_inline/send_inline.cpp deleted file mode 100644 index d59396ee73..0000000000 --- a/examples/send_inline/send_inline.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include -#include - -using namespace eosio; - -CONTRACT send_inline : public eosio::contract { - public: - using contract::contract; - - ACTION test( name user, name inline_code ) { - print_f( "Hello % from send_inline", user ); - // constructor takes two arguments (the code the contract is deployed on and the set of permissions) - hello::hi_action hi(inline_code, {_self, "active"_n}); - hi.send(user); - } - - // accessor for external contracts to easily send inline actions to your contract - using test_action = action_wrapper<"test"_n, &send_inline::test>; -}; - -EOSIO_DISPATCH( send_inline, (test) ) diff --git a/examples/send_inline/src/CMakeLists.txt b/examples/send_inline/src/CMakeLists.txt new file mode 100644 index 0000000000..33c2030ca3 --- /dev/null +++ b/examples/send_inline/src/CMakeLists.txt @@ -0,0 +1,9 @@ +project(send_inline) + +set(EOSIO_WASM_OLD_BEHAVIOR "Off") +find_package(eosio.cdt) + +add_contract( send_inline send_inline send_inline.cpp ) +target_include_directories( send_inline PUBLIC ${CMAKE_SOURCE_DIR}/../include ) +target_include_directories( send_inline PUBLIC ${CMAKE_SOURCE_DIR}/../../hello/include ) +target_ricardian_directory( send_inline ${CMAKE_SOURCE_DIR}/../ricardian ) diff --git a/examples/send_inline/src/send_inline.cpp b/examples/send_inline/src/send_inline.cpp new file mode 100644 index 0000000000..058c613221 --- /dev/null +++ b/examples/send_inline/src/send_inline.cpp @@ -0,0 +1,10 @@ +#include +#include +ACTION send_inline::test( name user, name inline_code ) { + print_f( "Hello % from send_inline", user ); + // constructor takes two arguments (the code the contract is deployed on and the set of permissions) + hello::hi_action hi(inline_code, {_self, "active"_n}); + hi.send(user); +} + +EOSIO_DISPATCH( send_inline, (test) ) diff --git a/examples/template/CMakeLists.txt b/examples/template/CMakeLists.txt deleted file mode 100644 index 17a1ba9d40..0000000000 --- a/examples/template/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -cmake_minimum_required(VERSION 3.5) -project(template_example VERSION 1.0.0) - -find_package(eosio.cdt) - -# add contract -add_contract( , , ) diff --git a/eosio.imports.in b/imports/eosio.imports.in similarity index 99% rename from eosio.imports.in rename to imports/eosio.imports.in index dfc3b18f0c..2947e511af 100644 --- a/eosio.imports.in +++ b/imports/eosio.imports.in @@ -1,4 +1,3 @@ -call_depth_assert __ashlti3 __ashrti3 __lshlti3 @@ -53,7 +52,6 @@ set_name_list_packed set_guaranteed_minimum_resources is_privileged set_privileged -checktime get_active_producers db_idx64_store db_idx64_remove diff --git a/install.sh b/install.sh index ad70f43c0e..5e9e16f61d 100755 --- a/install.sh +++ b/install.sh @@ -63,7 +63,9 @@ create_symlink "eosio-cpp eosio-cpp" create_symlink "eosio-ld eosio-ld" create_symlink "eosio-pp eosio-pp" + create_symlink "eosio-init eosio-init" create_symlink "eosio-abigen eosio-abigen" + create_symlink "eosio-abidiff eosio-abidiff" create_symlink "eosio-wasm2wast eosio-wasm2wast" create_symlink "eosio-wast2wasm eosio-wast2wasm" } diff --git a/libraries/CMakeLists.txt b/libraries/CMakeLists.txt index dc30f7e760..af364350b0 100644 --- a/libraries/CMakeLists.txt +++ b/libraries/CMakeLists.txt @@ -1,3 +1,8 @@ +project(eosio_libraries) + +list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_BIN}) +include(EosioCDTMacros) + set(CMAKE_C_FLAGS " ${CMAKE_C_FLAGS} -O3 -Wall ") set(CMAKE_CXX_FLAGS " ${CMAKE_CXX_FLAGS} -O3 -Wall ") @@ -5,3 +10,4 @@ add_subdirectory(libc) add_subdirectory(libc++) add_subdirectory(eosiolib) add_subdirectory(boost) +add_subdirectory(native) diff --git a/libraries/boost/CMakeLists.txt b/libraries/boost/CMakeLists.txt index 86aad11bbc..c053e1fae4 100644 --- a/libraries/boost/CMakeLists.txt +++ b/libraries/boost/CMakeLists.txt @@ -1,2 +1 @@ -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost DESTINATION ${CMAKE_BINARY_DIR}/include) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/include/boost DESTINATION ${BASE_BINARY_DIR}/include) diff --git a/libraries/eosiolib/CMakeLists.txt b/libraries/eosiolib/CMakeLists.txt index b9a92cd8c1..988722e612 100644 --- a/libraries/eosiolib/CMakeLists.txt +++ b/libraries/eosiolib/CMakeLists.txt @@ -6,16 +6,35 @@ add_library(eosio crypto.cpp ${HEADERS}) +add_native_library(native_eosio + eosiolib.cpp + crypto.cpp + ${HEADERS}) + target_include_directories(eosio PUBLIC - "$" - $) + ${CMAKE_SOURCE_DIR}/libc/musl/include + ${CMAKE_SOURCE_DIR}/libc/musl/src/internal + ${CMAKE_SOURCE_DIR}/libc/musl/src/crypt + ${CMAKE_SOURCE_DIR}/libc/musl/arch/eos + {CMAKE_SOURCE_DIR}/libcxx/include + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/boost/include) + +target_include_directories(native_eosio PUBLIC + ${CMAKE_SOURCE_DIR}/libc/musl/include + ${CMAKE_SOURCE_DIR}/libc/musl/src/internal + ${CMAKE_SOURCE_DIR}/libc/musl/src/crypt + ${CMAKE_SOURCE_DIR}/libc/musl/arch/eos + ${CMAKE_SOURCE_DIR}/libcxx/include + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/boost/include) target_link_libraries( eosio c c++ ) +target_link_libraries( native_eosio native_c native_c++ ) +add_dependencies( native_eosio eosio ) + -install(TARGETS eosio EXPORT EosioLib - LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) +add_custom_command( TARGET eosio POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) +add_custom_command( TARGET native_eosio POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../eosiolib DESTINATION ${CMAKE_BINARY_DIR}/include FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") -add_custom_command( TARGET eosio POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/lib ) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../eosiolib DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/../eosiolib DESTINATION ${BASE_BINARY_DIR}/include FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp") diff --git a/libraries/eosiolib/action.h b/libraries/eosiolib/action.h index 49265ab836..25f7b6412c 100644 --- a/libraries/eosiolib/action.h +++ b/libraries/eosiolib/action.h @@ -1,21 +1,14 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +#include "system.hpp" extern "C" { /** - * @defgroup actionapi Action API - * @ingroup contractdev - * @brief Defines API for for querying action and sending action - * - */ - - /** - * @defgroup actioncapi Action C API - * @ingroup actionapi + * @addtogroup action_c Action C API + * @ingroup c_api * @brief Defines API for querying action and sending action * * @@ -25,7 +18,7 @@ extern "C" { * struct action { * capi_name account_name; // the contract defining the primary code to execute for code/type * capi_name action_name; // the action to be taken - * permission_level[] authorization; // the accounts and permission levels provided + * permission_level authorization; // the accounts and permission levels provided * bytes data; // opaque data processed by code * }; * ``` @@ -68,10 +61,10 @@ extern "C" { */ /** - * Copy up to @ref len bytes of current action data to the specified location + * Copy up to length bytes of current action data to the specified location * * @brief Copy current action data to the specified location - * @param msg - a pointer where up to @ref len bytes of the current action data will be copied + * @param msg - a pointer where up to length bytes of the current action data will be copied * @param len - len of the current action data to be copied, 0 to report required size * @return the number of bytes copied to msg, or number of bytes that can be copied if len==0 passed * @pre `msg` is a valid pointer to a range of memory at least `len` bytes long @@ -96,7 +89,7 @@ extern "C" { void require_recipient( capi_name name ); /** - * Verifies that @ref name exists in the set of provided auths on a action. Throws if not found. + * Verifies that name exists in the set of provided auths on a action. Throws if not found. * * @brief Verify specified account exists in the set of provided auths * @param name - name of the account to be verified @@ -104,15 +97,15 @@ extern "C" { void require_auth( capi_name name ); /** - * Verifies that @ref name has auth. + * Verifies that name has auth. * - * @brief Verifies that @ref name has auth. + * @brief Verifies that name has auth. * @param name - name of the account to be verified */ bool has_auth( capi_name name ); /** - * Verifies that @ref name exists in the set of provided auths on a action. Throws if not found. + * Verifies that name exists in the set of provided auths on a action. Throws if not found. * * @brief Verify specified account exists in the set of provided auths * @param name - name of the account to be verified @@ -138,6 +131,7 @@ extern "C" { void send_inline(char *serialized_action, size_t size); /** + * /function * Send an inline context free action in the context of this action's parent transaction * * @param serialized_action - serialized action @@ -159,5 +153,6 @@ extern "C" { * @return the account which specifies the current receiver of the action */ capi_name current_receiver(); - ///@ } actioncapi + + /// @} action } diff --git a/libraries/eosiolib/action.hpp b/libraries/eosiolib/action.hpp index 48efc22d5e..07997e94ce 100644 --- a/libraries/eosiolib/action.hpp +++ b/libraries/eosiolib/action.hpp @@ -1,11 +1,12 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include +#include "action.h" +#include "datastream.hpp" +#include "serialize.hpp" +#include "memory.hpp" #include #include @@ -15,18 +16,15 @@ namespace eosio { /** - * @defgroup actioncppapi Action C++ API - * @ingroup actionapi - * @brief Defines type-safe C++ wrappers for querying action and sending action + * @addtogroup action Action C++ API + * @ingroup cpp_api + * @brief Defines type-safe C++ wrapers for querying action and sending action * - * @note There are some methods from the @ref actioncapi that can be used directly from C++ - * - * @{ + * @note There are some methods from the @ref action that can be used directly from C++ + * @{ */ /** - * - * This method unpacks the current action at type T. * * @brief Interpret the action body as type T. * @return Unpacked action data casted as T. @@ -44,6 +42,7 @@ namespace eosio { * dummy_action msg = unpack_action_data(); * @endcode */ + template T unpack_action_data() { constexpr size_t max_stack_buffer_size = 512; @@ -268,7 +267,7 @@ namespace eosio { * @pre This action should not contain any authorizations */ void send_context_free() const { - eosio_assert( authorization.size() == 0, "context free actions cannot have authorizations"); + eosio::check( authorization.size() == 0, "context free actions cannot have authorizations"); auto serialize = pack(*this); ::send_context_free_inline(serialize.data(), serialize.size()); } @@ -480,8 +479,7 @@ INLINE_ACTION_SENDER3( CONTRACT_CLASS, NAME, ::eosio::name(#NAME) ) #define INLINE_ACTION_SENDER(...) BOOST_PP_OVERLOAD(INLINE_ACTION_SENDER,__VA_ARGS__)(__VA_ARGS__) /** - * @addtogroup actioncppapi - * Additional documentation for group + * @addtogroup action * @{ */ diff --git a/libraries/eosiolib/asset.hpp b/libraries/eosiolib/asset.hpp index f71e4c670d..c68dcb01a1 100644 --- a/libraries/eosiolib/asset.hpp +++ b/libraries/eosiolib/asset.hpp @@ -1,51 +1,37 @@ #pragma once -#include -#include -#include -#include +#include "serialize.hpp" +#include "print.hpp" +#include "system.hpp" +#include "symbol.hpp" + #include #include namespace eosio { - - /** - * @defgroup assetapi Asset API - * @brief Defines API for managing assets - * @ingroup contractdev - */ - /** - * @defgroup assetcppapi Asset CPP API - * @brief Defines %CPP API for managing assets - * @ingroup assetapi + * Defines %CPP API for managing assets + * @addtogroup asset Asset CPP API + * @ingroup cpp_api * @{ */ /** - * \struct Stores information for owner of asset - * - * @brief Stores information for owner of asset + * @struct Stores information for owner of asset */ struct asset { /** * The amount of the asset - * - * @brief The amount of the asset */ int64_t amount = 0; /** * The symbol name of the asset - * - * @brief The symbol name of the asset */ symbol symbol; /** * Maximum amount possible for this asset. It's capped to 2^62 - 1 - * - * @brief Maximum amount possible for this asset */ static constexpr int64_t max_amount = (1LL << 62) - 1; @@ -54,21 +40,19 @@ namespace eosio { /** * Construct a new asset given the symbol name and the amount * - * @brief Construct a new asset object * @param a - The amount of the asset * @param s - The name of the symbol */ asset( int64_t a, class symbol s ) :amount(a),symbol{s} { - eosio_assert( is_amount_within_range(), "magnitude of asset amount must be less than 2^62" ); - eosio_assert( symbol.is_valid(), "invalid symbol name" ); + eosio::check( is_amount_within_range(), "magnitude of asset amount must be less than 2^62" ); + eosio::check( symbol.is_valid(), "invalid symbol name" ); } /** * Check if the amount doesn't exceed the max amount * - * @brief Check if the amount doesn't exceed the max amount * @return true - if the amount doesn't exceed the max amount * @return false - otherwise */ @@ -77,7 +61,6 @@ namespace eosio { /** * Check if the asset is valid. %A valid asset has its amount <= max_amount and its symbol name valid * - * @brief Check if the asset is valid * @return true - if the asset is valid * @return false - otherwise */ @@ -86,18 +69,16 @@ namespace eosio { /** * Set the amount of the asset * - * @brief Set the amount of the asset * @param a - New amount for the asset */ void set_amount( int64_t a ) { amount = a; - eosio_assert( is_amount_within_range(), "magnitude of asset amount must be less than 2^62" ); + eosio::check( is_amount_within_range(), "magnitude of asset amount must be less than 2^62" ); } /** * Unary minus operator * - * @brief Unary minus operator * @return asset - New asset with its amount is the negative amount of this asset */ asset operator-()const { @@ -109,39 +90,36 @@ namespace eosio { /** * Subtraction assignment operator * - * @brief Subtraction assignment operator * @param a - Another asset to subtract this asset with * @return asset& - Reference to this asset * @post The amount of this asset is subtracted by the amount of asset a */ asset& operator-=( const asset& a ) { - eosio_assert( a.symbol == symbol, "attempt to subtract asset with different symbol" ); + eosio::check( a.symbol == symbol, "attempt to subtract asset with different symbol" ); amount -= a.amount; - eosio_assert( -max_amount <= amount, "subtraction underflow" ); - eosio_assert( amount <= max_amount, "subtraction overflow" ); + eosio::check( -max_amount <= amount, "subtraction underflow" ); + eosio::check( amount <= max_amount, "subtraction overflow" ); return *this; } /** * Addition Assignment operator * - * @brief Addition Assignment operator * @param a - Another asset to subtract this asset with * @return asset& - Reference to this asset * @post The amount of this asset is added with the amount of asset a */ asset& operator+=( const asset& a ) { - eosio_assert( a.symbol == symbol, "attempt to add asset with different symbol" ); + eosio::check( a.symbol == symbol, "attempt to add asset with different symbol" ); amount += a.amount; - eosio_assert( -max_amount <= amount, "addition underflow" ); - eosio_assert( amount <= max_amount, "addition overflow" ); + eosio::check( -max_amount <= amount, "addition underflow" ); + eosio::check( amount <= max_amount, "addition overflow" ); return *this; } /** * Addition operator * - * @brief Addition operator * @param a - The first asset to be added * @param b - The second asset to be added * @return asset - New asset as the result of addition @@ -155,7 +133,6 @@ namespace eosio { /** * Subtraction operator * - * @brief Subtraction operator * @param a - The asset to be subtracted * @param b - The asset used to subtract * @return asset - New asset as the result of subtraction of a with b @@ -167,17 +144,17 @@ namespace eosio { } /** - * Multiplication assignment operator. Multiply the amount of this asset with a number and then assign the value to itself. - * * @brief Multiplication assignment operator, with a number + * + * @details Multiplication assignment operator. Multiply the amount of this asset with a number and then assign the value to itself. * @param a - The multiplier for the asset's amount * @return asset - Reference to this asset * @post The amount of this asset is multiplied by a */ asset& operator*=( int64_t a ) { int128_t tmp = (int128_t)amount * (int128_t)a; - eosio_assert( tmp <= max_amount, "multiplication overflow" ); - eosio_assert( tmp >= -max_amount, "multiplication underflow" ); + eosio::check( tmp <= max_amount, "multiplication overflow" ); + eosio::check( tmp >= -max_amount, "multiplication underflow" ); amount = (int64_t)tmp; return *this; } @@ -200,7 +177,6 @@ namespace eosio { /** * Multiplication operator, with a number preceeding * - * @brief Multiplication operator, with a number preceeding * @param a - The multiplier for the asset's amount * @param b - The asset to be multiplied * @return asset - New asset as the result of multiplication @@ -212,16 +188,16 @@ namespace eosio { } /** - * Division assignment operator. Divide the amount of this asset with a number and then assign the value to itself. - * * @brief Division assignment operator, with a number + * + * @details Division assignment operator. Divide the amount of this asset with a number and then assign the value to itself. * @param a - The divisor for the asset's amount * @return asset - Reference to this asset * @post The amount of this asset is divided by a */ asset& operator/=( int64_t a ) { - eosio_assert( a != 0, "divide by zero" ); - eosio_assert( !(amount == std::numeric_limits::min() && a == -1), "signed division overflow" ); + eosio::check( a != 0, "divide by zero" ); + eosio::check( !(amount == std::numeric_limits::min() && a == -1), "signed division overflow" ); amount /= a; return *this; } @@ -229,7 +205,6 @@ namespace eosio { /** * Division operator, with a number proceeding * - * @brief Division operator, with a number proceeding * @param a - The asset to be divided * @param b - The divisor for the asset's amount * @return asset - New asset as the result of division @@ -243,22 +218,20 @@ namespace eosio { /** * Division operator, with another asset * - * @brief Division operator, with another asset * @param a - The asset which amount acts as the dividend * @param b - The asset which amount acts as the divisor * @return int64_t - the resulted amount after the division * @pre Both asset must have the same symbol */ friend int64_t operator/( const asset& a, const asset& b ) { - eosio_assert( b.amount != 0, "divide by zero" ); - eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( b.amount != 0, "divide by zero" ); + eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); return a.amount / b.amount; } /** * Equality operator * - * @brief Equality operator * @param a - The first asset to be compared * @param b - The second asset to be compared * @return true - if both asset has the same amount @@ -266,14 +239,13 @@ namespace eosio { * @pre Both asset must have the same symbol */ friend bool operator==( const asset& a, const asset& b ) { - eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); return a.amount == b.amount; } /** * Inequality operator * - * @brief Inequality operator * @param a - The first asset to be compared * @param b - The second asset to be compared * @return true - if both asset doesn't have the same amount @@ -287,7 +259,6 @@ namespace eosio { /** * Less than operator * - * @brief Less than operator * @param a - The first asset to be compared * @param b - The second asset to be compared * @return true - if the first asset's amount is less than the second asset amount @@ -295,14 +266,13 @@ namespace eosio { * @pre Both asset must have the same symbol */ friend bool operator<( const asset& a, const asset& b ) { - eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); return a.amount < b.amount; } /** * Less or equal to operator * - * @brief Less or equal to operator * @param a - The first asset to be compared * @param b - The second asset to be compared * @return true - if the first asset's amount is less or equal to the second asset amount @@ -310,14 +280,13 @@ namespace eosio { * @pre Both asset must have the same symbol */ friend bool operator<=( const asset& a, const asset& b ) { - eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); return a.amount <= b.amount; } /** * Greater than operator * - * @brief Greater than operator * @param a - The first asset to be compared * @param b - The second asset to be compared * @return true - if the first asset's amount is greater than the second asset amount @@ -325,14 +294,13 @@ namespace eosio { * @pre Both asset must have the same symbol */ friend bool operator>( const asset& a, const asset& b ) { - eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); return a.amount > b.amount; } /** * Greater or equal to operator * - * @brief Greater or equal to operator * @param a - The first asset to be compared * @param b - The second asset to be compared * @return true - if the first asset's amount is greater or equal to the second asset amount @@ -340,7 +308,7 @@ namespace eosio { * @pre Both asset must have the same symbol */ friend bool operator>=( const asset& a, const asset& b ) { - eosio_assert( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); + eosio::check( a.symbol == b.symbol, "comparison of assets with different symbols is not allowed" ); return a.amount >= b.amount; } @@ -394,9 +362,7 @@ namespace eosio { }; /** - * \struct Extended asset which stores the information of the owner of the asset - * - * @brief Extended asset which stores the information of the owner of the asset + * @struct Extended asset which stores the information of the owner of the asset */ struct extended_asset { /** @@ -406,43 +372,32 @@ namespace eosio { /** * The owner of the asset - * - * @brief The owner of the asset */ name contract; /** * Get the extended symbol of the asset * - * @brief Get the extended symbol of the asset * @return extended_symbol - The extended symbol of the asset */ extended_symbol get_extended_symbol()const { return extended_symbol{ quantity.symbol, contract }; } /** * Default constructor - * - * @brief Construct a new extended asset object */ extended_asset() = default; /** * Construct a new extended asset given the amount and extended symbol - * - * @brief Construct a new extended asset object */ extended_asset( int64_t v, extended_symbol s ):quantity(v,s.get_symbol()),contract(s.get_contract()){} /** * Construct a new extended asset given the asset and owner name - * - * @brief Construct a new extended asset object */ extended_asset( asset a, name c ):quantity(a),contract(c){} /** * %Print the extended asset - * - * @brief %Print the extended asset */ void print()const { quantity.print(); @@ -453,7 +408,6 @@ namespace eosio { /** * Unary minus operator * - * @brief Unary minus operator * @return extended_asset - New extended asset with its amount is the negative amount of this extended asset */ extended_asset operator-()const { @@ -461,50 +415,50 @@ namespace eosio { } /** - * Subtraction operator. This subtracts the amount of the extended asset. - * * @brief Subtraction operator + * + * @details Subtraction operator. This subtracts the amount of the extended asset. * @param a - The extended asset to be subtracted * @param b - The extended asset used to subtract * @return extended_asset - New extended asset as the result of subtraction * @pre The owner of both extended asset need to be the same */ friend extended_asset operator - ( const extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); return {a.quantity - b.quantity, a.contract}; } /** - * Addition operator. This adds the amount of the extended asset. - * * @brief Addition operator + * + * @details Addition operator. This adds the amount of the extended asset. * @param a - The extended asset to be added * @param b - The extended asset to be added * @return extended_asset - New extended asset as the result of addition * @pre The owner of both extended asset need to be the same */ friend extended_asset operator + ( const extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); return {a.quantity + b.quantity, a.contract}; } /// Addition operator. friend extended_asset& operator+=( extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); a.quantity += b.quantity; return a; } /// Subtraction operator. friend extended_asset& operator-=( extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); a.quantity -= b.quantity; return a; } /// Less than operator friend bool operator<( const extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); return a.quantity < b.quantity; } @@ -521,13 +475,13 @@ namespace eosio { /// Comparison operator friend bool operator<=( const extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); return a.quantity <= b.quantity; } /// Comparison operator friend bool operator>=( const extended_asset& a, const extended_asset& b ) { - eosio_assert( a.contract == b.contract, "type mismatch" ); + eosio::check( a.contract == b.contract, "type mismatch" ); return a.quantity >= b.quantity; } @@ -535,4 +489,4 @@ namespace eosio { }; /// @} asset type -} /// namespace eosio +} diff --git a/libraries/eosiolib/binary_extension.hpp b/libraries/eosiolib/binary_extension.hpp index 0ef3308f7c..af45425bd2 100644 --- a/libraries/eosiolib/binary_extension.hpp +++ b/libraries/eosiolib/binary_extension.hpp @@ -1,9 +1,12 @@ #pragma once - #include +#include "print.hpp" + namespace eosio { /** + * Container to hold a binary payload for an extension + * * @defgroup binary_extension Binary Extension - * @brief container to hold a binary payload for an extension + * @ingroup cpp_api * @ingroup types * @{ */ diff --git a/libraries/eosiolib/chain.h b/libraries/eosiolib/chain.h index 8b624d5dae..e33bbf0d57 100644 --- a/libraries/eosiolib/chain.h +++ b/libraries/eosiolib/chain.h @@ -1,28 +1,21 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +#include "types.h" /** - * @defgroup chainapi Chain API - * @brief Defines API for querying internal chain state - * @ingroup contractdev - */ - -/** - * @defgroup chaincapi Chain C API + * @addtogroup chain + * @ingroup c_api * @brief Defines %C API for querying internal chain state - * @ingroup chainapi * @{ */ extern "C" { /** * Gets the set of active producers. - * @brief Gets the set of active producers. * * @param producers - Pointer to a buffer of account names * @param datalen - Byte length of buffer, when passed 0 will return the size required to store full output. @@ -40,6 +33,6 @@ extern "C" { */ uint32_t get_active_producers( capi_name* producers, uint32_t datalen ); - - ///@ } chaincapi } + +/// @} diff --git a/libraries/eosiolib/compiler_builtins.h b/libraries/eosiolib/compiler_builtins.h index 62e2ff2515..1ca7f302fd 100644 --- a/libraries/eosiolib/compiler_builtins.h +++ b/libraries/eosiolib/compiler_builtins.h @@ -1,23 +1,20 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +/** + * @addtogroup compiler_builtins + * @ingroup c_api + * @brief Declares int128 helper builtins generated by the toolchain. + * @{ + */ extern "C" { - /** - * @defgroup compilerbuiltinsapi Compiler Builtins API - * @ingroup mathapi - * @brief Declares int128 helper builtins generated by the toolchain. - * - * @{ - */ - /** * Multiply two 128 bit integers split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Multiply two 128 unsigned bit integers (which are represented as two 64 bit unsigned integers. + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -37,7 +34,7 @@ extern "C" { /** * Divide two 128 bit integers split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Divide two 128 bit integers (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -57,7 +54,7 @@ extern "C" { /** * Divide two 128 bit unsigned integers split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Divide two 128 unsigned bit integers (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -76,7 +73,7 @@ extern "C" { /** * Perform modular arithmetic on two 128 bit integers split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Perform modular arithmetic on two 128 bit integers (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -96,7 +93,7 @@ extern "C" { /** * Perform modular arithmetic on two 128 unsigned bit integers split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Perform modular arithmetic on two 128 unsigned bit integers (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -116,7 +113,7 @@ extern "C" { /** * Perform logical shift left on a 128 bit integer split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Perform logical shift left on a 128 bit integer (which is represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param lo Low 64 bits of the 128 bit factor. * @param hi High 64 bits of the 128 bit factor. @@ -134,7 +131,7 @@ extern "C" { /** * Perform logical shift right on a 128 bit integer split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Perform logical shift right on a 128 bit integer (which is represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param lo Low 64 bits of the 128 bit factor. * @param hi High 64 bits of the 128 bit factor. @@ -152,7 +149,7 @@ extern "C" { /** * Perform arithmetic shift left on a 128 bit integer split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Perform arithmetic shift left on a 128 bit integer (which is represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param lo Low 64 bits of the 128 bit factor. * @param hi High 64 bits of the 128 bit factor. @@ -170,7 +167,7 @@ extern "C" { /** * Perform arithmetic shift right on a 128 bit integer split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Perform arithmetic shift right on a 128 bit integer (which is represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param lo Low 64 bits of the 128 bit factor. * @param hi High 64 bits of the 128 bit factor. @@ -188,7 +185,7 @@ extern "C" { /** * Add two long doubles split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Add two long doubles (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -200,7 +197,7 @@ extern "C" { /** * Subtract two long doubles split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Subtract two long doubles (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -208,11 +205,11 @@ extern "C" { * @param hb High 64 bits of the second 128 bit factor. * @post `ret` is replaced with the result of the operation */ - void __subtf3( long double& ret, uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + void __subtf3( long double& ret, uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** * Multiply two long doubles split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Multiply two long doubles (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -220,11 +217,11 @@ extern "C" { * @param hb High 64 bits of the second 128 bit factor. * @post `ret` is replaced with the result of the operation */ - void __multf3( long double& ret, uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + void __multf3( long double& ret, uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** * Divide two long doubles split as two 64 bit unsigned integers and assign the value to the first parameter. - * @brief Divide two long doubles (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -232,11 +229,11 @@ extern "C" { * @param hb High 64 bits of the second 128 bit factor. * @post `ret` is replaced with the result of the operation */ - void __divtf3( long double& ret, uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + void __divtf3( long double& ret, uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** * Check equality between two doubles split as two 64 bit unsigned integers - * @brief Check equality between two doubles (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -247,11 +244,11 @@ extern "C" { * @return -1 if a less than b * @return 1 if either a or b is NaN */ - int __eqtf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __eqtf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** * Check inequality between two doubles split as two 64 bit unsigned integers - * @brief Check inequality between two doubles (which are represented as two 64 bit unsigned integers) + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -262,12 +259,12 @@ extern "C" { * @return -1 if a less than b * @return1 if either a or b is NaN */ - int __netf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __netf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** - * Check if the first double is greater or equal to the second double, the doubles are split as two 64 bit unsigned integers - * @brief Check if the first double is greater or equal to the second double, (the doubles are represented as two 64 bit unsigned integers) + * Check if the first double is greater or equal to the second double, the doubles are split as two 64 bit unsigned integers + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -278,11 +275,11 @@ extern "C" { * @return -1 if a less than b * @return -1 if either a or b is NaN */ - int __getf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __getf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** - * Check if the first double is greater than the second double, the doubles are split as two 64 bit unsigned integers - * @brief Check if the first double is greater than the second double, (the doubles are represented as two 64 bit unsigned integers) + * Check if the first double is greater than the second double, the doubles are split as two 64 bit unsigned integers + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -293,11 +290,11 @@ extern "C" { * @return -1 if a less than b * @return 0 if either a or b is NaN */ - int __gttf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __gttf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** - * Check if the first double is less or equal to the second double, the doubles are split as two 64 bit unsigned integers - * @brief Check if the first double is less or equal to the second double, (the doubles are represented as two 64 bit unsigned integers) + * Check if the first double is less or equal to the second double, the doubles are split as two 64 bit unsigned integers + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -308,11 +305,11 @@ extern "C" { * @return -1 if a less than b * @return 1 if either a or b is NaN */ - int __letf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __letf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** - * Check if the first double is less than the second double, the doubles are split as two 64 bit unsigned integers - * @brief Check if the first double is less than the second double, (the doubles are represented as two 64 bit unsigned integers) + * Check if the first double is less than the second double, the doubles are split as two 64 bit unsigned integers + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -323,11 +320,11 @@ extern "C" { * @return -1 if a less than b * @return 0 if either a or b is NaN */ - int __lttf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __lttf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** - * Compare two doubles which are split as two 64 bit unsigned integers - * @brief Compare two doubles (the doubles are represented as two 64 bit unsigned integers) + * Compare two doubles which are split as two 64 bit unsigned integers + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -338,11 +335,11 @@ extern "C" { * @return -1 if a less than b * @return 1 if either a or b is NaN */ - int __cmptf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __cmptf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** - * Check if either of the doubles is NaN, the doubles are split as two 64 bit unsigned integers - * @brief Check if either of the doubles is NaN, (the doubles are represented as two 64 bit unsigned integers) + * Check if either of the doubles is NaN, the doubles are split as two 64 bit unsigned integers + * * @param res It will be replaced with the result product. * @param la Low 64 bits of the first 128 bit factor. * @param ha High 64 bits of the first 128 bit factor. @@ -351,81 +348,82 @@ extern "C" { * @return 1 if either a or b is NaN * @return 0 if either a or b is not NaN */ - int __unordtf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); + int __unordtf2( uint64_t la, uint64_t ha, uint64_t lb, uint64_t hb ); /** * Extend float to long double - * @brief Extend float to long double + * * @param ret It will be replaced with the result product. * @param f Input float to be extended * @post `ret` is replaced with the extended float */ - void __extendsftf2( long double& ret, float f ); + void __extendsftf2( long double& ret, float f ); /** * Extend double to long double - * @brief Extend float to long double + * * @param ret It will be replaced with the result product. * @param f Input float to be extended * @post `ret` is replaced with the extended float */ - void __extenddftf2( long double& ret, double f ); + void __extenddftf2( long double& ret, double f ); /** * Convert long double (which are split as two 64 bit unsigned integers) into 64 bit integer - * @brief Convert long double (which are split as two 64 bit unsigned integers) into 64 bit integer + * * @param l Low 64 bits of the first 128 bit factor. * @param h High 64 bits of the first 128 bit factor. * @return the converted 64 bit integer. */ - int64_t __fixtfdi( uint64_t l, uint64_t h ); + int64_t __fixtfdi( uint64_t l, uint64_t h ); /** * Convert long double (which are split as two 64 bit unsigned integers) into 32 bit integer - * @brief Convert long double (which are split as two 64 bit unsigned integers) into 32 bit integer + * * @param l Low 64 bits of the first 128 bit factor. * @param h High 64 bits of the first 128 bit factor. * @return the converted 32 bit integer. */ - int32_t __fixtfsi( uint64_t l, uint64_t h ); + int32_t __fixtfsi( uint64_t l, uint64_t h ); /** * Convert long double (which are split as two 64 bit unsigned integers) into 64 bit unsigned integer - * @brief Convert long double (which are split as two 64 bit unsigned integers) into 64 bit unsigned integer + * * @param l Low 64 bits of the first 128 bit factor. * @param h High 64 bits of the first 128 bit factor. * @return the converted 64 bit unsigned integer. */ - uint64_t __fixunstfdi( uint64_t l, uint64_t h ); + uint64_t __fixunstfdi( uint64_t l, uint64_t h ); /** * Convert long double (which are split as two 64 bit unsigned integers) into 32 bit unsigned integer - * @brief Convert long double (which are split as two 64 bit unsigned integers) into 32 bit unsigned integer + * * @param l Low 64 bits of the first 128 bit factor. * @param h High 64 bits of the first 128 bit factor. * @return the converted 32 bit unsigned integer. */ - uint32_t __fixunstfsi( uint64_t l, uint64_t h ); + uint32_t __fixunstfsi( uint64_t l, uint64_t h ); /** + * * Truncate long double (which are split as two 64 bit unsigned integers) into double - * @brief Convert long double (which are split as two 64 bit unsigned integers) into double + * * @param l Low 64 bits of the first 128 bit factor. * @param h High 64 bits of the first 128 bit factor. * @return the converted double */ - double __trunctfdf2( uint64_t l, uint64_t h ); + double __trunctfdf2( uint64_t l, uint64_t h ); /** * Truncate long double (which are split as two 64 bit unsigned integers) into float - * @brief Convert long double (which are split as two 64 bit unsigned integers) into float + * * @param l Low 64 bits of the first 128 bit factor. * @param h High 64 bits of the first 128 bit factor. * @return the converted float */ - float __trunctfsf2( uint64_t l, uint64_t h ); + float __trunctfsf2( uint64_t l, uint64_t h ); void __break_point(); -/// @} -} // extern "C" + ///@} +} diff --git a/libraries/eosiolib/contract.hpp b/libraries/eosiolib/contract.hpp index b59b4d66e2..604541a7e0 100644 --- a/libraries/eosiolib/contract.hpp +++ b/libraries/eosiolib/contract.hpp @@ -1,18 +1,16 @@ #pragma once -#include -#include +#include "name.hpp" +#include "datastream.hpp" -namespace eosio { /** - * @defgroup contracttype Contract Type + * @defgroup contract Contract * @ingroup types * @brief Defines contract type which is %base class for every EOSIO contract - * * @{ - * */ +namespace eosio { /** * @brief %Base class for EOSIO contract. @@ -23,10 +21,9 @@ class contract { /** * Construct a new contract given the contract name * - * @brief Construct a new contract object. * @param receiver - The name of this contract * @param code - The code name of the action this contract is processing. - * @param ds - The datastream used + * @param ds - The datastream used */ contract( name receiver, name code, datastream ds ):_self(receiver),_code(code),_ds(ds) {} @@ -34,46 +31,38 @@ class contract { * * Get this contract name * - * @brief Get this contract name. * @return name - The name of this contract */ inline name get_self()const { return _self; } - + /** * The code name of the action this contract is processing. - * @brief The code name of the action this contract is processing. + * * @return name - The code name of the action this contract is processing. */ inline name get_code()const { return _code; } - + /** * Get the datastream for this contract - * @brief Get the datastream for this contract - * @return datastream - The datastream for this contract + * + * @return datastream - The datastream for this contract */ inline datastream get_datastream()const { return _ds; } protected: /** * The name of this contract - * - * @brief The name of this contract. */ name _self; /** * The code name of the action this contract is processing. - * - * @brief The code name of the action this contract is processing. */ name _code; /** * The datastream for this contract - *@ The datastream for this contract */ datastream _ds = datastream(nullptr, 0); }; - -/// @} contracttype -} /// namespace eosio +} diff --git a/libraries/eosiolib/crypto.cpp b/libraries/eosiolib/crypto.cpp index 2dfe956e09..e2103b65c7 100644 --- a/libraries/eosiolib/crypto.cpp +++ b/libraries/eosiolib/crypto.cpp @@ -1,10 +1,10 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ -#include -#include +#include "crypto.hpp" +#include "datastream.hpp" namespace eosio { diff --git a/libraries/eosiolib/crypto.h b/libraries/eosiolib/crypto.h index 87eeb7324b..5cb9dfaaf4 100644 --- a/libraries/eosiolib/crypto.h +++ b/libraries/eosiolib/crypto.h @@ -1,28 +1,20 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -extern "C" { +#include "types.h" /** - * @defgroup cryptoapi Chain API - * @brief Defines API for calculating and checking hash - * @ingroup contractdev - */ - -/** - * @defgroup cryptocapi Chain C API + * @addtogroup crypto Crypto * @brief Defines %C API for calculating and checking hash - * @ingroup chainapi * @{ */ +extern "C" { + /** * Tests if the sha256 hash generated from data matches the provided checksum. - * This method is optimized to a NO-OP when in fast evaluation mode. - * @brief Tests if the sha256 hash generated from data matches the provided checksum. * * @param data - Data you want to hash * @param length - Data length @@ -31,8 +23,10 @@ extern "C" { * @pre **assert256 hash** of `data` equals provided `hash` parameter. * @post Executes next statement. If was not `true`, hard return. * + * @note This method is optimized to a NO-OP when in fast evaluation mode. + * * Example: -* + * * @code * checksum hash; * char data; @@ -46,9 +40,8 @@ void assert_sha256( const char* data, uint32_t length, const capi_checksum256* h /** * Tests if the sha1 hash generated from data matches the provided checksum. - * This method is optimized to a NO-OP when in fast evaluation mode. - * @brief Tests if the sha1 hash generated from data matches the provided checksum. * + * @note This method is optimized to a NO-OP when in fast evaluation mode. * @param data - Data you want to hash * @param length - Data length * @param hash - `capi_checksum160*` hash to compare to @@ -71,9 +64,8 @@ void assert_sha1( const char* data, uint32_t length, const capi_checksum160* has /** * Tests if the sha512 hash generated from data matches the provided checksum. - * This method is optimized to a NO-OP when in fast evaluation mode. - * @brief Tests if the sha512 hash generated from data matches the provided checksum. * + * @note This method is optimized to a NO-OP when in fast evaluation mode. * @param data - Data you want to hash * @param length - Data length * @param hash - `capi_checksum512*` hash to compare to @@ -96,7 +88,6 @@ void assert_sha512( const char* data, uint32_t length, const capi_checksum512* h /** * Tests if the ripemod160 hash generated from data matches the provided checksum. - * @brief Tests if the ripemod160 hash generated from data matches the provided checksum. * * @param data - Data you want to hash * @param length - Data length @@ -120,7 +111,6 @@ void assert_ripemd160( const char* data, uint32_t length, const capi_checksum160 /** * Hashes `data` using `sha256` and stores result in memory pointed to by hash. - * @brief Hashes `data` using `sha256` and stores result in memory pointed to by hash. * * @param data - Data you want to hash * @param length - Data length @@ -138,7 +128,6 @@ void sha256( const char* data, uint32_t length, capi_checksum256* hash ); /** * Hashes `data` using `sha1` and stores result in memory pointed to by hash. - * @brief Hashes `data` using `sha1` and stores result in memory pointed to by hash. * * @param data - Data you want to hash * @param length - Data length @@ -156,7 +145,6 @@ void sha1( const char* data, uint32_t length, capi_checksum160* hash ); /** * Hashes `data` using `sha512` and stores result in memory pointed to by hash. - * @brief Hashes `data` using `sha512` and stores result in memory pointed to by hash. * * @param data - Data you want to hash * @param length - Data length @@ -174,7 +162,6 @@ void sha512( const char* data, uint32_t length, capi_checksum512* hash ); /** * Hashes `data` using `ripemod160` and stores result in memory pointed to by hash. - * @brief Hashes `data` using `ripemod160` and stores result in memory pointed to by hash. * * @param data - Data you want to hash * @param length - Data length @@ -192,7 +179,6 @@ void ripemd160( const char* data, uint32_t length, capi_checksum160* hash ); /** * Calculates the public key used for a given signature and hash used to create a message. - * @brief Calculates the public key used for a given signature and hash used to create a message. * * @param digest - Hash used to create a message * @param sig - Signature @@ -210,7 +196,6 @@ int recover_key( const capi_checksum256* digest, const char* sig, size_t siglen, /** * Tests a given public key with the generated key from digest and the signature. - * @brief Tests a given public key with the generated key from digest and the signature. * * @param digest - What the key will be generated from * @param sig - Signature @@ -236,6 +221,6 @@ int recover_key( const capi_checksum256* digest, const char* sig, size_t siglen, */ void assert_recover_key( const capi_checksum256* digest, const char* sig, size_t siglen, const char* pub, size_t publen ); -/// }@cryptocapi +/// @} } diff --git a/libraries/eosiolib/crypto.hpp b/libraries/eosiolib/crypto.hpp index 56942b5b87..065e38b237 100644 --- a/libraries/eosiolib/crypto.hpp +++ b/libraries/eosiolib/crypto.hpp @@ -1,13 +1,13 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include -#include +#include "crypto.h" +#include "fixed_bytes.hpp" +#include "varint.hpp" +#include "serialize.hpp" #include @@ -51,7 +51,7 @@ namespace eosio { /// @} publickeytype /** - * @defgroup signaturetype Public Key Type + * @defgroup signature Public Key Type * @ingroup types * @brief Specifies signature type * @@ -88,16 +88,9 @@ namespace eosio { /// @} signaturetype /** - * @defgroup cryptoapi Chain API + * @defgroup crypto Chain API + * @ingroup cpp_api * @brief Defines API for calculating and checking hashes - * @ingroup contractdev - * @{ - */ - - /** - * @defgroup cryptocppapi Chain C API - * @brief Defines type-safe C++ wrapers for calculating and checking hashes - * @ingroup chainapi * @{ */ @@ -204,6 +197,5 @@ namespace eosio { */ void assert_recover_key( const eosio::checksum256& digest, const eosio::signature& sig, const eosio::public_key& pubkey ); - /// }@cryptocppapi /// }@cryptoapi } diff --git a/libraries/eosiolib/datastream.hpp b/libraries/eosiolib/datastream.hpp index 4d2ffe1964..27d3e145cd 100644 --- a/libraries/eosiolib/datastream.hpp +++ b/libraries/eosiolib/datastream.hpp @@ -1,19 +1,22 @@ /** * @file datastream.hpp - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "system.hpp" +#include "types.h" +#include "symbol.hpp" +#include "fixed_bytes.hpp" +#include "fixed_key.hpp" +#include "crypto.hpp" +#include "ignore.hpp" +#include "varint.hpp" +#include "binary_extension.hpp" + #include #include +#include +#include #include #include #include @@ -27,29 +30,20 @@ #include - namespace eosio { /** - * @defgroup datastream Data Stream - * @brief Defines data stream for reading and writing data in the form of bytes - * @ingroup serialize - * @{ - */ - -/** - * %A data stream for reading and writing data in the form of bytes + * A data stream for reading and writing data in the form of bytes * - * @brief %A data stream for reading and writing data in the form of bytes. * @tparam T - Type of the datastream buffer */ template class datastream { public: /** - * Construct a new datastream object given the size of the buffer and start position of the buffer - * * @brief Construct a new datastream object + * + * @details Construct a new datastream object given the size of the buffer and start position of the buffer * @param start - The start position of the buffer * @param s - The size of the buffer */ @@ -59,7 +53,6 @@ class datastream { /** * Skips a specified number of bytes from this stream * - * @brief Skips a specific number of bytes from this stream * @param s - The number of bytes to skip */ inline void skip( size_t s ){ _pos += s; } @@ -67,13 +60,12 @@ class datastream { /** * Reads a specified number of bytes from the stream into a buffer * - * @brief Reads a specified number of bytes from this stream into a buffer * @param d - The pointer to the destination buffer * @param s - the number of bytes to read * @return true */ inline bool read( char* d, size_t s ) { - eosio_assert( size_t(_end - _pos) >= (size_t)s, "read" ); + eosio::check( size_t(_end - _pos) >= (size_t)s, "read" ); memcpy( d, _pos, s ); _pos += s; return true; @@ -82,13 +74,12 @@ class datastream { /** * Writes a specified number of bytes into the stream from a buffer * - * @brief Writes a specified number of bytes into the stream from a buffer * @param d - The pointer to the source buffer * @param s - The number of bytes to write * @return true */ inline bool write( const char* d, size_t s ) { - eosio_assert( _end - _pos >= (int32_t)s, "write" ); + eosio::check( _end - _pos >= (int32_t)s, "write" ); memcpy( (void*)_pos, d, s ); _pos += s; return true; @@ -102,7 +93,7 @@ class datastream { * @return true */ inline bool put(char c) { - eosio_assert( _pos < _end, "put" ); + eosio::check( _pos < _end, "put" ); *_pos = c; ++_pos; return true; @@ -126,7 +117,7 @@ class datastream { */ inline bool get( char& c ) { - eosio_assert( _pos < _end, "get" ); + eosio::check( _pos < _end, "get" ); c = *_pos; ++_pos; return true; @@ -269,6 +260,78 @@ class datastream { size_t _size; }; +/** + * Serialize an std::list into a stream + * + * @brief Serialize an std::list + * @param ds - The stream to write + * @param opt - The value to serialize + * @tparam Stream - Type of datastream buffer + * @return datastream& - Reference to the datastream + */ +template +inline datastream& operator<<(datastream& ds, const std::list& l) { + ds << unsigned_int( l.size() ); + for ( auto elem : l ) + ds << elem; + return ds; +} + +/** + * Deserialize an std::list from a stream + * + * @brief Deserialize an std::list + * @param ds - The stream to read + * @param opt - The destination for deserialized value + * @tparam Stream - Type of datastream buffer + * @return datastream& - Reference to the datastream + */ +template +inline datastream& operator>>(datastream& ds, std::list& l) { + unsigned_int s; + ds >> s; + l.resize(s.value); + for( auto& i : l ) + ds >> i; + return ds; +} + +/** + * Serialize an std::deque into a stream + * + * @brief Serialize an std::queue + * @param ds - The stream to write + * @param opt - The value to serialize + * @tparam Stream - Type of datastream buffer + * @return datastream& - Reference to the datastream + */ +template +inline datastream& operator<<(datastream& ds, const std::deque& d) { + ds << unsigned_int( d.size() ); + for ( auto elem : d ) + ds << elem; + return ds; +} + +/** + * Deserialize an std::deque from a stream + * + * @brief Deserialize an std::deque + * @param ds - The stream to read + * @param opt - The destination for deserialized value + * @tparam Stream - Type of datastream buffer + * @return datastream& - Reference to the datastream + */ +template +inline datastream& operator>>(datastream& ds, std::deque& d) { + unsigned_int s; + ds >> s; + d.resize(s.value); + for( auto& i : d ) + ds >> i; + return ds; +} + /** * Serialize a binary_extension into a stream * @@ -284,7 +347,7 @@ inline datastream& operator<<(datastream& ds, const eosio::binar return ds; } - /** +/** * Deserialize a binary_extension from a stream * * @brief Deserialize a binary_extension @@ -331,7 +394,7 @@ void deserialize(datastream& ds, std::variant& var, int i) { deserialize(ds,var,i); } } else { - eosio_assert(false, "invalid variant index"); + eosio::check(false, "invalid variant index"); } } @@ -931,7 +994,7 @@ template> ( DataStream& ds, T (&v)[N] ) { unsigned_int s; ds >> s; - eosio_assert( N == s.value, "T[] size and unpacked size don't match"); + eosio::check( N == s.value, "T[] size and unpacked size don't match"); for( uint32_t i = 0; i < N; ++i ) ds >> v[i]; return ds; @@ -953,7 +1016,7 @@ template> ( DataStream& ds, T (&v)[N] ) { unsigned_int s; ds >> s; - eosio_assert( N == s.value, "T[] size and unpacked size don't match"); + eosio::check( N == s.value, "T[] size and unpacked size don't match"); ds.read((char*)&v[0], sizeof(v)); return ds; } @@ -1312,6 +1375,14 @@ DataStream& operator>>( DataStream& ds, T& v ) { return ds; } +/** + * Defines data stream for reading and writing data in the form of bytes + * + * @addtogroup datastream Data Stream + * @ingroup cpp_api + * @{ + */ + /** * Unpack data inside a fixed size buffer as T * @@ -1375,6 +1446,8 @@ std::vector pack( const T& value ) { return result; } +///@} + /** * Serialize a capi_checksum160 type * @@ -1434,5 +1507,7 @@ inline datastream& operator>>(datastream& ds, capi_checksum512& ds.read((char*)&cs.hash[0], sizeof(cs.hash)); return ds; } -/// @} datastream + + + } diff --git a/libraries/eosiolib/db.h b/libraries/eosiolib/db.h index 9b993e58ca..3ea74f75fe 100644 --- a/libraries/eosiolib/db.h +++ b/libraries/eosiolib/db.h @@ -1,34 +1,15 @@ /** * @file db.h - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE * @brief Defines C API for interfacing with blockchain database */ #pragma once - #include -extern "C" { -/** - * @defgroup database Database API - * @brief Defines APIs that store and retrieve data on the blockchain - * @ingroup contractdev - * - * @defgroup databasecpp Database C++ API - * @brief Defines an interface to EOSIO database - * @ingroup database - * - * @details - * EOSIO organizes data according to the following broad structure: - * - **code** - the account name which has write permission - * - **scope** - an area where the data is stored - * - **table** - a name for the table that is being stored - * - **record** - a row in the table - */ /** - * @defgroup databasec Database C API + * @addtogroup database_c_api Database C API + * @ingroup c_api * @brief Defines %C APIs for interfacing with the database. - * @ingroup database - * * @details Database C API provides low level interface to EOSIO database. * * @section tabletypes Supported Table Types @@ -43,6 +24,8 @@ extern "C" { * - long double key * @{ */ +extern "C" { + /** * @@ -936,5 +919,5 @@ int32_t db_idx_long_double_upperbound(capi_name code, uint64_t scope, capi_name */ int32_t db_idx_long_double_end(capi_name code, uint64_t scope, capi_name table); -///@} databasec +///@} } diff --git a/libraries/eosiolib/dispatcher.hpp b/libraries/eosiolib/dispatcher.hpp index 149b81ce20..a3741fef6d 100644 --- a/libraries/eosiolib/dispatcher.hpp +++ b/libraries/eosiolib/dispatcher.hpp @@ -39,22 +39,15 @@ namespace eosio { } /** - * @defgroup dispatcher Dispatcher API - * @brief Defines functions to dispatch action to proper action handler inside a contract - * @ingroup contractdev - */ - - /** - * @defgroup dispatchercpp Dispatcher C++ API + * @addtogroup dispatcher Dispatcher C++ API + * @ingroup cpp_api * @brief Defines C++ functions to dispatch action to proper action handler inside a contract - * @ingroup dispatcher * @{ */ /** * Unpack the received action and execute the correponding action handler * - * @brief Unpack the received action and execute the correponding action handler * @tparam T - The contract class that has the correponding action handler, this contract should be derived from eosio::contract * @tparam Q - The namespace of the action handler function * @tparam Args - The arguments that the action handler accepts, i.e. members of the action @@ -73,11 +66,11 @@ namespace eosio { buffer = max_stack_buffer_size < size ? malloc(size) : alloca(size); read_action_data( buffer, size ); } - + std::tuple...> args; datastream ds((char*)buffer, size); ds >> args; - + T inst(self, code, ds); auto f2 = [&]( auto... a ){ @@ -90,28 +83,28 @@ namespace eosio { } return true; } - /// @} dispatcher -// Helper macro for EOSIO_DISPATCH_INTERNAL -#define EOSIO_DISPATCH_INTERNAL( r, OP, elem ) \ - case eosio::name( BOOST_PP_STRINGIZE(elem) ).value: \ - eosio::execute_action( eosio::name(receiver), eosio::name(code), &OP::elem ); \ - break; +/// @} + + + + // Helper macro for EOSIO_DISPATCH_INTERNAL + #define EOSIO_DISPATCH_INTERNAL( r, OP, elem ) \ + case eosio::name( BOOST_PP_STRINGIZE(elem) ).value: \ + eosio::execute_action( eosio::name(receiver), eosio::name(code), &OP::elem ); \ + break; + + // Helper macro for EOSIO_DISPATCH + #define EOSIO_DISPATCH_HELPER( TYPE, MEMBERS ) \ + BOOST_PP_SEQ_FOR_EACH( EOSIO_DISPATCH_INTERNAL, TYPE, MEMBERS ) -// Helper macro for EOSIO_DISPATCH -#define EOSIO_DISPATCH_HELPER( TYPE, MEMBERS ) \ - BOOST_PP_SEQ_FOR_EACH( EOSIO_DISPATCH_INTERNAL, TYPE, MEMBERS ) -/** - * @addtogroup dispatcher - * @{ - */ /** + * @addtogroup dispatcher * Convenient macro to create contract apply handler - * To be able to use this macro, the contract needs to be derived from eosio::contract * - * @brief Convenient macro to create contract apply handler + * @note To be able to use this macro, the contract needs to be derived from eosio::contract * @param TYPE - The class name of the contract * @param MEMBERS - The sequence of available actions supported by this contract * @@ -131,6 +124,5 @@ extern "C" { \ } \ } \ } \ - /// @} dispatcher } diff --git a/libraries/eosiolib/eosio.hpp b/libraries/eosiolib/eosio.hpp index 3704ff9969..f4f2da9b73 100644 --- a/libraries/eosiolib/eosio.hpp +++ b/libraries/eosiolib/eosio.hpp @@ -1,13 +1,17 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include -#include -#include +#include "action.hpp" +#include "print.hpp" +#include "multi_index.hpp" +#include "dispatcher.hpp" +#include "contract.hpp" + +#ifndef EOSIO_NATIVE +static_assert( sizeof(long) == sizeof(int), "unexpected size difference" ); +#endif /** * Helper macros to reduce the verbosity for common contracts @@ -15,3 +19,13 @@ #define CONTRACT class [[eosio::contract]] #define ACTION [[eosio::action]] void #define TABLE struct [[eosio::table]] + +/** + * @defgroup c_api C API + * @brief C++ API for writing ESIO Smart Contracts + */ + + /** + * @defgroup cpp_api C++ API + * @brief C++ API for writing ESIO Smart Contracts + */ diff --git a/libraries/eosiolib/eosiolib.cpp b/libraries/eosiolib/eosiolib.cpp index 04859aca82..0b8e74fd0b 100644 --- a/libraries/eosiolib/eosiolib.cpp +++ b/libraries/eosiolib/eosiolib.cpp @@ -2,6 +2,13 @@ #include "memory.hpp" #include "privileged.hpp" +#ifdef EOSIO_NATIVE +extern "C" { + size_t __builtin_wasm_current_memory(); + size_t __builtin_wasm_grow_memory(size_t); +} +#endif + void* sbrk(size_t num_bytes) { constexpr uint32_t NBPPL2 = 16U; constexpr uint32_t NBBP = 65536U; @@ -50,7 +57,7 @@ namespace eosio { void get_blockchain_parameters(eosio::blockchain_parameters& params) { char buf[sizeof(eosio::blockchain_parameters)]; size_t size = get_blockchain_parameters_packed( buf, sizeof(buf) ); - eosio_assert( size <= sizeof(buf), "buffer is too small" ); + eosio::check( size <= sizeof(buf), "buffer is too small" ); eosio::datastream ds( buf, size_t(size) ); ds >> params; } @@ -292,7 +299,7 @@ namespace eosio { char* malloc_from_freed(uint32_t size) { - eosio_assert(_offset == _heap_size, "malloc_from_freed was designed to only be called after _heap was completely allocated"); + eosio::check(_offset == _heap_size, "malloc_from_freed was designed to only be called after _heap was completely allocated"); char* current = _heap + _size_marker; while (current != nullptr) diff --git a/libraries/eosiolib/fixed_bytes.hpp b/libraries/eosiolib/fixed_bytes.hpp index c0428d8e1d..45a49bf076 100644 --- a/libraries/eosiolib/fixed_bytes.hpp +++ b/libraries/eosiolib/fixed_bytes.hpp @@ -1,15 +1,15 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once +#include "system.hpp" + #include #include #include -#include - namespace eosio { template @@ -35,6 +35,7 @@ namespace eosio { /** * @defgroup fixed_bytes Fixed Size Byte Array + * @ingroup types * @brief Fixed size array of bytes sorted lexicographically * @ingroup types * @{ @@ -71,7 +72,7 @@ namespace eosio { continue; } - eosio_assert( sub_words_left == 1, "unexpected error in fixed_bytes constructor" ); + eosio::check( sub_words_left == 1, "unexpected error in fixed_bytes constructor" ); temp_word |= static_cast(*w_itr); sub_words_left = num_sub_words; diff --git a/libraries/eosiolib/fixed_key.hpp b/libraries/eosiolib/fixed_key.hpp index 2484fc1a30..983e0873fe 100644 --- a/libraries/eosiolib/fixed_key.hpp +++ b/libraries/eosiolib/fixed_key.hpp @@ -1,15 +1,15 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once +#include "system.hpp" + #include #include #include -#include - namespace eosio { template @@ -33,19 +33,17 @@ namespace eosio { template bool operator <=(const fixed_key &c1, const fixed_key &c2); - /** - * @defgroup fixed_key Fixed Size Key - * @brief Fixed size key sorted lexicographically for Multi Index Table - * @ingroup types - * @{ - */ + /** + * @defgroup fixed_key Fixed Size Key + * @ingroup types + * @brief Fixed size key sorted lexicographically for Multi Index Table + * @{ + */ /** * Fixed size key sorted lexicographically for Multi Index Table * - * @brief Fixed size key sorted lexicographically for Multi Index Table * @tparam Size - Size of the fixed_key object - * @ingroup types */ template class [[deprecated("Replaced by fixed_bytes")]] fixed_key { @@ -71,7 +69,7 @@ namespace eosio { continue; } - eosio_assert( sub_words_left == 1, "unexpected error in fixed_key constructor" ); + eosio::check( sub_words_left == 1, "unexpected error in fixed_key constructor" ); temp_word |= static_cast(*w_itr); sub_words_left = num_sub_words; @@ -92,8 +90,6 @@ namespace eosio { /** * Get number of words contained in this fixed_key object. A word is defined to be 16 bytes in size - * - * @brief Get number of words contained in this fixed_key object */ static constexpr size_t num_words() { return (Size + sizeof(word_t) - 1) / sizeof(word_t); } @@ -101,22 +97,17 @@ namespace eosio { /** * Get number of padded bytes contained in this fixed_key object. Padded bytes are the remaining bytes * inside the fixed_key object after all the words are allocated - * - * @brief Get number of padded bytes contained in this fixed_key object */ static constexpr size_t padded_bytes() { return num_words() * sizeof(word_t) - Size; } /** - * @brief Default constructor to fixed_key object - * - * @details Default constructor to fixed_key object which initializes all bytes to zero + * \Default constructor to fixed_key object */ constexpr fixed_key() : _data() {} /** - * @brief Constructor to fixed_key object from std::array of num_words() word_t types + * Constructor to fixed_key object from std::array of num_words() words * - * @details Constructor to fixed_key object from std::array of num_words() word_t types * @param arr data */ fixed_key(const std::array& arr) @@ -125,9 +116,8 @@ namespace eosio { } /** - * @brief Constructor to fixed_key object from std::array of Word types smaller in size than word_t + * Constructor to fixed_key object from std::array of num_words() words * - * @details Constructor to fixed_key object from std::array of Word types smaller in size than word_t * @param arr - Source data */ template extract_as_byte_array()const { @@ -270,9 +255,8 @@ namespace eosio { }; /** - * @brief Compares two fixed_key variables c1 and c2 + * Lexicographically compares two fixed_key variables c1 and c2 * - * @details Lexicographically compares two fixed_key variables c1 and c2 * @param c1 - First fixed_key object to compare * @param c2 - Second fixed_key object to compare * @return if c1 == c2, return true, otherwise false @@ -283,9 +267,8 @@ namespace eosio { } /** - * @brief Compares two fixed_key variables c1 and c2 + * Lexicographically compares two fixed_key variables c1 and c2 * - * @details Lexicographically compares two fixed_key variables c1 and c2 * @param c1 - First fixed_key object to compare * @param c2 - Second fixed_key object to compare * @return if c1 != c2, return true, otherwise false @@ -296,9 +279,8 @@ namespace eosio { } /** - * @brief Compares two fixed_key variables c1 and c2 + * Lexicographically compares two fixed_key variables c1 and c2 * - * @details Lexicographically compares two fixed_key variables c1 and c2 * @param c1 - First fixed_key object to compare * @param c2 - Second fixed_key object to compare * @return if c1 > c2, return true, otherwise false @@ -309,9 +291,8 @@ namespace eosio { } /** - * @brief Compares two fixed_key variables c1 and c2 + * Lexicographically compares two fixed_key variables c1 and c2 * - * @details Lexicographically compares two fixed_key variables c1 and c2 * @param c1 - First fixed_key object to compare * @param c2 - Second fixed_key object to compare * @return if c1 < c2, return true, otherwise false @@ -322,7 +303,7 @@ namespace eosio { } /** - * @brief Compares two fixed_key variables c1 and c2 + * Compares two fixed_key variables c1 and c2 * * @details Lexicographically compares two fixed_key variables c1 and c2 * @param c1 - First fixed_key object to compare @@ -335,7 +316,7 @@ namespace eosio { } /** - * @brief Compares two fixed_key variables c1 and c2 + * Compares two fixed_key variables c1 and c2 * * @details Lexicographically compares two fixed_key variables c1 and c2 * @param c1 - First fixed_key object to compare @@ -350,4 +331,5 @@ namespace eosio { /// @} fixed_key typedef fixed_key<32> key256; + ///@} } diff --git a/libraries/eosiolib/fixedpoint.hpp b/libraries/eosiolib/fixedpoint.hpp index 9f2ced9fd2..9432460e2a 100644 --- a/libraries/eosiolib/fixedpoint.hpp +++ b/libraries/eosiolib/fixedpoint.hpp @@ -5,11 +5,11 @@ namespace eosio { /** - * @defgroup fixedpoint Fixed Point - * @ingroup mathcppapi + * @defgroup fixed_point Fixed Point + * @ingroup types * @brief 32,64,128,256 bits version of fixed point variables * - * Floating point operations are indeterministic, hence is prevented in smart contract. + * @details Floating point operations are indeterministic, hence is prevented in smart contract. * The smart contract developers should use the appropriate Fixed_Point template class * by passing the number to be represented in integer format and the number of decimals * required. @@ -26,10 +26,7 @@ namespace eosio #if 0 template struct fixed_point256; /** - * @defgroup Template class for Fixed Point 256 bits representaton - * @ingroup contractdev - * @brief Template param Q is the Q factor i.e. number of decimals - * + * Template class for Fixed Point 256 bits representaton */ template struct fixed_point256 @@ -86,8 +83,6 @@ namespace eosio /** * The template param Q represents the Q Factor i.e number of decimals - * - * @brief 128 bits representation of Fixed Point class. * * Example: * @code @@ -104,16 +99,12 @@ namespace eosio static_assert(Q < 128, "Maximum number of decimals supported in fixed_point128 is 128 decimals"); /** - * @brief Value of the fixed point represented as int128_t - * * Value of the fixed point represented as int128_t */ int128_t val; /** * Various constructors for fixed_point128. Can create fixed_point128 instance from an int128_t, fixed_point128,64,32 instance - * - * @brief Various constructors for fixed_point128 * * Example: * @code @@ -123,43 +114,39 @@ namespace eosio * fixed_point128<5> c(a); * @endcode */ - + /** * Construct a new fixed point128 object from int128_t - * - * @brief Construct a new fixed point128 object + * * @param v - int128_t representation of the fixed point value */ fixed_point128(int128_t v=0) : val(v) {} /** * Construct a new fixed point128 object from another fixed_point128 - * - * @brief Construct a new fixed point128 object from another fixed_point128 - * @param r - Another fixed_point128 as source + * + * @param r - Another fixed_point128 as source */ template fixed_point128(const fixed_point128 &r); /** * Construct a new fixed point128 object from another fixed_point64 - * - * @brief Construct a new fixed point128 object from another fixed_point64 - * @param r -fixed_point64 as source + * + * @param r -fixed_point64 as source */ template fixed_point128(const fixed_point64 &r); /** * Construct a new fixed point128 object from another fixed_point32 - * + * * @brief Construct a new fixed point128 object from another fixed_point32 - * @param r -fixed_point32 as source + * @param r -fixed_point32 as source */ template fixed_point128(const fixed_point32 &r); /** * Get the integer part of the 64 bit fixed number - * - * @brief To get the integer part of the fixed number + * * @return Returns integer part of the fixed number * * Example: @@ -174,8 +161,7 @@ namespace eosio /** * Get the decimal part of the 64 bit fixed number - * - * @brief To get the decimal part of the fixed number + * * @return Returns decimal part of the fixed number * * Example: @@ -191,8 +177,6 @@ namespace eosio /** * Prints the fixed point value - * - * @brief Prints the fixed point value */ void print() const { uint128_t ip((uint128_t)int_part()); @@ -205,8 +189,7 @@ namespace eosio // Various assignment operators /** * Assignment operator. Assign fixed_point32 to fixed_point128 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point128& - Reference to this object @@ -214,8 +197,7 @@ namespace eosio template fixed_point128 &operator=(const fixed_point32 &r); /** * Assignment operator. Assign fixed_point32 to fixed_point64 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point128& - Reference to this object @@ -223,8 +205,7 @@ namespace eosio template fixed_point128 &operator=(const fixed_point64 &r); /** * Assignment operator. Assign fixed_point32 to fixed_point32 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point128& - Reference to this object @@ -234,8 +215,7 @@ namespace eosio // Comparison functions /** * Equality operator - * - * @brief Equality operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -245,8 +225,7 @@ namespace eosio /** * Greater than operator - * - * @brief Greater than operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -256,8 +235,7 @@ namespace eosio /** * Less than operator - * - * @brief Less than operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -268,7 +246,7 @@ namespace eosio /** - * @brief 64 bits representation of Fixed Point class. + * 64 bits representation of Fixed Point class. * * Example: * @code @@ -285,39 +263,34 @@ namespace eosio static_assert(Q < 128, "Maximum number of decimals supported in fixed_point64 is 128 decimals"); /** - * @brief Value of the fixed point represented as int64_t - * * Value of the fixed point represented as int64_t */ int64_t val; /** * Construct a new fixed point64 object from int64_t - * - * @brief Construct a new fixed point64 object + * * @param v - int64_t representation of the fixed point value */ fixed_point64(int64_t v=0) : val(v) {} /** * Construct a new fixed point64 object from another fixed_point64 - * - * @brief Construct a new fixed point64 object from another fixed_point64 - * @param r - Another fixed_point64 as source + * + * @param r - Another fixed_point64 as source */ template fixed_point64(const fixed_point64 &r); /** * Construct a new fixed point64 object from another fixed_point32 - * - * @brief Construct a new fixed point64 object from another fixed_point32 - * @param r - fixed_point64 as source + * + * @param r - fixed_point64 as source */ template fixed_point64(const fixed_point32 &r); /** * Get the integer part of the 64 bit fixed number - * @brief To get the integer part of the fixed number + * * @return Returns integer part of the fixed number * * Example: @@ -332,7 +305,7 @@ namespace eosio /** * Get the decimal part of the 64 bit fixed number - * @brief To get the decimal part of the fixed number + * * @return Returns decimal part of the fixed number * * Example: @@ -348,7 +321,7 @@ namespace eosio /** * Prints the fixed point value - * + * * @brief Prints the fixed point value */ void print() const { @@ -357,11 +330,9 @@ namespace eosio printi128(frac_part()); } - // Various assignment operators /** * Assignment operator. Assign fixed_point32 to fixed_point64 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point64& - Reference to this object @@ -370,8 +341,7 @@ namespace eosio /** * Assignment operator. Assign fixed_point64 to fixed_point64 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point64& - Reference to this object @@ -381,8 +351,7 @@ namespace eosio // Arithmetic operations /** * Addition operator - * - * @brief Addition operator + * * @tparam QR - Precision of the second addend * @param r - Second addend * @return - The result of addition @@ -391,8 +360,7 @@ namespace eosio /** * Subtraction operator - * - * @brief Subtraction operator + * * @tparam QR - Precision of the minuend * @param r - Minuend * @return - The result of subtraction @@ -403,8 +371,7 @@ namespace eosio // The total number of decimals will be the max /** * Multiplication operator - * - * @brief Multiplication operator + * * @tparam QR - Precision of the multiplier * @param r - Multiplier * @return - The result of multiplication @@ -413,8 +380,7 @@ namespace eosio /** * Division operator - * - * @brief Division operator + * * @tparam QR - Precision of the divisor * @param r - Divisor * @return - The result of division @@ -424,8 +390,7 @@ namespace eosio // Comparison functions /** * Equality operator - * - * @brief Equality operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -435,8 +400,7 @@ namespace eosio /** * Greater than operator - * - * @brief Greater than operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -446,8 +410,7 @@ namespace eosio /** * Less than operator - * - * @brief Less than operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -459,8 +422,7 @@ namespace eosio /** * @brief 32 bits representation of Fixed Point class. * - * This class is implemented to to replace the floating point variables - * It can resolve floating point undetermenistic related issues + * @details This class is implemented to replace the floating point variables and can resolve floating point undetermenistic related issues * * Example: * @code @@ -477,35 +439,30 @@ namespace eosio struct fixed_point32 { static_assert(Q < 128, "Maximum number of decimals supported in fixed_point32 is 128 decimals"); - + /** - * @brief Value of the fixed point represented as int32_t - * * Value of the fixed point represented as int32_t */ int32_t val; /** * Construct a new fixed point32 object from another fixed_point32 - * - * @brief Construct a new fixed point32 object from another fixed_point32 - * @param r - Another fixed_point32 as source - */ + * + * @param r - Another fixed_point32 as source + */ template fixed_point32(const fixed_point32 &r); /** * Construct a new fixed point32 object from another fixed_point64. It will be truncated. - * - * @brief Construct a new fixed point32 object from another fixed_point64 - * @param r - Another fixed_point32 as source + * + * @param r - Another fixed_point32 as source */ template fixed_point32(const fixed_point64 &r); - + /** * Construct a new fixed point32 object from int32_t - * - * @brief Construct a new fixed point32 object + * * @param v - int32_t representation of the fixed point value */ fixed_point32(int32_t param=0) : val(param) {} @@ -520,7 +477,7 @@ namespace eosio /** * Get the integer part of the 64 bit fixed number - * @brief To get the integer part of the fixed number + * * @return Returns integer part of the fixed number * * Example: @@ -539,8 +496,6 @@ namespace eosio /** * Prints the fixed point value - * - * @brief Prints the fixed point value */ void print() const { printi(int_part()); @@ -551,8 +506,7 @@ namespace eosio // Various assignment operators /** * Assignment operator. Assign fixed_point32 to fixed_point32 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point32& - Reference to this object @@ -561,8 +515,7 @@ namespace eosio /** * Assignment operator. Assign fixed_point64 to fixed_point32 - * - * @brief Assignment operator + * * @tparam qr - Precision of the source * @param r - Source * @return fixed_point32& - Reference to this object @@ -571,8 +524,7 @@ namespace eosio /** * Addition operator - * - * @brief Addition operator + * * @tparam QR - Precision of the second addend * @param r - Second addend * @return - The result of addition @@ -581,8 +533,7 @@ namespace eosio /** * Subtraction operator - * - * @brief Subtraction operator + * * @tparam QR - Precision of the minuend * @param r - Minuend * @return - The result of subtraction @@ -592,8 +543,7 @@ namespace eosio // productd of to fixed_point32 instances will be fixed_point64 /** * Multiplication operator - * - * @brief Multiplication operator + * * @tparam QR - Precision of the multiplier * @param r - Multiplier * @return - The result of multiplication @@ -602,8 +552,7 @@ namespace eosio /** * Division operator - * - * @brief Division operator + * * @tparam QR - Precision of the divisor * @param r - Divisor * @return - The result of division @@ -613,8 +562,7 @@ namespace eosio // Comparison functions /** * Equality operator - * - * @brief Equality operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -624,8 +572,7 @@ namespace eosio /** * Greater than operator - * - * @brief Greater than operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -635,8 +582,7 @@ namespace eosio /** * Less than operator - * - * @brief Less than operator + * * @tparam qr - Precision of the source * @param r - Source * @return true - if equal @@ -751,8 +697,8 @@ namespace eosio /** * @brief Multiplication operator for fixed_point64. The result goes to fixed_point64 * - * Multiplication operator for fixed_point64. The result goes to fixed_point128 - * Number of decimal on result will be sum of number of decimals of lhs and rhs + * @details Multiplication operator for fixed_point64. The result goes to fixed_point128 + * @note Number of decimal on result will be sum of number of decimals of lhs and rhs * * Example: * @code @@ -765,9 +711,7 @@ namespace eosio } /** - * @brief Division of two fixed_point64 result will be stored in fixed_point128 - * - * Division operator for fixed_point64 + * Division of two fixed_point64 result will be stored in fixed_point128 * * Example: * @code @@ -779,7 +723,7 @@ namespace eosio // std::cout << "Performing division on " << val << ", with " << q << " precision / " << r.val << ", with " << qr << " precision. Result precision " << ((q>qr) ? q:qr) << std::endl; // Convert val to 128 bit by additionally shifting 64 bit and take the result to 128bit // Q(X+64-Y) = Q(X+64) / Q(Y) - eosio_assert( !(r.int_part() == 0 && r.frac_part() == 0), "divide by zero" ); + eosio::check( !(r.int_part() == 0 && r.frac_part() == 0), "divide by zero" ); return fixed_point128((int128_t(val)<<64)/r.val); } @@ -805,10 +749,9 @@ namespace eosio } /** - * @brief Addition between two fixed_point32 variables and the result goes to fixed_point32 + * Addition between two fixed_point32 variables and the result goes to fixed_point32 * - * Addition between two fixed_point32 variables - * Number of decimal on result will be max of decimals of lhs and rhs + * @note Number of decimal on result will be max of decimals of lhs and rhs * */ template template @@ -826,11 +769,9 @@ namespace eosio } /** - * @brief Subtraction between two fixed_point32 variables and the result goes to fixed_point32 - * - * Subtraction between two fixed_point32 variables - * Number of decimal on result will be max of decimals of lhs and rhs + * Subtraction between two fixed_point32 variables and the result goes to fixed_point32 * + * @note Number of decimal on result will be max of decimals of lhs and rhs */ template template fixed_point32< (Q>QR)?Q:QR > fixed_point32::operator-(const fixed_point32 &rhs) const @@ -847,10 +788,9 @@ namespace eosio } /** - * @brief Multiplication operator for fixed_point32. The result goes to fixed_point64 - * * Multiplication operator for fixed_point32. The result goes to fixed_point64 - * Number of decimal on result will be sum of number of decimals of lhs and rhs + * + * @note Number of decimal on result will be sum of number of decimals of lhs and rhs * * Example: * @code @@ -863,9 +803,7 @@ namespace eosio } /** - * @brief Division of two fixed_point32 result will be stored in fixed_point64 - * - * Division operator for fixed_point32 + * Division of two fixed_point32 result will be stored in fixed_point64 * * Example: * @code @@ -876,7 +814,7 @@ namespace eosio fixed_point64 fixed_point32::operator/(const fixed_point32 &r) const { // Convert val into 64 bit and perform the division // Q(X+32-Y) = Q(X+32) / Q(Y) - eosio_assert( !(r.int_part() == 0 && r.frac_part() == 0), "divide by zero" ); + eosio::check( !(r.int_part() == 0 && r.frac_part() == 0), "divide by zero" ); return fixed_point64((int64_t(val)<<32)/r.val); } @@ -894,13 +832,12 @@ namespace eosio fixed_point64 fixed_divide(uint32_t lhs, uint32_t rhs) { - eosio_assert( rhs != 0, "divide by zero" ); + eosio::check( rhs != 0, "divide by zero" ); fixed_point64 result = fixed_point32<0>((int32_t)lhs) / fixed_point32<0>((int32_t)rhs); return result; } /** - * @brief Wrapper function for dividing two unit64 variable and stores result in fixed_point128 * Wrapper function for dividing two unit64 variable and stores result in fixed_point128 * * Example: @@ -913,7 +850,7 @@ namespace eosio fixed_point128 fixed_divide(uint64_t lhs, uint64_t rhs) { - eosio_assert( rhs != 0, "divide by zero" ); + eosio::check( rhs != 0, "divide by zero" ); fixed_point128 result = fixed_point64<0>((int32_t)lhs) / fixed_point64<0>((int32_t)rhs); return fixed_point128(result); } diff --git a/libraries/eosiolib/ignore.hpp b/libraries/eosiolib/ignore.hpp index 9e1eae3a6e..cd0622b129 100644 --- a/libraries/eosiolib/ignore.hpp +++ b/libraries/eosiolib/ignore.hpp @@ -2,10 +2,10 @@ namespace eosio { /** - * Tells the datastream to ignore this type, but allows the abi generator to add the correct type. - * Currently non-ignore types can not succeed an ignore type in a method definition, i.e. void foo(float, ignore) is allowed and void foo(float, ignore, int) is not allowed. - * This restriction will be relaxed in a later release. * @brief Tells the datastream to ignore this type, but allows the abi generator to add the correct type. + * + * @details Currently non-ignore types can not succeed an ignore type in a method definition, i.e. void foo(float, ignore) is allowed and void foo(float, ignore, int) is not allowed. + * @note This restriction will be relaxed in a later release. * Currently non-ignore types can not succeed an ignore type in a method definition, i.e. void foo(float, ignore) is allowed and void foo(float, ignore, int) is not allowed. * This restriction will be relaxed in a later release. */ @@ -13,8 +13,7 @@ namespace eosio { struct [[eosio::ignore]] ignore {}; /** - * Wrapper class to allow sending inline actions with the correct payload - * @brief Wrapper class to allow sending inline actions with the correct payload + * Wrapper class to allow sending inline actions with the correct payload */ template struct ignore_wrapper { diff --git a/libraries/eosiolib/memory.h b/libraries/eosiolib/memory.h deleted file mode 100644 index 58e5a482b3..0000000000 --- a/libraries/eosiolib/memory.h +++ /dev/null @@ -1,8 +0,0 @@ -/** - * @file - * @copyright defined in eos/LICENSE.txt - */ -#pragma once - -#include -#include diff --git a/libraries/eosiolib/memory.hpp b/libraries/eosiolib/memory.hpp index 4a4f56a1c4..6bb0d3e061 100644 --- a/libraries/eosiolib/memory.hpp +++ b/libraries/eosiolib/memory.hpp @@ -1,24 +1,21 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include +#include "types.h" -void* sbrk(size_t num_bytes); +#ifdef EOSIO_NATIVE +extern "C" void* alloca(size_t); +#endif - /** - * @defgroup memoryapi Memory API - * @brief Defines common memory functions - * @ingroup contractdev - */ +void* sbrk(size_t num_bytes); /** - * @defgroup memorycppapi Memory C++ API + * @defgroup memory Memory C++ API + * @ingroup cpp_api * @brief Defines common memory functions - * @ingroup memoryapi * * @{ */ @@ -27,8 +24,7 @@ extern "C" { /** * Allocate additional memory - * - * @brief Allocate additional memory + * * @param size - Number of additional bytes to be allocated * @return void* - Pointer to start of the new allocated memory */ @@ -36,8 +32,7 @@ void* malloc(size_t size); /** * Allocate a block of memory for an array of **count** elements, each of them **size** bytes long, and initializes all bits with 0 - * - * @brief Allocate a block of memory for an array of **count** elements, each of them **size** bytes long, and initializes all bits with 0 + * * @param count - Number of elements to allocate * @param size - Size of each element * @return void* - Pointer to start of the new allocated memory @@ -46,8 +41,7 @@ void* calloc(size_t count, size_t size); /** * Reallocate the given area of memory, which is allocated by malloc(), calloc(), or realloc() previously - * - * @brief Reallocate the given area of memory + * * @param ptr - Pointer to the memory area to be reallocated * @param size - New size of the memory * @return void* - Pointer to the new reallocated memory @@ -55,10 +49,9 @@ void* calloc(size_t count, size_t size); void* realloc(void* ptr, size_t size); /** - * + * * Deallocates the given area of memory which is previously allocated by malloc(), calloc(), or realloc() - * @brief Deallocates the given area of memory - * + * * @param ptr - Pointer to the memory to be deallocated */ void free(void* ptr); diff --git a/libraries/eosiolib/multi_index.hpp b/libraries/eosiolib/multi_index.hpp index c56f82a0a8..8e8f5c2542 100644 --- a/libraries/eosiolib/multi_index.hpp +++ b/libraries/eosiolib/multi_index.hpp @@ -1,9 +1,16 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once +#include "action.h" +#include "name.hpp" +#include "serialize.hpp" +#include "datastream.hpp" +#include "db.h" +#include "fixed_bytes.hpp" + #include #include #include @@ -15,14 +22,6 @@ #include #include -#include -#include -#include -#include -#include -#include -#include - namespace eosio { constexpr static inline name same_payer{}; @@ -177,7 +176,6 @@ namespace _multi_index_detail { * uint128_t secondary; * uint64_t primary_key() const { return primary; } * uint64_t get_secondary() const { return secondary; } - * EOSLIB_SERIALIZE( record, (primary)(secondary) ) * }; * public: * mycontract(name receiver, name code, datastream ds):contract(receiver, code, ds){} @@ -200,19 +198,17 @@ struct indexed_by { /** * @defgroup multiindex Multi Index Table * @brief Defines EOSIO Multi Index Table - * @ingroup databasecpp - * - * + * @ingroup cpp_api * - * EOSIO Multi-Index API provides a C++ interface to the EOSIO database. It is patterned after Boost Multi Index Container. + * @details EOSIO Multi-Index API provides a C++ interface to the EOSIO database. It is patterned after Boost Multi Index Container. * EOSIO Multi-Index table requires exactly a uint64_t primary key. For the table to be able to retrieve the primary key, * the object stored inside the table is required to have a const member function called primary_key() that returns uint64_t. * EOSIO Multi-Index table also supports up to 16 secondary indices. The type of the secondary indices could be any of: * - uint64_t * - uint128_t - * - uint256_t * - double * - long double + * - eosio::checksum256 * * @tparam TableName - name of the table * @tparam T - type of the data stored inside the table @@ -228,13 +224,13 @@ struct indexed_by { * uint64_t primary; * uint64_t secondary_1; * uint128_t secondary_2; - * uint256_t secondary_3; + * checksum256 secondary_3; * double secondary_4; * long double secondary_5; * uint64_t primary_key() const { return primary; } * uint64_t get_secondary_1() const { return secondary_1; } * uint128_t get_secondary_2() const { return secondary_2; } - * uint256_t get_secondary_3() const { return secondary_3; } + * checksum256 get_secondary_3() const { return secondary_3; } * double get_secondary_4() const { return secondary_4; } * long double get_secondary_5() const { return secondary_5; } * }; @@ -246,7 +242,7 @@ struct indexed_by { * multi_index<"mytable"_n, record, * indexed_by< "bysecondary1"_n, const_mem_fun >, * indexed_by< "bysecondary2"_n, const_mem_fun >, - * indexed_by< "bysecondary3"_n, const_mem_fun >, + * indexed_by< "bysecondary3"_n, const_mem_fun >, * indexed_by< "bysecondary4"_n, const_mem_fun >, * indexed_by< "bysecondary5"_n, const_mem_fun > * > table( code, scope); @@ -358,7 +354,7 @@ class multi_index const_iterator& operator++() { using namespace _multi_index_detail; - eosio_assert( _item != nullptr, "cannot increment end iterator" ); + eosio::check( _item != nullptr, "cannot increment end iterator" ); if( _item->__iters[Number] == -1 ) { secondary_key_type temp_secondary_key; @@ -390,9 +386,9 @@ class multi_index if( !_item ) { auto ei = secondary_index_db_functions::db_idx_end(_idx->get_code().value, _idx->get_scope(), _idx->name()); - eosio_assert( ei != -1, "cannot decrement end iterator when the index is empty" ); + eosio::check( ei != -1, "cannot decrement end iterator when the index is empty" ); prev_itr = secondary_index_db_functions::db_idx_previous( ei , &prev_pk ); - eosio_assert( prev_itr >= 0, "cannot decrement end iterator when the index is empty" ); + eosio::check( prev_itr >= 0, "cannot decrement end iterator when the index is empty" ); } else { if( _item->__iters[Number] == -1 ) { secondary_key_type temp_secondary_key; @@ -401,7 +397,7 @@ class multi_index mi.__iters[Number] = idxitr; } prev_itr = secondary_index_db_functions::db_idx_previous( _item->__iters[Number], &prev_pk ); - eosio_assert( prev_itr >= 0, "cannot decrement iterator at beginning of index" ); + eosio::check( prev_itr >= 0, "cannot decrement iterator at beginning of index" ); } const T& obj = *_idx->_multidx->find( prev_pk ); @@ -459,8 +455,8 @@ class multi_index const_iterator require_find( const secondary_key_type& secondary, const char* error_msg = "unable to find secondary key" )const { auto lb = lower_bound( secondary ); - eosio_assert( lb != cend(), error_msg ); - eosio_assert( secondary == secondary_extractor_type()(*lb), error_msg ); + eosio::check( lb != cend(), error_msg ); + eosio::check( secondary == secondary_extractor_type()(*lb), error_msg ); return lb; } @@ -471,7 +467,7 @@ class multi_index // Gets the object with the smallest primary key in the case where the secondary key is not unique. const T& get( const secondary_key_type& secondary, const char* error_msg = "unable to find secondary key" )const { auto result = find( secondary ); - eosio_assert( result != cend(), error_msg ); + eosio::check( result != cend(), error_msg ); return *result; } @@ -515,7 +511,7 @@ class multi_index using namespace _multi_index_detail; const auto& objitem = static_cast(obj); - eosio_assert( objitem.__idx == _multidx, "object passed to iterator_to is not in multi_index" ); + eosio::check( objitem.__idx == _multidx, "object passed to iterator_to is not in multi_index" ); if( objitem.__iters[Number] == -1 ) { secondary_key_type temp_secondary_key; @@ -529,13 +525,13 @@ class multi_index template void modify( const_iterator itr, eosio::name payer, Lambda&& updater ) { - eosio_assert( itr != cend(), "cannot pass end iterator to modify" ); + eosio::check( itr != cend(), "cannot pass end iterator to modify" ); _multidx->modify( *itr, payer, std::forward(updater) ); } const_iterator erase( const_iterator itr ) { - eosio_assert( itr != cend(), "cannot pass end iterator to erase" ); + eosio::check( itr != cend(), "cannot pass end iterator to erase" ); const auto& obj = *itr; ++itr; @@ -598,7 +594,7 @@ class multi_index return *itr2->_item; auto size = db_get_i64( itr, nullptr, 0 ); - eosio_assert( size >= 0, "error reading iterator" ); + eosio::check( size >= 0, "error reading iterator" ); //using malloc/free here potentially is not exception-safe, although WASM doesn't support exceptions void* buffer = max_stack_buffer_size < size_t(size) ? malloc(size_t(size)) : alloca(size_t(size)); @@ -686,32 +682,17 @@ class multi_index /** * Returns the `code` member property. - * @brief Returns the `code` member property. * * @return Account name of the Code that owns the Primary Table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name self):contract(self) {} - * typedef eosio::multi_index< "address"_n, address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { * address_index addresses("dan"_n, "dan"_n); // code, scope - * eosio_assert(addresses.get_code() == "dan"_n, "Codes don't match."); + * eosio::check(addresses.get_code() == "dan"_n, "Codes don't match."); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -721,32 +702,17 @@ class multi_index /** * Returns the `scope` member property. - * @brief Returns the `scope` member property. * * @return Scope id of the Scope within the Code of the Current Receiver under which the desired Primary Table instance can be found. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name self):contract(self) {} - * typedef eosio::multi_index< "address"_n, address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { * address_index addresses("dan"_n, "dan"_n); // code, scope - * eosio_assert(addresses.get_code() == "dan"_n, "Scopes don't match"); + * eosio::check(addresses.get_code() == "dan"_n, "Scopes don't match"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -778,7 +744,7 @@ class multi_index } const_iterator& operator++() { - eosio_assert( _item != nullptr, "cannot increment end iterator" ); + eosio::check( _item != nullptr, "cannot increment end iterator" ); uint64_t next_pk; auto next_itr = db_next_i64( _item->__primary_itr, &next_pk ); @@ -794,12 +760,12 @@ class multi_index if( !_item ) { auto ei = db_end_i64(_multidx->get_code().value, _multidx->get_scope(), static_cast(TableName)); - eosio_assert( ei != -1, "cannot decrement end iterator when the table is empty" ); + eosio::check( ei != -1, "cannot decrement end iterator when the table is empty" ); prev_itr = db_previous_i64( ei , &prev_pk ); - eosio_assert( prev_itr >= 0, "cannot decrement end iterator when the table is empty" ); + eosio::check( prev_itr >= 0, "cannot decrement end iterator when the table is empty" ); } else { prev_itr = db_previous_i64( _item->__primary_itr, &prev_pk ); - eosio_assert( prev_itr >= 0, "cannot decrement iterator at beginning of table" ); + eosio::check( prev_itr >= 0, "cannot decrement iterator at beginning of table" ); } _item = &_multidx->load_object_by_primary_iterator( prev_itr ); @@ -819,42 +785,20 @@ class multi_index /** * Returns an iterator pointing to the object_type with the lowest primary key value in the Multi-Index table. - * @brief Returns an iterator pointing to the object_type with the lowest primary key value in the Multi-Index table. * * @return An iterator pointing to the object_type with the lowest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name self):contract(self) {} - * typedef eosio::multi_index< "address"_n, address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr == addresses.cbegin(), "Only address is not at front."); + * eosio::check(itr == addresses.cbegin(), "Only address is not at front."); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -866,42 +810,20 @@ class multi_index /** * Returns an iterator pointing to the object_type with the lowest primary key value in the Multi-Index table. - * @brief Returns an iterator pointing to the object_type with the lowest primary key value in the Multi-Index table. * * @return An iterator pointing to the object_type with the lowest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name self):contract(self) {} - * typedef eosio::multi_index< "address"_n, address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr == addresses.begin(), "Only address is not at front."); + * eosio::check(itr == addresses.begin(), "Only address is not at front."); * } * } * EOSIO_ABI( addressbook, (myaction) ) @@ -911,42 +833,20 @@ class multi_index /** * Returns an iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. - * @brief Returns an iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * @return An iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name self):contract(self) {} - * typedef eosio::multi_index< "address"_n, address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.cend(), "Address for account doesn't exist"); + * eosio::check(itr != addresses.cend(), "Address for account doesn't exist"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -956,42 +856,20 @@ class multi_index /** * Returns an iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. - * @brief Returns an iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * @return An iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name self):contract(self) {} - * typedef eosio::multi_index< "address"_n, address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.end(), "Address for account doesn't exist"); + * eosio::check(itr != addresses.end(), "Address for account doesn't exist"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1001,40 +879,19 @@ class multi_index /** * Returns a reverse iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. - * @brief Returns a reverse iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * @return A reverse iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1044,9 +901,9 @@ class multi_index * address.state = "HK"; * }); * auto itr = addresses.crbegin(); - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect Last Record "); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect Last Record "); * itr++; - * eosio_assert(itr->account_name == name("brendan"), "Lock arf, Incorrect Second Last Record"); + * eosio::check(itr->account_name == name("brendan"), "Lock arf, Incorrect Second Last Record"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1056,40 +913,19 @@ class multi_index /** * Returns a reverse iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. - * @brief Returns a reverse iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * @return A reverse iterator pointing to the `object_type` with the highest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1099,9 +935,9 @@ class multi_index * address.state = "HK"; * }); * auto itr = addresses.rbegin(); - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect Last Record "); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect Last Record "); * itr++; - * eosio_assert(itr->account_name == name("brendan"), "Lock arf, Incorrect Second Last Record"); + * eosio::check(itr->account_name == name("brendan"), "Lock arf, Incorrect Second Last Record"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1111,40 +947,19 @@ class multi_index /** * Returns an iterator pointing to the `object_type` with the lowest primary key value in the Multi-Index table. - * @brief Returns an iterator pointing to the `object_type` with the lowest primary key value in the Multi-Index table. * * @return An iterator pointing to the `object_type` with the lowest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1155,9 +970,9 @@ class multi_index * }); * auto itr = addresses.crend(); * itr--; - * eosio_assert(itr->account_name == name("brendan"), "Lock arf, Incorrect First Record "); + * eosio::check(itr->account_name == name("brendan"), "Lock arf, Incorrect First Record "); * itr--; - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect Second Record"); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect Second Record"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1167,53 +982,32 @@ class multi_index /** * Returns an iterator pointing to the `object_type` with the lowest primary key value in the Multi-Index table. - * @brief Returns an iterator pointing to the `object_type` with the lowest primary key value in the Multi-Index table. * * @return An iterator pointing to the `object_type` with the lowest primary key value in the Multi-Index table. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "brendan"_n; - * address.first_name = "Brendan"; - * address.last_name = "Blumer"; + * address.account_name = "brendan"_n; + * address.first_name = "Brendan"; + * address.last_name = "Blumer"; * address.street = "1 EOS Way"; * address.city = "Hong Kong"; * address.state = "HK"; * }); * auto itr = addresses.rend(); * itr--; - * eosio_assert(itr->account_name == name("brendan"), "Lock arf, Incorrect First Record "); + * eosio::check(itr->account_name == name("brendan"), "Lock arf, Incorrect First Record "); * itr--; - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect Second Record"); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect Second Record"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1223,45 +1017,20 @@ class multi_index /** * Searches for the `object_type` with the lowest primary key that is greater than or equal to a given primary key. - * @brief Searches for the `object_type` with the lowest primary key that is greater than or equal to a given primary key. * * @param primary - Primary key that establishes the target value for the lower bound search. - * * @return An iterator pointing to the `object_type` that has the lowest primary key that is greater than or equal to `primary`. If an object could not be found, it will return the `end` iterator. If the table does not exist** it will return `-1`. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint32_t zip = 0; - * uint64_t primary_key() const { return account_name; } - * uint64_t by_zip() const { return zip; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address, indexed_by< name("zip"), const_mem_fun > address_index; + * // This assumes the code from the get_index() example below. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * address.zip = 93446; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1274,11 +1043,11 @@ class multi_index * uint32_t zipnumb = 93445; * auto zip_index = addresses.get_index(); * auto itr = zip_index.lower_bound(zipnumb); - * eosio_assert(itr->account_name == name("brendan"), "Lock arf, Incorrect First Lower Bound Record "); + * eosio::check(itr->account_name == name("brendan"), "Lock arf, Incorrect First Lower Bound Record "); * itr++; - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect Second Lower Bound Record"); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect Second Lower Bound Record"); * itr++; - * eosio_assert(itr == zip_index.end(), "Lock arf, Incorrect End of Iterator"); + * eosio::check(itr == zip_index.end(), "Lock arf, Incorrect End of Iterator"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1293,46 +1062,20 @@ class multi_index /** * Searches for the `object_type` with the highest primary key that is less than or equal to a given primary key. - * @brief Searches for the `object_type` with the highest primary key that is less than or equal to a given primary key. * * @param primary - Primary key that establishes the target value for the upper bound search - * * @return An iterator pointing to the `object_type` that has the highest primary key that is less than or equal to `primary`. If an object could not be found, it will return the `end` iterator. If the table does not exist** it will return `-1`. * * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint32_t zip = 0; - * uint64_t liked = 0; - * uint64_t primary_key() const { return account_name; } - * uint64_t by_zip() const { return zip; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address, indexed_by< name("zip"), const_mem_fun > address_index; + * // This assumes the code from the get_index() example below. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * address.zip = 93446; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1345,9 +1088,9 @@ class multi_index * uint32_t zipnumb = 93445; * auto zip_index = addresses.get_index(); * auto itr = zip_index.upper_bound(zipnumb); - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect First Upper Bound Record "); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect First Upper Bound Record "); * itr++; - * eosio_assert(itr == zip_index.end(), "Lock arf, Incorrect End of Iterator"); + * eosio::check(itr == zip_index.end(), "Lock arf, Incorrect End of Iterator"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1362,7 +1105,6 @@ class multi_index /** * Returns an available primary key. - * @brief Returns an available primary key. * * @return An available (unused) primary key value. * @@ -1373,22 +1115,8 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t key; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return key; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { * address_index addresses(_self, _self.value); // code, scope * // add to table, first argument is account to bill for storage @@ -1420,13 +1148,12 @@ class multi_index } } - eosio_assert( _next_primary_key < no_available_primary_key, "next primary key in table is at autoincrement limit"); + eosio::check( _next_primary_key < no_available_primary_key, "next primary key in table is at autoincrement limit"); return _next_primary_key; } /** * Returns an appropriately typed Secondary Index. - * @brief Returns an appropriately typed Secondary Index. * * @tparam IndexName - the ID of the desired secondary index * @@ -1454,21 +1181,12 @@ class multi_index * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} * typedef eosio::multi_index< name("address"), address, indexed_by< name("zip"), const_mem_fun > address_index; * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * address.zip = 93446; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below * uint32_t zipnumb = 93446; * auto zip_index = addresses.get_index(); * auto itr = zip_index.find(zipnumb); - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect Record "); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect Record "); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1489,7 +1207,6 @@ class multi_index /** * Returns an appropriately typed Secondary Index. - * @brief Returns an appropriately typed Secondary Index. * * @tparam IndexName - the ID of the desired secondary index * @@ -1498,36 +1215,13 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint32_t zip = 0; - * uint64_t primary_key() const { return account_name; } - * uint64_t by_zip() const { return zip; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address, indexed_by< name("zip"), const_mem_fun > address_index; + * // This assumes the code from the get_index() example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * address.zip = 93446; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1540,9 +1234,9 @@ class multi_index * uint32_t zipnumb = 93445; * auto zip_index = addresses.get_index(); * auto itr = zip_index.upper_bound(zipnumb); - * eosio_assert(itr->account_name == name("dan"), "Lock arf, Incorrect First Upper Bound Record "); + * eosio::check(itr->account_name == name("dan"), "Lock arf, Incorrect First Upper Bound Record "); * itr++; - * eosio_assert(itr == zip_index.end(), "Lock arf, Incorrect End of Iterator"); + * eosio::check(itr == zip_index.end(), "Lock arf, Incorrect End of Iterator"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1563,7 +1257,6 @@ class multi_index /** * Returns an iterator to the given object in a Multi-Index table. - * @brief Returns an iterator to the given object in a Multi-Index table. * * @param obj - A reference to the desired object * @@ -1572,36 +1265,13 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint32_t zip = 0; - * uint64_t primary_key() const { return account_name; } - * uint64_t by_zip() const { return zip; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address, indexed_by< name("zip"), const_mem_fun > address_index; + * // This assumes the code from the get_index() example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(payer, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * address.zip = 93446; - * }); + * // create reference to address_index - see emplace example below + * // add dan account to table - see emplace example below + * // add additional account - brendan + * * addresses.emplace(payer, [&](auto& address) { * address.account_name = "brendan"_n; * address.first_name = "Brendan"; @@ -1613,7 +1283,7 @@ class multi_index * }); * auto user = addresses.get("dan"_n); * auto itr = address.find("dan"_n); - * eosio_assert(iterator_to(user) == itr, "Invalid iterator"); + * eosio::check(iterator_to(user) == itr, "Invalid iterator"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1621,12 +1291,11 @@ class multi_index */ const_iterator iterator_to( const T& obj )const { const auto& objitem = static_cast(obj); - eosio_assert( objitem.__idx == this, "object passed to iterator_to is not in multi_index" ); + eosio::check( objitem.__idx == this, "object passed to iterator_to is not in multi_index" ); return {this, &objitem}; } /** * Adds a new object (i.e., row) to the table. - * @brief Adds a new object (i.e., row) to the table. * * @param payer - Account name of the payer for the Storage usage of the new object * @param constructor - Lambda function that does an in-place initialization of the object to be created in the table @@ -1643,22 +1312,8 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { * address_index addresses(_self, _self.value); // code, scope * // add to table, first argument is account to bill for storage @@ -1679,7 +1334,7 @@ class multi_index const_iterator emplace( name payer, Lambda&& constructor ) { using namespace _multi_index_detail; - eosio_assert( _code.value == current_receiver(), "cannot create objects in table of another contract" ); // Quick fix for mutating db using multi_index that shouldn't allow mutation. Real fix can come in RC2. + eosio::check( _code.value == current_receiver(), "cannot create objects in table of another contract" ); // Quick fix for mutating db using multi_index that shouldn't allow mutation. Real fix can come in RC2. auto itm = std::make_unique( this, [&]( auto& i ){ T& obj = static_cast(i); @@ -1722,7 +1377,6 @@ class multi_index /** * Modifies an existing object in a table. - * @brief Modifies an existing object in a table. * * @param itr - an iterator pointing to the object to be updated * @param payer - account name of the payer for the Storage usage of the updated row @@ -1743,35 +1397,14 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example + * // add dan account to table - see emplace example + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.end(), "Address for account not found"); + * eosio::check(itr != addresses.end(), "Address for account not found"); * addresses.modify( itr, account payer, [&]( auto& address ) { * address.city = "San Luis Obispo"; * address.state = "CA"; @@ -1783,14 +1416,13 @@ class multi_index */ template void modify( const_iterator itr, name payer, Lambda&& updater ) { - eosio_assert( itr != end(), "cannot pass end iterator to modify" ); + eosio::check( itr != end(), "cannot pass end iterator to modify" ); modify( *itr, payer, std::forward(updater) ); } /** * Modifies an existing object in a table. - * @brief Modifies an existing object in a table. * * @param obj - a reference to the object to be updated * @param payer - account name of the payer for the Storage usage of the updated row @@ -1811,40 +1443,19 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example + * // add dan account to table - see emplace example + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.end(), "Address for account not found"); + * eosio::check(itr != addresses.end(), "Address for account not found"); * addresses.modify( *itr, payer, [&]( auto& address ) { * address.city = "San Luis Obispo"; * address.state = "CA"; * }); - * eosio_assert(itr->city == "San Luis Obispo", "Lock arf, Address not modified"); + * eosio::check(itr->city == "San Luis Obispo", "Lock arf, Address not modified"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1855,9 +1466,9 @@ class multi_index using namespace _multi_index_detail; const auto& objitem = static_cast(obj); - eosio_assert( objitem.__idx == this, "object passed to modify is not in multi_index" ); + eosio::check( objitem.__idx == this, "object passed to modify is not in multi_index" ); auto& mutableitem = const_cast(objitem); - eosio_assert( _code.value == current_receiver(), "cannot modify objects in table of another contract" ); // Quick fix for mutating db using multi_index that shouldn't allow mutation. Real fix can come in RC2. + eosio::check( _code.value == current_receiver(), "cannot modify objects in table of another contract" ); // Quick fix for mutating db using multi_index that shouldn't allow mutation. Real fix can come in RC2. auto secondary_keys = hana::transform( _indices, [&]( auto&& idx ) { typedef typename decltype(+hana::at_c<0>(idx))::type index_type; @@ -1870,7 +1481,7 @@ class multi_index auto& mutableobj = const_cast(obj); // Do not forget the auto& otherwise it would make a copy and thus not update at all. updater( mutableobj ); - eosio_assert( pk == obj.primary_key(), "updater cannot change primary key when modifying an object" ); + eosio::check( pk == obj.primary_key(), "updater cannot change primary key when modifying an object" ); size_t size = pack_size( obj ); //using malloc/free here potentially is not exception-safe, although WASM doesn't support exceptions @@ -1908,7 +1519,6 @@ class multi_index /** * Retrieves an existing object from a table using its primary key. - * @brief Retrieves an existing object from a table using its primary key. * * @param primary - Primary key value of the object * @return A constant reference to the object containing the specified primary key. @@ -1918,35 +1528,14 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example + * // add dan account to table - see emplace example + * * auto user = addresses.get("dan"_n); - * eosio_assert(user.first_name == "Daniel", "Couldn't get him."); + * eosio::check(user.first_name == "Daniel", "Couldn't get him."); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -1954,13 +1543,12 @@ class multi_index */ const T& get( uint64_t primary, const char* error_msg = "unable to find key" )const { auto result = find( primary ); - eosio_assert( result != cend(), error_msg ); + eosio::check( result != cend(), error_msg ); return *result; } /** * Search for an existing object in a table using its primary key. - * @brief Search for an existing object in a table using its primary key. * * @param primary - Primary key value of the object * @return An iterator to the found object which has a primary key equal to `primary` OR the `end` iterator of the referenced table if an object with primary key `primary` is not found. @@ -1968,35 +1556,14 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example + * // add dan account to table - see emplace example + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.end(), "Couldn't get him."); + * eosio::check(itr != addresses.end(), "Couldn't get him."); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -2018,7 +1585,6 @@ class multi_index /** * Search for an existing object in a table using its primary key. - * @brief Search for an existing object in a table using its primary key. * * @param primary - Primary key value of the object * @param error_msg - error message if an object with primary key `primary` is not found. @@ -2033,7 +1599,7 @@ class multi_index return iterator_to(*(itr2->_item)); auto itr = db_find_i64( _code.value, _scope, static_cast(TableName), primary ); - eosio_assert( itr >= 0, error_msg ); + eosio::check( itr >= 0, error_msg ); const item& i = load_object_by_primary_iterator( itr ); return iterator_to(static_cast(i)); @@ -2041,7 +1607,6 @@ class multi_index /** * Remove an existing object from a table using its primary key. - * @brief Remove an existing object from a table using its primary key. * * @param itr - An iterator pointing to the object to be removed * @@ -2060,44 +1625,23 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); + * // create reference to address_index - see emplace example + * // add dan account to table - see emplace example + * * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.end(), "Address for account not found"); + * eosio::check(itr != addresses.end(), "Address for account not found"); * addresses.erase( itr ); - * eosio_assert(itr != addresses.end(), "Everting lock arf, Address not erased properly"); + * eosio::check(itr != addresses.end(), "Everting lock arf, Address not erased properly"); * } * } * EOSIO_ABI( addressbook, (myaction) ) * @endcode */ const_iterator erase( const_iterator itr ) { - eosio_assert( itr != end(), "cannot pass end iterator to erase" ); + eosio::check( itr != end(), "cannot pass end iterator to erase" ); const auto& obj = *itr; ++itr; @@ -2109,7 +1653,6 @@ class multi_index /** * Remove an existing object from a table using its primary key. - * @brief Remove an existing object from a table using its primary key. * * @param obj - Object to be removed * @@ -2126,38 +1669,14 @@ class multi_index * Example: * * @code - * #include - * using namespace eosio; - * using namespace std; - * class addressbook: contract { - * struct address { - * uint64_t account_name; - * string first_name; - * string last_name; - * string street; - * string city; - * string state; - * uint64_t primary_key() const { return account_name; } - * }; - * public: - * addressbook(name receiver, name code, datastream ds):contract(receiver, code, ds) {} - * typedef eosio::multi_index< name("address"), address > address_index; + * // This assumes the code from the constructor example. Replace myaction() {...} + * * void myaction() { - * address_index addresses(_self, _self.value); // code, scope - * // add to table, first argument is account to bill for storage - * addresses.emplace(_self, [&](auto& address) { - * address.account_name = "dan"_n; - * address.first_name = "Daniel"; - * address.last_name = "Larimer"; - * address.street = "1 EOS Way"; - * address.city = "Blacksburg"; - * address.state = "VA"; - * }); * auto itr = addresses.find("dan"_n); - * eosio_assert(itr != addresses.end(), "Record is not found"); + * eosio::check(itr != addresses.end(), "Record is not found"); * addresses.erase(*itr); * itr = addresses.find("dan"_n); - * eosio_assert(itr == addresses.end(), "Record is not deleted"); + * eosio::check(itr == addresses.end(), "Record is not deleted"); * } * } * EOSIO_DISPATCH( addressbook, (myaction) ) @@ -2167,15 +1686,15 @@ class multi_index using namespace _multi_index_detail; const auto& objitem = static_cast(obj); - eosio_assert( objitem.__idx == this, "object passed to erase is not in multi_index" ); - eosio_assert( _code.value == current_receiver(), "cannot erase objects in table of another contract" ); // Quick fix for mutating db using multi_index that shouldn't allow mutation. Real fix can come in RC2. + eosio::check( objitem.__idx == this, "object passed to erase is not in multi_index" ); + eosio::check( _code.value == current_receiver(), "cannot erase objects in table of another contract" ); // Quick fix for mutating db using multi_index that shouldn't allow mutation. Real fix can come in RC2. auto pk = objitem.primary_key(); auto itr2 = std::find_if(_items_vector.rbegin(), _items_vector.rend(), [&](const item_ptr& ptr) { return ptr._item->primary_key() == pk; }); - eosio_assert( itr2 != _items_vector.rend(), "attempt to remove object that was not in multi_index" ); + eosio::check( itr2 != _items_vector.rend(), "attempt to remove object that was not in multi_index" ); _items_vector.erase(--(itr2.base())); diff --git a/libraries/eosiolib/name.hpp b/libraries/eosiolib/name.hpp index e3d9cac2a4..1a09c75e8e 100644 --- a/libraries/eosiolib/name.hpp +++ b/libraries/eosiolib/name.hpp @@ -1,46 +1,80 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include +#include "system.hpp" +#include "serialize.hpp" + #include #include namespace eosio { /** - * Wraps a uint64_t to ensure it is only passed to methods that expect a Name and - * that no mathematical operations occur. It also enables specialization of print - * so that it is printed as a base32 string. - * - * @brief wraps a uint64_t to ensure it is only passed to methods that expect a Name - * @ingroup types + * @defgroup name + * @ingroup types + * @brief EOSIO Types + * @{ + + /* + * Wraps a %uint64_t to ensure it is only passed to methods that expect a %name. + * Ensures value is only passed to methods that expect a %name and that no mathematical + * operations occur. Also enables specialization of print */ struct name { public: enum class raw : uint64_t {}; + /** + * Construct a new name + * + * @brief Construct a new name object defaulting to a value of 0 + * + */ constexpr name() : value(0) {} + /** + * Construct a new name given a unit64_t value + * + * @brief Construct a new name object initialising value with v + * @param v - The unit64_t value + * + */ constexpr explicit name( uint64_t v ) :value(v) {} + /** + * Construct a new name given a scoped enumerated type of raw (uint64_t). + * + * @brief Construct a new name object initialising value with r + * @param r - The raw value which is a scoped enumerated type of unit64_t + * + */ constexpr explicit name( name::raw r ) :value(static_cast(r)) {} + /** + * Construct a new name given an string. + * + * @brief Construct a new name object initialising value with str + * @param str - The string value which validated then converted to unit64_t + * + */ constexpr explicit name( std::string_view str ) :value(0) { if( str.size() > 13 ) { - eosio_assert( false, "string is too long to be a valid name" ); + eosio::check( false, "string is too long to be a valid name" ); + } + if( str.empty() ) { + return; } - auto n = std::min( str.size(), 12u ); + auto n = std::min( (uint32_t)str.size(), (uint32_t)12u ); for( decltype(n) i = 0; i < n; ++i ) { value <<= 5; value |= char_to_value( str[i] ); @@ -49,16 +83,15 @@ namespace eosio { if( str.size() == 13 ) { uint64_t v = char_to_value( str[12] ); if( v > 0x0Full ) { - eosio_assert(false, "thirteenth character in name cannot be a letter that comes after j"); + eosio::check(false, "thirteenth character in name cannot be a letter that comes after j"); } value |= v; } } /** - * Converts a (eosio::name style) Base32 symbol into its corresponding value + * Converts a %name Base32 symbol into its corresponding value * - * @brief Converts a (eosio::name style) Base32 symbol into its corresponding value * @param c - Character to be converted * @return constexpr char - Converted value */ @@ -70,13 +103,13 @@ namespace eosio { else if( c >= 'a' && c <= 'z' ) return (c - 'a') + 6; else - eosio_assert( false, "character is not in allowed character set for names" ); + eosio::check( false, "character is not in allowed character set for names" ); return 0; // control flow will never reach here; just added to suppress warning } /** - * Returns the length of the name + * Returns the length of the %name */ constexpr uint8_t length()const { constexpr uint64_t mask = 0xF800000000000000ull; @@ -96,7 +129,7 @@ namespace eosio { } /** - * Returns the suffix of the name + * Returns the suffix of the %name */ constexpr name suffix()const { uint32_t remaining_bits_after_last_actual_dot = 0; @@ -116,7 +149,7 @@ namespace eosio { remaining_bits_after_last_actual_dot = tmp; } - if( remaining_bits_after_last_actual_dot == 0 ) // there is no actual dot in the name other than potentially leading dots + if( remaining_bits_after_last_actual_dot == 0 ) // there is no actual dot in the %name other than potentially leading dots return name{value}; // At this point remaining_bits_after_last_actual_dot has to be within the range of 4 to 59 (and restricted to increments of 5). @@ -128,21 +161,29 @@ namespace eosio { return name{ ((value & mask) << shift) + (thirteenth_character << (shift-1)) }; } + /** + * Casts a name to raw + * + * @return Returns an instance of raw based on the value of a name + */ constexpr operator raw()const { return raw(value); } + /** + * Explicit cast to bool of the uint64_t value of the name + * + * @return Returns true if the name is set to the default value of 0 else true. + */ constexpr explicit operator bool()const { return value != 0; } /** - * Writes the name as a string to the provided char buffer - * + * Writes the %name as a string to the provided char buffer * - * @brief Writes the name as a string to the provided char buffer * @pre Appropriate Size Precondition: (begin + 13) <= end and (begin + 13) does not overflow * @pre Valid Memory Region Precondition: The range [begin, end) must be a valid range of memory to write to. * @param begin - The start of the char buffer * @param end - Just past the end of the char buffer * @return char* - Just past the end of the last character written (returns begin if the Appropriate Size Precondition is not satisfied) - * @post If the Appropriate Size Precondition is satisfied, the range [begin, returned pointer) contains the string representation of the name. + * @post If the Appropriate Size Precondition is satisfied, the range [begin, returned pointer) contains the string representation of the %name. */ char* write_as_string( char* begin, char* end )const { static const char* charmap = ".12345abcdefghijklmnopqrstuvwxyz"; @@ -162,6 +203,11 @@ namespace eosio { return begin; } + /** + * Returns the name as a string. + * + * @brief Returns the name value as a string by calling write_as_string() and returning the buffer produced by write_as_string() + */ std::string to_string()const { char buffer[13]; auto end = write_as_string( buffer, buffer + sizeof(buffer) ); @@ -171,8 +217,7 @@ namespace eosio { /** * Equivalency operator. Returns true if a == b (are the same) * - * @brief Equivalency operator - * @return boolean - true if both provided names are the same + * @return boolean - true if both provided %name values are the same */ friend constexpr bool operator == ( const name& a, const name& b ) { return a.value == b.value; @@ -181,8 +226,7 @@ namespace eosio { /** * Inverted equivalency operator. Returns true if a != b (are different) * - * @brief Inverted equivalency operator - * @return boolean - true if both provided names are not the same + * @return boolean - true if both provided %name values are not the same */ friend constexpr bool operator != ( const name& a, const name& b ) { return a.value != b.value; @@ -190,8 +234,8 @@ namespace eosio { /** * Less than operator. Returns true if a < b. - * @brief Less than operator - * @return boolean - true if name `a` is less than `b` + * + * @return boolean - true if %name `a` is less than `b` */ friend constexpr bool operator < ( const name& a, const name& b ) { return a.value < b.value; @@ -202,7 +246,7 @@ namespace eosio { EOSLIB_SERIALIZE( name, (value) ) }; - + namespace detail { template struct to_const_char_arr { @@ -212,12 +256,15 @@ namespace eosio { } /// namespace eosio /** - * name literal operator + * %name literal operator * - * @brief "foo"_n is a shortcut for name{"foo"} + * @brief "foo"_n is a shortcut for name("foo") */ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wgnu-string-literal-operator-template" template inline constexpr eosio::name operator""_n() { constexpr auto x = eosio::name{std::string_view{eosio::detail::to_const_char_arr::value, sizeof...(Str)}}; return x; } +#pragma clang diagnostic pop diff --git a/libraries/eosiolib/permission.h b/libraries/eosiolib/permission.h index 4e3c0f36ae..f24eceeb86 100644 --- a/libraries/eosiolib/permission.h +++ b/libraries/eosiolib/permission.h @@ -1,13 +1,22 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +#include "types.h" extern "C" { + + /** + * @defgroup permission_c Permissions C API + * @ingroup c_api + * + * @brief Methods for testing against transactions, delays, keys and permissions + * @{ + */ + /** - * @brief Checks if a transaction is authorized by a provided set of keys and permissions + * Checks if a transaction is authorized by a provided set of keys and permissions * * @param trx_data - pointer to the start of the serialized transaction * @param trx_size - size (in bytes) of the serialized transaction @@ -25,9 +34,9 @@ extern "C" { ); /** - * @brief Checks if a permission is authorized by a provided delay and a provided set of keys and permissions + * Checks if a permission is authorized by a provided delay and a provided set of keys and permissions * - * @param account - the account owner of the permission + * @param account - the account owner of the permission * @param permission - the name of the permission to check for authorization * @param pubkeys_data - pointer to the start of the serialized vector of provided public keys * @param pubkeys_size - size (in bytes) of serialized vector of provided public keys (can be 0 if no public keys are to be provided) @@ -46,7 +55,7 @@ extern "C" { ); /** - * @brief Returns the last used time of a permission + * Returns the last used time of a permission * * @param account - the account owner of the permission * @param permission - the name of the permission @@ -57,12 +66,14 @@ extern "C" { /** - * @brief Returns the creation time of an account + * Returns the creation time of an account * - * @param account - the account + * @param account - the account * * @return the creation time (in microseconds since Unix epoch) of the account */ int64_t get_account_creation_time( capi_name account ); + ///@} + } diff --git a/libraries/eosiolib/permission.hpp b/libraries/eosiolib/permission.hpp index a5586d2c2f..c29d88f8b6 100644 --- a/libraries/eosiolib/permission.hpp +++ b/libraries/eosiolib/permission.hpp @@ -1,12 +1,12 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include +#include "permission.h" +#include "transaction.hpp" +#include "crypto.hpp" #include #include @@ -14,7 +14,7 @@ namespace eosio { /** - * @brief Checks if a transaction is authorized by a provided set of keys and permissions + * Checks if a transaction is authorized by a provided set of keys and permissions * * @param trx - the transaction for which to check authorizations * @param provided_permissions - the set of permissions which have authorized the transaction (empty permission name acts as wildcard) @@ -54,7 +54,7 @@ namespace eosio { } /** - * @brief Checks if a permission is authorized by a provided delay and a provided set of keys and permissions + * Checks if a permission is authorized by a provided delay and a provided set of keys and permissions * * @param account - the account owner of the permission * @param permission - the permission name to check for authorization diff --git a/libraries/eosiolib/print.h b/libraries/eosiolib/print.h index 196e3a6916..9248328cc8 100644 --- a/libraries/eosiolib/print.h +++ b/libraries/eosiolib/print.h @@ -1,35 +1,29 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +#include "types.h" + +/** + * @defgroup console_c Console C API + * @ingroup c_api + * @brief Defnes %C API to log/print text messages + * @{ + */ #ifdef __cplusplus extern "C" { #endif - /** - * @defgroup consoleapi Console API - * @brief Defines APIs to log/print text messages - * @ingroup contractdev - * - */ - - /** - * @defgroup consolecapi Console C API - * @brief Defnes %C API to log/print text messages - * @ingroup consoleapi - * @{ - */ /** * Prints string - * @brief Prints string + * * @param cstr - a null terminated string * * Example: -* + * * @code * prints("Hello World!"); // Output: Hello World! * @endcode @@ -38,12 +32,12 @@ extern "C" { /** * Prints string up to given length - * @brief Prints string + * * @param cstr - pointer to string * @param len - len of string to be printed * * Example: -* + * * @code * prints_l("Hello World!", 5); // Output: Hello * @endcode @@ -52,11 +46,12 @@ extern "C" { /** * Prints value as a 64 bit signed integer + * * @brief Prints value as a 64 bit signed integer * @param value of 64 bit signed integer to be printed * * Example: -* + * * @code * printi(-1e+18); // Output: -1000000000000000000 * @endcode @@ -65,11 +60,11 @@ extern "C" { /** * Prints value as a 64 bit unsigned integer - * @brief Prints value as a 64 bit unsigned integer + * * @param value of 64 bit unsigned integer to be printed * * Example: -* + * * @code * printui(1e+18); // Output: 1000000000000000000 * @endcode @@ -78,11 +73,11 @@ extern "C" { /** * Prints value as a 128 bit signed integer - * @brief Prints value as a 128 bit signed integer + * * @param value is a pointer to the 128 bit signed integer to be printed * * Example: -* + * * @code * int128_t large_int(-87654323456); * printi128(&large_int); // Output: -87654323456 @@ -92,11 +87,11 @@ extern "C" { /** * Prints value as a 128 bit unsigned integer - * @brief Prints value as a 128 bit unsigned integer + * * @param value is a pointer to the 128 bit unsigned integer to be printed * * Example: -* + * * @code * uint128_t large_int(87654323456); * printui128(&large_int); // Output: 87654323456 @@ -106,11 +101,11 @@ extern "C" { /** * Prints value as single-precision floating point number - * @brief Prints value as single-precision floating point number (i.e. float) + * * @param value of float to be printed * * Example: -* + * * @code * float value = 5.0 / 10.0; * printsf(value); // Output: 0.5 @@ -120,11 +115,11 @@ extern "C" { /** * Prints value as double-precision floating point number - * @brief Prints value as double-precision floating point number (i.e. double) + * * @param value of double to be printed * * Example: -* + * * @code * double value = 5.0 / 10.0; * printdf(value); // Output: 0.5 @@ -134,11 +129,11 @@ extern "C" { /** * Prints value as quadruple-precision floating point number - * @brief Prints value as quadruple-precision floating point number (i.e. long double) + * * @param value is a pointer to the long double to be printed * * Example: -* + * * @code * long double value = 5.0 / 10.0; * printqf(value); // Output: 0.5 @@ -148,7 +143,7 @@ extern "C" { /** * Prints a 64 bit names as base32 encoded string - * @brief Prints a 64 bit names as base32 encoded string + * * @param name - 64 bit name to be printed * * Example: @@ -158,9 +153,20 @@ extern "C" { */ void printn( uint64_t name ); - /** + /** + * Prints hexidecimal data of length datalen + * + * @brief Prints hexidecimal data of length datalen + * @param data to be printed + * @param datalen length of the data to be printed + * + * Example + * @code + * unsigned char rawData[9] = {0x49 0x20 0x6C 0x6F 0x76 0x65 0x20 0x62 0x6D}; + * printhex(&rawData, 9); + * @endcode */ - void printhex( const void* data, uint32_t datalen ); + void printhex( const void* data, uint32_t datalen ); /// @} #ifdef __cplusplus diff --git a/libraries/eosiolib/print.hpp b/libraries/eosiolib/print.hpp index b1b8bda58c..8c599444b2 100644 --- a/libraries/eosiolib/print.hpp +++ b/libraries/eosiolib/print.hpp @@ -1,173 +1,104 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include -#include -#include +#include "print.h" +#include "name.hpp" +#include "symbol.hpp" +#include "fixed_bytes.hpp" + #include #include -namespace eosio { +/** + * @defgroup console Console C++ API + * @ingroup cpp_api + * @brief Defines C++ wrapper to log/print text messages + * + * @details This API uses C++ variadic templates and type detection to + * make it easy to print any native type. You can even overload + * the `print()` method for your own custom types. + * + * **Example:** + * ``` + * print( "hello world, this is a number: ", 5 ); + * ``` + * + * @section override Overriding Print for your Types + * + * There are two ways to overload print: + * 1. implement void print( const T& ) + * 2. implement T::print()const + * + * @{ + */ - static_assert( sizeof(long) == sizeof(int), "unexpected size difference" ); + +namespace eosio { /** * Prints string * - * @brief Prints string * @param ptr - a null terminated string */ inline void print( const char* ptr ) { prints(ptr); } - inline void print( const std::string& s) { - prints_l( s.c_str(), s.size() ); - } - - inline void print( std::string&& s) { - prints_l( s.c_str(), s.size() ); - } - - inline void print( const char c ) { - prints_l( &c, 1 ); - } - - /** - * Prints signed integer - * - * @brief Prints signed integer as a 64 bit signed integer - * @param num to be printed - */ - inline void print( int num ) { - printi(num); - } - - /** - * Prints 32 bit signed integer - * - * @brief Prints 32 bit signed integer as a 64 bit signed integer - * @param num to be printed - */ - inline void print( int32_t num ) { - printi(num); - } - - /** - * Prints 64 bit signed integer - * - * @brief Prints 64 bit signed integer as a 64 bit signed integer - * @param num to be printed - */ - inline void print( int64_t num ) { - printi(num); - } - - - /** - * Prints unsigned integer - * - * @brief Prints unsigned integer as a 64 bit unsigned integer - * @param num to be printed - */ - inline void print( unsigned int num ) { - printui(num); - } - - /** - * Prints 32 bit unsigned integer - * - * @brief Prints 32 bit unsigned integer as a 64 bit unsigned integer - * @param num to be printed - */ - inline void print( uint32_t num ) { - printui(num); - } - - /** - * Prints 64 bit unsigned integer - * - * @brief Prints 64 bit unsigned integer as a 64 bit unsigned integer - * @param num to be printed - */ - inline void print( uint64_t num ) { - printui(num); - } - /** - * Prints 128 bit signed integer + * Prints 8-128 bit signed integer * - * @brief Prints 128 bit signed integer * @param num to be printed */ - inline void print( int128_t num ) { - printi128(&num); + template >::value && + std::is_signed>::value, int> = 0> + inline void print( T num ) { + if constexpr(std::is_same::value) + printi128(&num); + else if constexpr(std::is_same::value) + prints_l( &num, 1 ); + else + printi(num); } /** - * Prints 128 bit unsigned integer + * Prints 8-128 bit unsigned integer * - * @brief Prints 128 bit unsigned integer * @param num to be printed */ - inline void print( uint128_t num ) { - printui128(&num); + template >::value && + !std::is_signed>::value, int> = 0> + inline void print( T num ) { + if constexpr(std::is_same::value) + printui128(&num); + else if constexpr(std::is_same::value) + prints(num?"true":"false"); + else + printui(num); } - /** - * Prints single-precision floating point number + * Prints single-precision floating point number (i.e. float) * - * @brief Prints single-precision floating point number (i.e. float) * @param num to be printed */ inline void print( float num ) { printsf( num ); } /** - * Prints double-precision floating point number + * Prints double-precision floating point number (i.e. double) * - * @brief Prints double-precision floating point number (i.e. double) * @param num to be printed */ inline void print( double num ) { printdf( num ); } /** - * Prints quadruple-precision floating point number + * Prints quadruple-precision floating point number (i.e. long double) * - * @brief Prints quadruple-precision floating point number (i.e. long double) * @param num to be printed */ inline void print( long double num ) { printqf( &num ); } - - /** - * Prints fixed_key as a hexidecimal string - * - * @brief Prints fixed_key as a hexidecimal string - * @param val to be printed - */ - template - inline void print( const fixed_key& val ) { - auto arr = val.extract_as_byte_array(); - prints("0x"); - printhex(static_cast(arr.data()), arr.size()); - } - - /** - * Prints fixed_key as a hexidecimal string - * - * @brief Prints fixed_key as a hexidecimal string - * @param val to be printed - */ - template - inline void print( fixed_key& val ) { - print(static_cast&>(val)); - } - /** * Prints fixed_bytes as a hexidecimal string * @@ -194,7 +125,6 @@ namespace eosio { /** * Prints a 64 bit names as base32 encoded string * - * @brief Prints a 64 bit names as base32 encoded string * @param name 64 bit name to be printed */ inline void print( name name ) { @@ -204,7 +134,6 @@ namespace eosio { /** * Prints a symbol_code * - * @brief Prints a symbol_code * @param sym_code symbol code to be printed */ inline void print( eosio::symbol_code sym_code ) { @@ -214,67 +143,34 @@ namespace eosio { prints_l( buffer, (end-buffer) ); } - /** - * Prints bool - * - * @brief Prints bool - * @param val to be printed - */ - inline void print( bool val ) { - prints(val?"true":"false"); - } - - /** * Prints class object * - * @brief Prints class object * @param t to be printed * @pre T must implements print() function */ - template + template>::value, int> = 0> inline void print( T&& t ) { - t.print(); + if constexpr (std::is_same, std::string>::value) + prints_l( t.c_str(), t.size() ); + else if constexpr (std::is_same, char*>::value) + prints(t); + else + t.print(); } /** * Prints null terminated string * - * @brief Prints null terminated string * @param s null terminated string to be printed */ inline void print_f( const char* s ) { prints(s); } - /** - * @defgroup consolecppapi Console C++ API - * @ingroup consoleapi - * @brief Defines C++ wrapper to log/print text messages - * - * This API uses C++ variadic templates and type detection to - * make it easy to print any native type. You can even overload - * the `print()` method for your own custom types. - * - * **Example:** - * ``` - * print( "hello world, this is a number: ", 5 ); - * ``` - * - * @section override Overriding Print for your Types - * - * There are two ways to overload print: - * 1. implement void print( const T& ) - * 2. implement T::print()const - * - * @{ - */ - - /** * Prints formatted string. It behaves similar to C printf/ * - * @brief Prints formatted string * @tparam Arg - Type of the value used to replace the format specifier * @tparam Args - Type of the value used to replace the format specifier * @param s - Null terminated string with to be printed (it can contains format specifier) @@ -301,12 +197,14 @@ namespace eosio { /** * Print out value / list of values - * @brief Print out value / list of values + * + * @tparam Arg - Type of the value used to replace the format specifier + * @tparam Args - Type of the value used to replace the format specifier * @param a - The value to be printed * @param args - The other values to be printed * * Example: -* + * * @code * const char *s = "Hello World!"; * uint64_t unsigned_64_bit_int = 1e+18; @@ -329,13 +227,15 @@ namespace eosio { /** * Overload c++ iostream - * @brief Overload c++ iostream + * + * @tparam Arg - Type of the value used to replace the format specifier + * @tparam Args - Type of the value used to replace the format specifier * @param out - Output strem * @param v - The value to be printed * @return iostream& - Reference to the input output stream * * Example: -* + * * @code * const char *s = "Hello World!"; * uint64_t unsigned_64_bit_int = 1e+18; diff --git a/libraries/eosiolib/privileged.h b/libraries/eosiolib/privileged.h index c23eff88b9..99be139761 100644 --- a/libraries/eosiolib/privileged.h +++ b/libraries/eosiolib/privileged.h @@ -5,22 +5,14 @@ extern "C" { #endif /** - * @defgroup privilegedapi Privileged API - * @ingroup systemapi - * @brief Defines an API for accessing configuration of the chain that can only be done by privileged accounts - */ - - /** - * @defgroup privilegedcapi Privileged C API - * @ingroup privilegedapi + * @defgroup privileged_c Privileged C API + * @ingroup c_api * @brief Defines %C Privileged API - * - * @{ */ /** - * @brief Get the resource limits of an account * Get the resource limits of an account + * * @param account - name of the account whose resource limit to get * @param ram_bytes - pointer to `int64_t` to hold retrieved ram limit in absolute bytes * @param net_weight - pointer to `int64_t` to hold net limit @@ -29,8 +21,8 @@ extern "C" { void get_resource_limits( capi_name account, int64_t* ram_bytes, int64_t* net_weight, int64_t* cpu_weight ); /** - * @brief Set the resource limits of an account * Set the resource limits of an account + * * @param account - name of the account whose resource limit to be set * @param ram_bytes - ram limit in absolute bytes * @param net_weight - fractionally proportionate net limit of available resources based on (weight / total_weight_of_all_accounts) @@ -39,7 +31,9 @@ extern "C" { void set_resource_limits( capi_name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ); /** - * Proposes a schedule change, once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active" + * Proposes a schedule change + * + * @note Once the block that contains the proposal becomes irreversible, the schedule is promoted to "pending" automatically. Once the block that promotes the schedule is irreversible, the schedule will become "active" * @param producer_data - packed data of produce_keys in the appropriate producer schedule order * @param producer_data_size - size of the data buffer * @@ -48,16 +42,16 @@ extern "C" { int64_t set_proposed_producers( char *producer_data, uint32_t producer_data_size ); /** - * @brief Set new active producers * Set new active producers. Producers will only be activated once the block which starts the next round is irrreversible + * * @param producer_data - pointer to producer schedule packed as bytes * @param producer_data_size - size of the packed producer schedule * @pre `producer_data` is a valid pointer to a range of memory at least `producer_data_size` bytes long that contains serialized produced schedule data */ void set_active_producers( char *producer_data, uint32_t producer_data_size ); /** - * @brief Check if an account is privileged * Check if an account is privileged + * * @param account - name of the account to be checked * @return true if the account is privileged * @return false if the account is not privileged @@ -65,16 +59,16 @@ extern "C" { bool is_privileged( capi_name account ); /** - * @brief Set the privileged status of an account * Set the privileged status of an account + * * @param account - name of the account whose privileged account to be set * @param is_priv - privileged status */ void set_privileged( capi_name account, bool is_priv ); /** - * @brief Set the blockchain parameters * Set the blockchain parameters + * * @param data - pointer to blockchain parameters packed as bytes * @param datalen - size of the packed blockchain parameters * @pre `data` is a valid pointer to a range of memory at least `datalen` bytes long that contains packed blockchain params data @@ -82,8 +76,8 @@ extern "C" { void set_blockchain_parameters_packed( char* data, uint32_t datalen ); /** - * @brief Retrieve the blolckchain parameters * Retrieve the blolckchain parameters + * * @param data - output buffer of the blockchain parameters, only retrieved if sufficent size to hold packed data. * @param datalen - size of the data buffer, 0 to report required size. * @return size of the blockchain parameters @@ -113,14 +107,6 @@ extern "C" { void set_guaranteed_minimum_resources(int64_t ram, int64_t cpu, int64_t net); /* bos end */ - /** - * @brief Activate new feature - * Activate new feature - * @param f - name (identifier) of the feature to be activated - */ - void activate_feature( int64_t f ); - - ///@ } privilegedcapi #ifdef __cplusplus } #endif diff --git a/libraries/eosiolib/privileged.hpp b/libraries/eosiolib/privileged.hpp index 73ae1af244..4eb8bb97d7 100644 --- a/libraries/eosiolib/privileged.hpp +++ b/libraries/eosiolib/privileged.hpp @@ -5,75 +5,116 @@ namespace eosio { - /** - * @defgroup privilegedcppapi Privileged C++ API - * @ingroup privilegedapi - * @brief Defines C++ Privileged API - * - * @{ - */ + /** + * @addtogroup privileged Privileged C++ API + * @ingroup cpp_api + * Defines C++ Privileged API + * @{ + */ /** * Tunable blockchain configuration that can be changed via consensus - * - * @brief Tunable blockchain configuration that can be changed via consensus */ struct blockchain_parameters { + /** + * The maxiumum net usage in instructions for a block + * @brief the maxiumum net usage in instructions for a block + */ uint64_t max_block_net_usage; + /** + * The target percent (1% == 100, 100%= 10,000) of maximum net usage; exceeding this triggers congestion handling + * @brief The target percent (1% == 100, 100%= 10,000) of maximum net usage; exceeding this triggers congestion handling + */ uint32_t target_block_net_usage_pct; + /** + * The maximum objectively measured net usage that the chain will allow regardless of account limits + * @brief The maximum objectively measured net usage that the chain will allow regardless of account limits + */ uint32_t max_transaction_net_usage; /** * The base amount of net usage billed for a transaction to cover incidentals - * @brief The base amount of net usage billed for a transaction to cover incidentals */ uint32_t base_per_transaction_net_usage; + /** + * The amount of net usage leeway available whilst executing a transaction (still checks against new limits without leeway at the end of the transaction) + * @brief The amount of net usage leeway available whilst executing a transaction (still checks against new limits without leeway at the end of the transaction) + */ uint32_t net_usage_leeway; + /** + * The numerator for the discount on net usage of context-free data + * @brief The numerator for the discount on net usage of context-free data + */ uint32_t context_free_discount_net_usage_num; + /** + * The denominator for the discount on net usage of context-free data + * @brief The denominator for the discount on net usage of context-free data + */ uint32_t context_free_discount_net_usage_den; + /** + * The maxiumum billable cpu usage (in microseconds) for a block + * @brief The maxiumum billable cpu usage (in microseconds) for a block + */ uint32_t max_block_cpu_usage; + /** + * The target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion handling + * @brief The target percent (1% == 100, 100%= 10,000) of maximum cpu usage; exceeding this triggers congestion handling + */ uint32_t target_block_cpu_usage_pct; + /** + * The maximum billable cpu usage (in microseconds) that the chain will allow regardless of account limits + * @brief The maximum billable cpu usage (in microseconds) that the chain will allow regardless of account limits + */ uint32_t max_transaction_cpu_usage; + /** + * The minimum billable cpu usage (in microseconds) that the chain requires + * @brief The minimum billable cpu usage (in microseconds) that the chain requires + */ uint32_t min_transaction_cpu_usage; /** * Maximum lifetime of a transacton - * * @brief Maximum lifetime of a transacton */ uint32_t max_transaction_lifetime; + /** + * The number of seconds after the time a deferred transaction can first execute until it expires + * @brief the number of seconds after the time a deferred transaction can first execute until it expires + */ uint32_t deferred_trx_expiration_window; + + /** + * The maximum number of seconds that can be imposed as a delay requirement by authorization checks + * @brief The maximum number of seconds that can be imposed as a delay requirement by authorization checks + */ uint32_t max_transaction_delay; /** * Maximum size of inline action - * * @brief Maximum size of inline action */ uint32_t max_inline_action_size; /** * Maximum depth of inline action - * * @brief Maximum depth of inline action */ uint16_t max_inline_action_depth; /** * Maximum authority depth - * * @brief Maximum authority depth */ uint16_t max_authority_depth; @@ -106,13 +147,10 @@ namespace eosio { */ void get_blockchain_parameters(eosio::blockchain_parameters& params); - ///@} priviledgedcppapi + ///@} /** - * @defgroup producertype Producer Type - * @ingroup types - * @brief Defines producer type - * + * @defgroup types * @{ */ @@ -143,4 +181,8 @@ namespace eosio { EOSLIB_SERIALIZE( producer_key, (producer_name)(block_signing_key) ) }; + + ///@} + + } diff --git a/libraries/eosiolib/producer_schedule.hpp b/libraries/eosiolib/producer_schedule.hpp index 8fd2a26c97..e6cea7455a 100644 --- a/libraries/eosiolib/producer_schedule.hpp +++ b/libraries/eosiolib/producer_schedule.hpp @@ -1,27 +1,25 @@ #pragma once -#include +#include "privileged.hpp" #include namespace eosio { /** - * Defines both the order, account name, and signing keys of the active set of producers. - * - * @brief Defines both the order, account name, and signing keys of the active set of producers. - */ + * @defgroup producer_schedule + * @brief Defines both the order, account name, and signing keys of the active set of producers. + * @ingroup types + * + * @{ + */ struct producer_schedule { /** * Version number of the schedule. It is sequentially incrementing version number - * - * @brief Version number of the schedule */ uint32_t version; /** * List of producers for this schedule, including its signing key - * - * @brief List of producers for this schedule, including its signing key */ std::vector producers; }; diff --git a/libraries/eosiolib/public_key.hpp b/libraries/eosiolib/public_key.hpp index 5fb09ac799..b3d53bc273 100644 --- a/libraries/eosiolib/public_key.hpp +++ b/libraries/eosiolib/public_key.hpp @@ -1,5 +1,5 @@ #pragma once -#include +#include "crypto.hpp" // This file only exists so that existing contracts that include eosiolib/public_key.hpp do not break. // Going forward contracts should instead just include eosiolib/crypto.hpp diff --git a/libraries/eosiolib/reflect.hpp b/libraries/eosiolib/reflect.hpp deleted file mode 100644 index 569852d493..0000000000 --- a/libraries/eosiolib/reflect.hpp +++ /dev/null @@ -1,186 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include - -namespace eosio { - template - struct reflector { - typedef std::false_type is_reflected; - typedef std::false_type is_enum; - }; - -} /// eosio - - - -#define EOSLIB_REFLECT_VISIT_BASE(r, visitor, base) \ - eosio::reflector::visit( visitor ); - -#define EOSLIB_REFLECT_VISIT2_BASE(r, visitor, base) \ - eosio::reflector::visit( t, forward(visitor) ); - - -#define EOSLIB_REFLECT_VISIT_MEMBER( r, visitor, elem ) \ -{ typedef decltype((static_cast(nullptr))->elem) member_type; \ - visitor( &type::elem ); \ -} - -#define EOSLIB_REFLECT_VISIT2_MEMBER( r, visitor, elem ) \ -{ typedef decltype((static_cast(nullptr))->elem) member_type; \ - visitor( t.elem ); \ -} - - -#define EOSLIB_REFLECT_BASE_MEMBER_COUNT( r, OP, elem ) \ - OP eosio::reflector::total_member_count - -#define EOSLIB_REFLECT_MEMBER_COUNT( r, OP, elem ) \ - OP 1 - -#define EOSLIB_REFLECT_DERIVED_IMPL_INLINE( TYPE, INHERITS, MEMBERS ) \ -template\ -static inline void visit( Visitor&& v ) { \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT_BASE, v, INHERITS ) \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT_MEMBER, v, MEMBERS ) \ -} \ -template\ -static inline void visit( const type& t, Visitor&& v ) { \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT2_BASE, v, INHERITS ) \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT2_MEMBER, v, MEMBERS ) \ -} \ -template\ -static inline void visit( type& t, Visitor&& v ) { \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT2_BASE, v, INHERITS ) \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT2_MEMBER, v, MEMBERS ) \ -} - -#define EOSLIB_REFLECT_DERIVED_IMPL_EXT( TYPE, INHERITS, MEMBERS ) \ -template\ -void eosio::reflector::visit( Visitor&& v ) { \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT_BASE, v, INHERITS ) \ - BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_VISIT_MEMBER, v, MEMBERS ) \ -} - - -/** - * @addtogroup serializecpp - * @{ - */ - -/** - * Perform class reflection - * - * @brief Specializes eosio::reflector for TYPE - * @param TYPE - the class template to be reflected - * @param MEMBERS - a sequence of member names. (field1)(field2)(field3) - * - * @see EOSLIB_REFLECT_DERIVED - */ -#define EOSLIB_REFLECT( TYPE, MEMBERS ) \ - EOSLIB_REFLECT_DERIVED( TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) - -/** - * Perform class template reflection - * - * @brief Perform class template reflection - * @param TEMPLATE_ARGS - a sequence of template args. (args1)(args2)(args3) - * @param TYPE - the class template to be reflected - * @param MEMBERS - a sequence of member names. (field1)(field2)(field3) - */ -#define EOSLIB_REFLECT_TEMPLATE( TEMPLATE_ARGS, TYPE, MEMBERS ) \ - EOSLIB_REFLECT_DERIVED_TEMPLATE( TEMPLATE_ARGS, TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) - -/** - * Perform class reflection on empty class - * - * @brief Perform class reflection on empty class - * @param TYPE - the class to be reflected - */ -#define EOSLIB_REFLECT_EMPTY( TYPE ) \ - EOSLIB_REFLECT_DERIVED( TYPE, BOOST_PP_SEQ_NIL, BOOST_PP_SEQ_NIL ) - -/** - * Perform forward declaration of class reflection - * - * @brief Perform forward declaration of class reflection - * @param TYPE - the class to be reflected - */ -#define EOSLIB_REFLECT_FWD( TYPE ) \ -namespace eosio { \ - template<> struct reflector {\ - typedef TYPE type; \ - typedef eosio::true_type is_reflected; \ - enum member_count_enum { \ - local_member_count = BOOST_PP_SEQ_SIZE(MEMBERS), \ - total_member_count = local_member_count BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_BASE_MEMBER_COUNT, +, INHERITS )\ - }; \ - template static void visit( Visitor&& v ); \ - template static void visit( const type& t, Visitor&& v ); \ - template static void visit( type& t, Visitor&& v ); \ - }; } - -///@} - -#define EOSLIB_REFLECT_DERIVED_IMPL( TYPE, MEMBERS ) \ - EOSLIB_REFLECT_IMPL_DERIVED_EXT( TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) - -#define EOSLIB_REFLECT_IMPL( TYPE, MEMBERS ) \ - EOSLIB_REFLECT_DERIVED_IMPL_EXT( TYPE, BOOST_PP_SEQ_NIL, MEMBERS ) - - -/** - * @addtogroup serializecpp - * @{ - */ - -/** - * Perform class reflection where TYPE inherits other reflected classes - * - * @brief Specializes eosio::reflector for TYPE where - * type inherits other reflected classes - * - * @param TYPE - the class to be reflected - * @param INHERITS - a sequence of base class names (basea)(baseb)(basec) - * @param MEMBERS - a sequence of member names. (field1)(field2)(field3) - */ -#define EOSLIB_REFLECT_DERIVED( TYPE, INHERITS, MEMBERS ) \ -namespace eosio { \ -template<> struct reflector {\ - typedef TYPE type; \ - typedef eosio::true_type is_reflected; \ - typedef eosio::false_type is_enum; \ - enum member_count_enum { \ - local_member_count = 0 BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_MEMBER_COUNT, +, MEMBERS ),\ - total_member_count = local_member_count BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_BASE_MEMBER_COUNT, +, INHERITS )\ - }; \ - EOSLIB_REFLECT_DERIVED_IMPL_INLINE( TYPE, INHERITS, MEMBERS ) \ -}; } - -/** - * Perform class template reflection where TYPE inherits other reflected classes - * - * @brief Perform class template reflection where TYPE inherits other reflected classes - * - * @param TEMPLATE_ARGS - a sequence of template args. (args1)(args2)(args3) - * @param TYPE - the class to be reflected - * @param INHERITS - a sequence of base class names (basea)(baseb)(basec) - * @param MEMBERS - a sequence of member names. (field1)(field2)(field3) - */ -#define EOSLIB_REFLECT_DERIVED_TEMPLATE( TEMPLATE_ARGS, TYPE, INHERITS, MEMBERS ) \ -namespace eosio { \ -template struct reflector {\ - typedef TYPE type; \ - typedef eosio::true_type is_defined; \ - typedef eosio::false_type is_enum; \ - enum member_count_enum { \ - local_member_count = 0 BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_MEMBER_COUNT, +, MEMBERS ),\ - total_member_count = local_member_count BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_BASE_MEMBER_COUNT, +, INHERITS )\ - }; \ - EOSLIB_REFLECT_DERIVED_IMPL_INLINE( TYPE, INHERITS, MEMBERS ) \ -}; } - - -///@} diff --git a/libraries/eosiolib/serialize.hpp b/libraries/eosiolib/serialize.hpp index eff10d3cc6..895ec9317d 100644 --- a/libraries/eosiolib/serialize.hpp +++ b/libraries/eosiolib/serialize.hpp @@ -5,18 +5,12 @@ #include #define EOSLIB_REFLECT_MEMBER_OP( r, OP, elem ) \ - OP t.elem + OP t.elem /** - * @defgroup serialize Serialize API - * @brief Defines functions to serialize and deserialize object - * @ingroup contractdev - */ - -/** - * @defgroup serializecpp Serialize C++ API + * @addtogroup serialize Serialize C++ API * @brief Defines C++ API to serialize and deserialize object - * @ingroup serialize + * @ingroup cpp_api * @{ */ @@ -36,7 +30,7 @@ template \ friend DataStream& operator >> ( DataStream& ds, TYPE& t ){ \ return ds BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_MEMBER_OP, >>, MEMBERS );\ - } + } /** * Defines serialization and deserialization for a class which inherits from other classes that @@ -44,7 +38,7 @@ * * @brief Defines serialization and deserialization for a class which inherits from other classes that * have their serialization and deserialization defined - * + * * @param TYPE - the class to have its serialization and deserialization defined * @param BASE - a sequence of base class names (basea)(baseb)(basec) * @param MEMBERS - a sequence of member names. (field1)(field2)(field3) @@ -59,5 +53,5 @@ friend DataStream& operator >> ( DataStream& ds, TYPE& t ){ \ ds >> static_cast(t); \ return ds BOOST_PP_SEQ_FOR_EACH( EOSLIB_REFLECT_MEMBER_OP, >>, MEMBERS );\ - } + } ///@} serializecpp diff --git a/libraries/eosiolib/singleton.hpp b/libraries/eosiolib/singleton.hpp index 5c15a06685..0f8be65b09 100644 --- a/libraries/eosiolib/singleton.hpp +++ b/libraries/eosiolib/singleton.hpp @@ -1,13 +1,13 @@ #pragma once -#include -#include +#include "multi_index.hpp" +#include "system.hpp" namespace eosio { /** * @defgroup singleton Singleton Table - * @brief Defines EOSIO Singleton Table - * @ingroup databasecpp + * @ingroup cpp_api + * @brief Defines EOSIO Singleton Table used with %multiindex * @{ */ @@ -22,28 +22,21 @@ namespace eosio { { /** * Primary key of the data inside singleton table - * - * @brief Primary key of the data singleton table */ constexpr static uint64_t pk_value = static_cast(SingletonName); /** * Structure of data inside the singleton table - * - * @brief Structure of data inside the singleton table */ struct row { /** * Value to be stored inside the singleton table - * - * @brief Value to be stored inside the singleton table */ T value; /** * Get primary key of the data * - * @brief Get primary key of the data * @return uint64_t - Primary Key */ uint64_t primary_key() const { return pk_value; } @@ -58,7 +51,6 @@ namespace eosio { /** * Construct a new singleton object given the table's owner and the scope * - * @brief Construct a new singleton object * @param code - The table's owner * @param scope - The scope of the table */ @@ -67,7 +59,6 @@ namespace eosio { /** * Check if the singleton table exists * - * @brief Check if the singleton table exists * @return true - if exists * @return false - otherwise */ @@ -83,14 +74,13 @@ namespace eosio { */ T get() { auto itr = _t.find( pk_value ); - eosio_assert( itr != _t.end(), "singleton does not exist" ); + eosio::check( itr != _t.end(), "singleton does not exist" ); return itr->value; } /** * Get the value stored inside the singleton table. If it doesn't exist, it will return the specified default value * - * @brief Get the value stored inside the singleton table or return the specified default value if it doesn't exist * @param def - The default value to be returned in case the data doesn't exist * @return T - The value stored */ @@ -102,7 +92,6 @@ namespace eosio { /** * Get the value stored inside the singleton table. If it doesn't exist, it will create a new one with the specified default value * - * @brief Get the value stored inside the singleton table or create a new one with the specified default value if it doesn't exist * @param bill_to_account - The account to bill for the newly created data if the data doesn't exist * @param def - The default value to be created in case the data doesn't exist * @return T - The value stored @@ -116,8 +105,6 @@ namespace eosio { /** * Set new value to the singleton table * - * @brief Set new value to the singleton table - * * @param value - New value to be set * @param bill_to_account - Account to pay for the new value */ @@ -132,8 +119,6 @@ namespace eosio { /** * Remove the only data inside singleton table - * - * @brief Remove the only data inside singleton table */ void remove( ) { auto itr = _t.find( pk_value ); diff --git a/libraries/eosiolib/symbol.hpp b/libraries/eosiolib/symbol.hpp index da5cb747ac..4711014920 100644 --- a/libraries/eosiolib/symbol.hpp +++ b/libraries/eosiolib/symbol.hpp @@ -1,13 +1,14 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include -#include +#include "system.hpp" +#include "print.h" +#include "name.hpp" +#include "serialize.hpp" + #include #include #include @@ -15,39 +16,54 @@ namespace eosio { /** - * @defgroup symbolapi Symbol API - * @brief Defines API for managing symbols - * @ingroup contractdev - */ - - /** - * @defgroup symbolcppapi Symbol CPP API + * @addtogroup symbol Symbol CPP API + * @ingroup cpp_api * @brief Defines %CPP API for managing symbols - * @ingroup symbolapi * @{ */ /** - * \struct Stores the symbol code - * @brief Stores the symbol code + * @class Stores the symbol code + * @brief Stores the symbol code as a uint64_t value */ class symbol_code { public: + + /** + * Default constructor, construct a new symbol_code + * + * @brief Construct a new symbol_code object defaulting to a value of 0 + * + */ constexpr symbol_code() : value(0) {} + /** + * Construct a new symbol_code given a scoped enumerated type of raw (uint64_t). + * + * @brief Construct a new symbol_code object initialising value with raw + * @param raw - The raw value which is a scoped enumerated type of unit64_t + * + */ constexpr explicit symbol_code( uint64_t raw ) :value(raw) {} + /** + * Construct a new symbol_code given an string. + * + * @brief Construct a new symbol_code object initialising value with str + * @param str - The string value which validated then converted to unit64_t + * + */ constexpr explicit symbol_code( std::string_view str ) :value(0) { if( str.size() > 7 ) { - eosio_assert( false, "string is too long to be a valid symbol_code" ); + eosio::check( false, "string is too long to be a valid symbol_code" ); } for( auto itr = str.rbegin(); itr != str.rend(); ++itr ) { if( *itr < 'A' || *itr > 'Z') { - eosio_assert( false, "only uppercase letters allowed in symbol_code string" ); + eosio::check( false, "only uppercase letters allowed in symbol_code string" ); } value <<= 8; value |= *itr; @@ -90,8 +106,18 @@ namespace eosio { return len; } + /** + * Casts a symbol code to raw + * + * @return Returns an instance of raw based on the value of a symbol_code + */ constexpr uint64_t raw()const { return value; } + /** + * Explicit cast to bool of the symbol_code + * + * @return Returns true if the symbol_code is set to the default value of 0 else true. + */ constexpr explicit operator bool()const { return value != 0; } /** @@ -122,6 +148,11 @@ namespace eosio { return begin; } + /** + * Returns the symbol_code as a string. + * + * @brief Returns the name value as a string by calling write_as_string() and returning the buffer produced by write_as_string() + */ std::string to_string()const { char buffer[7]; auto end = write_as_string( buffer, buffer + sizeof(buffer) ); @@ -162,20 +193,49 @@ namespace eosio { }; /** - * \struct Stores information about a symbol + * @struct Stores information about a symbol, the symbol can be 7 characters long. * * @brief Stores information about a symbol */ class symbol { public: + /** + * Default constructor, construct a new symbol + * + * @brief Construct a new symbol object defaulting to a value of 0 + * + */ constexpr symbol() : value(0) {} + /** + * Construct a new symbol given a scoped enumerated type of raw (uint64_t). + * + * @brief Construct a new symbol object initialising value with raw + * @param raw - The raw value which is a scoped enumerated type of unit64_t + * + */ constexpr explicit symbol( uint64_t raw ) : value(raw) {} + /** + * Construct a new symbol given a symbol_code and a uint8_t precision. + * + * @brief Construct a new symbol object initialising value with a symbol maximum of 7 characters, packs the symbol and precision into the uint64_t value. + * @param sc - The symbol_code + * @param precision - The number of decimal places used for the symbol + * + */ constexpr symbol( symbol_code sc, uint8_t precision ) : value( (sc.raw() << 8) | static_cast(precision) ) {} + /** + * Construct a new symbol given a string and a uint8_t precision. + * + * @brief Construct a new symbol object initialising value with a symbol maximum of 7 characters, packs the symbol and precision into the uint64_t value. + * @param ss - The string containing the symbol + * @param precision - The number of decimal places used for the symbol + * + */ constexpr symbol( std::string_view ss, uint8_t precision ) : value( (symbol_code(ss).raw() << 8) | static_cast(precision) ) {} @@ -252,19 +312,44 @@ namespace eosio { }; /** - * \struct Extended asset which stores the information of the owner of the symbol + * @struct Extended asset which stores the information of the owner of the symbol * */ class extended_symbol { public: + + /** + * Default constructor, construct a new extended_symbol + * + * @brief Construct a new empty extended_symbol object + * + */ constexpr extended_symbol() {} + /** + * Construct a new symbol_code given a symbol and a name. + * + * @brief Construct a new symbol_code object initialising symbol and contract with the passed in symbol and name + * @param sym - The symbol + * @param con - The name of the contract + * + */ constexpr extended_symbol( symbol sym, name con ) : symbol(sym), contract(con) {} + /** + * Returns the symbol in the extended_contract + * + * @return symbol + */ constexpr symbol get_symbol() const { return symbol; } - constexpr name get_contract() const { return contract; } + /** + * Returns the name of the contract in the extended_symbol + * + * @return name + */ + constexpr name get_contract() const { return contract; } /** * %Print the extended symbol @@ -313,6 +398,5 @@ namespace eosio { EOSLIB_SERIALIZE( extended_symbol, (symbol)(contract) ) }; - // }@ symbolapi - -} /// namespace eosio + /// @} +} diff --git a/libraries/eosiolib/system.h b/libraries/eosiolib/system.h index b7b39dfa5a..8cfc69b59a 100644 --- a/libraries/eosiolib/system.h +++ b/libraries/eosiolib/system.h @@ -1,34 +1,28 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +#include "types.h" +#ifdef __cplusplus extern "C" { +#endif /** - * @defgroup systemapi System API - * @ingroup contractdev + * @addtogroup system + * @ingroup c_api * @brief Defines API for interacting with system level intrinsics - * - */ - - /** - * @defgroup systemcapi System C API - * @ingroup systemapi - * @brief Defines API for interacting with system level intrinsics - * * @{ */ /** * Aborts processing of this action and unwinds all pending changes if the test condition is true - * @brief Aborts processing of this action and unwinds all pending changes + * * @param test - 0 to abort, 1 to ignore * * Example: -* + * * @code * eosio_assert(1 == 2, "One is not equal to two."); * eosio_assert(1 == 1, "One is not equal to one."); @@ -40,7 +34,7 @@ extern "C" { /** * Aborts processing of this action and unwinds all pending changes if the test condition is true - * @brief Aborts processing of this action and unwinds all pending changes + * * @param test - 0 to abort, 1 to ignore * @param msg - a pointer to the start of string explaining the reason for failure * @param msg_len - length of the string @@ -49,6 +43,7 @@ extern "C" { /** * Aborts processing of this action and unwinds all pending changes if the test condition is true + * * @brief Aborts processing of this action and unwinds all pending changes * @param test - 0 to abort, 1 to ignore * @param code - the error code @@ -57,10 +52,10 @@ extern "C" { /** * This method will abort execution of wasm without failing the contract. This is used to bypass all cleanup / destructors that would normally be called. - * @brief Aborts execution of wasm without failing the contract + * * @param code - the exit code * Example: -* + * * @code * eosio_exit(0); * eosio_exit(1); @@ -68,25 +63,30 @@ extern "C" { * eosio_exit(3); * @endcode */ - [[noreturn]] void eosio_exit( int32_t code ); +#ifdef __cplusplus + [[noreturn]] +#endif + void eosio_exit( int32_t code ); /** * Returns the time in microseconds from 1970 of the current block - * @brief Get time of the current block (i.e. the block including this action) + * * @return time in microseconds from 1970 of the current block */ uint64_t current_time(); /** - * Returns the time in seconds from 1970 of the block including this action - * @brief Get time (rounded down to the nearest second) of the current block (i.e. the block including this action) + * Get time (rounded down to the nearest second) of the current block (i.e. the block including this action) + * * @return time in seconds from 1970 of the current block */ inline uint32_t now() { return (uint32_t)( current_time() / 1000000 ); } - ///@ } systemcapi - +#ifdef __cplusplus } +#endif + ///@} + diff --git a/libraries/eosiolib/system.hpp b/libraries/eosiolib/system.hpp new file mode 100644 index 0000000000..2af2a312e9 --- /dev/null +++ b/libraries/eosiolib/system.hpp @@ -0,0 +1,117 @@ +/** + * @file + * @copyright defined in eos/LICENSE + */ +#pragma once +#include "system.h" +#include + +namespace eosio { + + /** + * @addtogroup system System C++ API + * @ingroup cpp_api + * @brief Defines wrappers over eosio_assert + * + * @{ + */ + + /** + * + * @brief Assert if the predicate fails and use the supplied message. + * + * Example: + * + * @code + * eosio::check(a == b, "a does not equal b"); + * @endcode + */ + inline void check(bool pred, const char* msg) { + if (!pred) { + eosio_assert(false, msg); + } + } + + /** + * + * @brief Assert if the predicate fails and use the supplied message. + * + * Example: + * + * @code + * eosio::check(a == b, "a does not equal b"); + * @endcode + */ + inline void check(bool pred, const std::string& msg) { + if (!pred) { + eosio_assert(false, msg.c_str()); + } + } + + /** + * + * @brief Assert if the predicate fails and use the supplied message. + * + * Example: + * + * @code + * eosio::check(a == b, "a does not equal b"); + * @endcode + */ + inline void check(bool pred, std::string&& msg) { + if (!pred) { + eosio_assert(false, msg.c_str()); + } + } + + /** + * + * @brief Assert if the predicate fails and use a subset of the supplied message. + * + * Example: + * + * @code + * const char* msg = "a does not equal b b does not equal a"; + * eosio::check(a == b, "a does not equal b", 18); + * @endcode + */ + inline void check(bool pred, const char* msg, size_t n) { + if (!pred) { + eosio_assert_message(false, msg, n); + } + } + + /** + * + * @brief Assert if the predicate fails and use a subset of the supplied message. + * + * Example: + * + * @code + * std::string msg = "a does not equal b b does not equal a"; + * eosio::check(a == b, msg, 18); + * @endcode + */ + inline void check(bool pred, const std::string& msg, size_t n) { + if (!pred) { + eosio_assert_message(false, msg.c_str(), n); + } + } + + /** + * + * @brief Assert if the predicate fails and use the supplied error code. + * + * Example: + * + * @code + * eosio::check(a == b, 13); + * @endcode + */ + inline void check(bool pred, uint64_t code) { + if (!pred) { + eosio_assert_code(false, code); + } + } +} // namespace eosio + /// @} diff --git a/libraries/eosiolib/time.hpp b/libraries/eosiolib/time.hpp index 25f7a323ff..0206a33836 100644 --- a/libraries/eosiolib/time.hpp +++ b/libraries/eosiolib/time.hpp @@ -1,9 +1,15 @@ #pragma once +#include "eosio.hpp" + #include #include -#include namespace eosio { + /** + * @addtogroup time + * @ingroup cpp_api + * @{ + */ class microseconds { public: explicit microseconds( int64_t c = 0) :_count(c){} @@ -127,7 +133,7 @@ namespace eosio { static block_timestamp min() { return block_timestamp(0); } block_timestamp next() const { - eosio_assert( std::numeric_limits::max() - slot >= 1, "block timestamp overflow" ); + eosio::check( std::numeric_limits::max() - slot >= 1, "block timestamp overflow" ); auto result = block_timestamp(*this); result.slot += 1; return result; @@ -159,7 +165,7 @@ namespace eosio { EOSLIB_SERIALIZE( block_timestamp, (slot) ) private: - + void set_time_point(const time_point& t) { int64_t micro_since_epoch = t.time_since_epoch().count(); @@ -172,6 +178,11 @@ namespace eosio { slot = uint32_t((sec_since_epoch * 1000 - block_timestamp_epoch) / block_interval_ms); } }; // block_timestamp - typedef block_timestamp block_timestamp_type; + + + typedef block_timestamp block_timestamp_type; + + /// @} + } // namespace eosio diff --git a/libraries/eosiolib/transaction.h b/libraries/eosiolib/transaction.h index 6903006cff..9bf8a19798 100644 --- a/libraries/eosiolib/transaction.h +++ b/libraries/eosiolib/transaction.h @@ -1,21 +1,20 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include +#include "types.h" #include using namespace eosio; extern "C" { /** - * @defgroup transactionapi Transaction API - * @ingroup contractdev - * @brief Defines API for sending transactions and inline actions + * @addtogroup transaction_c Transaction API + * @ingroup c_api + * @brief Defines C API for sending transactions and inline actions * - * - * Deferred transactions will not be processed until a future block. They + * @details Deferred transactions will not be processed until a future block. They * can therefore have no effect on the success of failure of their parent * transaction so long as they appear well formed. If any other condition * causes the parent transaction to be marked as failing, then the deferred @@ -36,20 +35,12 @@ extern "C" { * Inline actions and Deferred transactions must adhere to the permissions * available to the parent transaction or, in the future, delegated to the * contract account for future use. - */ - - /** - * @defgroup transactioncapi Transaction C API - * @ingroup transactionapi - * @brief Defines API for sending transactions - * * @{ */ /** * Sends a deferred transaction. * - * @brief Sends a deferred transaction. * @param sender_id - ID of sender * @param payer - Account paying for RAM * @param serialized_transaction - Pointer of serialized transaction to be deferred @@ -193,5 +184,5 @@ extern "C" { */ int get_context_free_data( uint32_t index, char* buff, size_t size ); - ///@ } transactioncapi + ///}@ } diff --git a/libraries/eosiolib/transaction.hpp b/libraries/eosiolib/transaction.hpp index a7a6d93d7f..a317c2036c 100644 --- a/libraries/eosiolib/transaction.hpp +++ b/libraries/eosiolib/transaction.hpp @@ -1,18 +1,42 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once -#include -#include -#include -#include +#include "transaction.h" +#include "action.hpp" +#include "time.hpp" +#include "serialize.hpp" +#include "system.hpp" + #include namespace eosio { + + /** + * @defgroup transaction Transaction C++ API + * @ingroup cpp_api + * @brief Type-safe C++ wrappers for transaction C API + * + * @details An inline message allows one contract to send another contract a message + * which is processed immediately after the current message's processing + * ends such that the success or failure of the parent transaction is + * dependent on the success of the message. If an inline message fails in + * processing then the whole tree of transactions and actions rooted in the + * block will me marked as failing and none of effects on the database will + * persist. + * + * Inline actions and Deferred transactions must adhere to the permissions + * available to the parent transaction or, in the future, delegated to the + * contract account for future use. + + * @note There are some methods from the @ref transactioncapi that can be used directly from C++ + * @{ + */ typedef std::tuple> extension; typedef std::vector extensions_type; + /** * @defgroup transactioncppapi Transaction C++ API * @ingroup transactionapi @@ -23,8 +47,19 @@ namespace eosio { * @{ */ + /** + * Class transaction_header contains details about the transaction + * @brief Contains details about the transaction + */ + class transaction_header { public: + + /** + * Construct a new transaction_header with an expiration of now + 60 seconds. + * + * @brief Construct a new transaction_header object initialising the transaction header expiration to now + 60 seconds + */ transaction_header( time_point_sec exp = time_point_sec(now() + 60) ) :expiration(exp) {} @@ -39,10 +74,28 @@ namespace eosio { EOSLIB_SERIALIZE( transaction_header, (expiration)(ref_block_num)(ref_block_prefix)(max_net_usage_words)(max_cpu_usage_ms)(delay_sec) ) }; + /** + * Class transaction contains the actions, context_free_actions and extensions type for a transaction + * @brief Contains the actions, context_free_actions and extensions type for a transaction + */ class transaction : public transaction_header { public: + + /** + * Construct a new transaction with an expiration of now + 60 seconds. + * + * @brief Construct a new transaction object initialising the transaction header expiration to now + 60 seconds + */ transaction(time_point_sec exp = time_point_sec(now() + 60)) : transaction_header( exp ) {} + /** + * Sends this transaction, packs the transaction then sends it as a deferred transaction + * + * @brief Writes the symbol_code as a string to the provided char buffer + * @param sender_id - ID of sender + * @param payer - Account paying for RAM + * @param replace_existing - Defaults to false, if this is `0`/false then if the provided sender_id is already in use by an in-flight transaction from this contract, which will be a failing assert. If `1` then transaction will atomically cancel/replace the inflight transaction + */ void send(const uint128_t& sender_id, name payer, bool replace_existing = false) const { auto serialize = pack(*this); send_deferred(sender_id, payer.value, serialize.data(), serialize.size(), replace_existing); @@ -56,19 +109,25 @@ namespace eosio { }; /** - * - * - * - * + * Struct onerror contains and sender id and packed transaction + * @brief Contains and sender id and packed transaction */ struct onerror { uint128_t sender_id; std::vector sent_trx; + /** + * from_current_action unpacks and returns a onerror struct + * @brief Unpacks and returns a onerror struct + */ static onerror from_current_action() { return unpack_action_data(); } + /** + * unpack_sent_trx unpacks and returns a transaction + * @brief Unpacks and returns a transaction + */ transaction unpack_sent_trx() const { return unpack(sent_trx); } @@ -78,6 +137,7 @@ namespace eosio { /** * Retrieve the indicated action from the active transaction. + * * @param type - 0 for context free action, 1 for action * @param index - the index of the requested action * @return the indicated action @@ -85,14 +145,13 @@ namespace eosio { inline action get_action( uint32_t type, uint32_t index ) { constexpr size_t max_stack_buffer_size = 512; int s = ::get_action( type, index, nullptr, 0 ); - eosio_assert( s > 0, "get_action size failed" ); + eosio::check( s > 0, "get_action size failed" ); size_t size = static_cast(s); char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) ); auto size2 = ::get_action( type, index, buffer, size ); - eosio_assert( size == static_cast(size2), "get_action failed" ); + eosio::check( size == static_cast(size2), "get_action failed" ); return eosio::unpack( buffer, size ); } - ///@} transactioncpp api - -} // namespace eos + ///}@ +} diff --git a/libraries/eosiolib/types.h b/libraries/eosiolib/types.h index ede5b94ab1..e3c57721e4 100644 --- a/libraries/eosiolib/types.h +++ b/libraries/eosiolib/types.h @@ -1,6 +1,6 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once @@ -12,16 +12,19 @@ extern "C" { #endif /** - * @defgroup types Builtin Types - * @ingroup contractdev + * @defgroup c_types + * @ingroup c_api + * @brief Specifies builtin types, typedefs and aliases + */ + +/** + * @addtogroup c_types * @brief Specifies builtin types, typedefs and aliases - * * @{ */ /** - * @brief Macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned - * @details Macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned + * Macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned */ /* macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned */ @@ -30,46 +33,42 @@ extern "C" { typedef uint64_t capi_name; /** - * @brief EOSIO Public Key - * @details EOSIO Public Key. It is 34 bytes. + * EOSIO Public Key. It is 34 bytes. */ struct capi_public_key { char data[34]; }; /** - * @brief EOSIO Signature - * @details EOSIO Signature. It is 66 bytes. + * EOSIO Signature. It is 66 bytes. */ struct capi_signature { uint8_t data[66]; }; /** - * @brief 256-bit hash - * @details 256-bit hash + * 256-bit hash */ struct ALIGNED(capi_checksum256) { uint8_t hash[32]; }; /** - * @brief 160-bit hash - * @details 160-bit hash + * 160-bit hash */ struct ALIGNED(capi_checksum160) { uint8_t hash[20]; }; /** - * @brief 512-bit hash - * @details 512-bit hash + * 512-bit hash */ struct ALIGNED(capi_checksum512) { uint8_t hash[64]; }; +/// @} + #ifdef __cplusplus } /// extern "C" #endif -/// @} diff --git a/libraries/eosiolib/varint.hpp b/libraries/eosiolib/varint.hpp index b8240839aa..a89cb5dde4 100644 --- a/libraries/eosiolib/varint.hpp +++ b/libraries/eosiolib/varint.hpp @@ -1,6 +1,6 @@ /** * @file - * @copyright defined in eos/LICENSE.txt + * @copyright defined in eos/LICENSE */ #pragma once @@ -11,7 +11,6 @@ * @ingroup types * @{/ */ - /** * Variable Length Unsigned Integer. This provides more efficient serialization of 32-bit unsigned int. * It serialuzes a 32-bit unsigned integer in as few bytes as possible @@ -23,7 +22,6 @@ struct unsigned_int { /** * Construct a new unsigned int object * - * @brief Construct a new unsigned int object * @param v - Source */ unsigned_int( uint32_t v = 0 ):value(v){} @@ -31,7 +29,6 @@ struct unsigned_int { /** * Construct a new unsigned int object from a type that is convertible to uint32_t * - * @brief Construct a new unsigned int object * @tparam T - Type of the source * @param v - Source * @pre T must be convertible to uint32_t @@ -44,7 +41,7 @@ struct unsigned_int { /** * Convert unsigned_int as T - * @brief Conversion Operator + * * @tparam T - Target type of conversion * @return T - Converted target */ @@ -54,7 +51,6 @@ struct unsigned_int { /** * Assign 32-bit unsigned integer * - * @brief Assignment operator * @param v - Soruce * @return unsigned_int& - Reference to this object */ @@ -62,15 +58,12 @@ struct unsigned_int { /** * Contained value - * - * @brief Contained value */ uint32_t value; /** * Check equality between a unsigned_int object and 32-bit unsigned integer * - * @brief Equality Operator * @param i - unsigned_int object to compare * @param v - 32-bit unsigned integer to compare * @return true - if equal @@ -81,7 +74,6 @@ struct unsigned_int { /** * Check equality between 32-bit unsigned integer and a unsigned_int object * - * @brief Equality Operator * @param i - 32-bit unsigned integer to compare * @param v - unsigned_int object to compare * @return true - if equal @@ -92,7 +84,6 @@ struct unsigned_int { /** * Check equality between two unsigned_int objects * - * @brief Equality Operator * @param i - First unsigned_int object to compare * @param v - Second unsigned_int object to compare * @return true - if equal @@ -103,7 +94,6 @@ struct unsigned_int { /** * Check inequality between a unsigned_int object and 32-bit unsigned integer * - * @brief Inequality Operator * @param i - unsigned_int object to compare * @param v - 32-bit unsigned integer to compare * @return true - if inequal @@ -114,7 +104,6 @@ struct unsigned_int { /** * Check inequality between 32-bit unsigned integer and a unsigned_int object * - * @brief Equality Operator * @param i - 32-bit unsigned integer to compare * @param v - unsigned_int object to compare * @return true - if unequal @@ -125,7 +114,6 @@ struct unsigned_int { /** * Check inequality between two unsigned_int objects * - * @brief Inequality Operator * @param i - First unsigned_int object to compare * @param v - Second unsigned_int object to compare * @return true - if inequal @@ -136,7 +124,6 @@ struct unsigned_int { /** * Check if the given unsigned_int object is less than the given 32-bit unsigned integer * - * @brief Less than Operator * @param i - unsigned_int object to compare * @param v - 32-bit unsigned integer to compare * @return true - if i less than v @@ -147,7 +134,6 @@ struct unsigned_int { /** * Check if the given 32-bit unsigned integer is less than the given unsigned_int object * - * @brief Less than Operator * @param i - 32-bit unsigned integer to compare * @param v - unsigned_int object to compare * @return true - if i less than v @@ -158,7 +144,6 @@ struct unsigned_int { /** * Check if the first given unsigned_int is less than the second given unsigned_int object * - * @brief Less than Operator * @param i - First unsigned_int object to compare * @param v - Second unsigned_int object to compare * @return true - if i less than v @@ -169,7 +154,6 @@ struct unsigned_int { /** * Check if the given unsigned_int object is greater or equal to the given 32-bit unsigned integer * - * @brief Greater or Equal to Operator * @param i - unsigned_int object to compare * @param v - 32-bit unsigned integer to compare * @return true - if i is greater or equal to v @@ -180,7 +164,6 @@ struct unsigned_int { /** * Check if the given 32-bit unsigned integer is greater or equal to the given unsigned_int object * - * @brief Greater or Equal to Operator * @param i - 32-bit unsigned integer to compare * @param v - unsigned_int object to compare * @return true - if i is greater or equal to v @@ -191,7 +174,6 @@ struct unsigned_int { /** * Check if the first given unsigned_int is greater or equal to the second given unsigned_int object * - * @brief Greater or Equal to Operator * @param i - First unsigned_int object to compare * @param v - Second unsigned_int object to compare * @return true - if i is greater or equal to v @@ -202,7 +184,6 @@ struct unsigned_int { /** * Serialize an unsigned_int object with as few bytes as possible * - * @brief Serialize an unsigned_int object with as few bytes as possible * @param ds - The stream to write * @param v - The value to serialize * @tparam DataStream - Type of datastream @@ -223,7 +204,6 @@ struct unsigned_int { /** * Deserialize an unsigned_int object * - * @brief Deserialize an unsigned_int object * @param ds - The stream to read * @param vi - The destination for deserialized value * @tparam DataStream - Type of datastream @@ -245,22 +225,19 @@ struct unsigned_int { /** * Variable Length Signed Integer. This provides more efficient serialization of 32-bit signed int. * It serializes a 32-bit signed integer in as few bytes as possible. - * `varint32' is signed and uses [Zig-Zag encoding](https://developers.google.com/protocol-buffers/docs/encoding#signed-integers) * - * @brief Variable Length Signed Integer + * @note `varint32' is signed and uses [Zig-Zag encoding](https://developers.google.com/protocol-buffers/docs/encoding#signed-integers) */ struct signed_int { /** * Construct a new signed int object * - * @brief Construct a new signed int object * @param v - Source */ signed_int( int32_t v = 0 ):value(v){} /** * Convert signed_int to primitive 32-bit signed integer - * @brief Conversion operator * * @return int32_t - The converted result */ @@ -270,7 +247,6 @@ struct signed_int { /** * Assign an object that is convertible to int32_t * - * @brief Assignment operator * @tparam T - Type of the assignment object * @param v - Source * @return unsigned_int& - Reference to this object @@ -281,7 +257,6 @@ struct signed_int { /** * Increment operator * - * @brief Increment operator * @return signed_int - New signed_int with value incremented from the current object's value */ signed_int operator++(int) { return value++; } @@ -289,22 +264,18 @@ struct signed_int { /** * Increment operator * - * @brief Increment operator * @return signed_int - Reference to current object */ signed_int& operator++(){ ++value; return *this; } /** * Contained value - * - * @brief Contained value */ int32_t value; /** * Check equality between a signed_int object and 32-bit integer * - * @brief Equality Operator * @param i - signed_int object to compare * @param v - 32-bit integer to compare * @return true - if equal @@ -315,7 +286,6 @@ struct signed_int { /** * Check equality between 32-bit integer and a signed_int object * - * @brief Equality Operator * @param i - 32-bit integer to compare * @param v - signed_int object to compare * @return true - if equal @@ -326,7 +296,6 @@ struct signed_int { /** * Check equality between two signed_int objects * - * @brief Equality Operator * @param i - First signed_int object to compare * @param v - Second signed_int object to compare * @return true - if equal @@ -338,7 +307,6 @@ struct signed_int { /** * Check inequality between a signed_int object and 32-bit integer * - * @brief Inequality Operator * @param i - signed_int object to compare * @param v - 32-bit integer to compare * @return true - if inequal @@ -349,7 +317,6 @@ struct signed_int { /** * Check inequality between 32-bit integer and a signed_int object * - * @brief Equality Operator * @param i - 32-bit integer to compare * @param v - signed_int object to compare * @return true - if unequal @@ -360,7 +327,6 @@ struct signed_int { /** * Check inequality between two signed_int objects * - * @brief Inequality Operator * @param i - First signed_int object to compare * @param v - Second signed_int object to compare * @return true - if inequal @@ -371,7 +337,6 @@ struct signed_int { /** * Check if the given signed_int object is less than the given 32-bit integer * - * @brief Less than Operator * @param i - signed_int object to compare * @param v - 32-bit integer to compare * @return true - if i less than v @@ -382,7 +347,6 @@ struct signed_int { /** * Check if the given 32-bit integer is less than the given signed_int object * - * @brief Less than Operator * @param i - 32-bit integer to compare * @param v - signed_int object to compare * @return true - if i less than v @@ -393,7 +357,6 @@ struct signed_int { /** * Check if the first given signed_int is less than the second given signed_int object * - * @brief Less than Operator * @param i - First signed_int object to compare * @param v - Second signed_int object to compare * @return true - if i less than v @@ -405,7 +368,6 @@ struct signed_int { /** * Check if the given signed_int object is greater or equal to the given 32-bit integer * - * @brief Greater or Equal to Operator * @param i - signed_int object to compare * @param v - 32-bit integer to compare * @return true - if i is greater or equal to v @@ -416,7 +378,6 @@ struct signed_int { /** * Check if the given 32-bit integer is greater or equal to the given signed_int object * - * @brief Greater or Equal to Operator * @param i - 32-bit integer to compare * @param v - signed_int object to compare * @return true - if i is greater or equal to v @@ -427,7 +388,6 @@ struct signed_int { /** * Check if the first given signed_int is greater or equal to the second given signed_int object * - * @brief Greater or Equal to Operator * @param i - First signed_int object to compare * @param v - Second signed_int object to compare * @return true - if i is greater or equal to v @@ -439,7 +399,6 @@ struct signed_int { /** * Serialize an signed_int object with as few bytes as possible * - * @brief Serialize an signed_int object with as few bytes as possible * @param ds - The stream to write * @param v - The value to serialize * @tparam DataStream - Type of datastream @@ -460,7 +419,6 @@ struct signed_int { /** * Deserialize an signed_int object * - * @brief Deserialize an signed_int object * @param ds - The stream to read * @param vi - The destination for deserialized value * @tparam DataStream - Type of datastream diff --git a/libraries/libc++/CMakeLists.txt b/libraries/libc++/CMakeLists.txt index 2f255ee6a9..0391df2c24 100644 --- a/libraries/libc++/CMakeLists.txt +++ b/libraries/libc++/CMakeLists.txt @@ -13,19 +13,30 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-everything") add_library(c++ ${SRC_FILES}) +add_native_library(native_c++ + ${SRC_FILES}) + target_include_directories(c++ PUBLIC - $ - $) + ${CMAKE_SOURCE_DIR}/libc/musl/include + ${CMAKE_SOURCE_DIR}/libc/musl/src/internal + ${CMAKE_SOURCE_DIR}/libc/musl/src/crypt + ${CMAKE_SOURCE_DIR}/libc/musl/arch/eos + ${CMAKE_CURRENT_SOURCE_DIR}/libcxx/include) -target_link_libraries(c++ c) +target_include_directories(native_c++ + PUBLIC + ${CMAKE_SOURCE_DIR}/libc/musl/include + ${CMAKE_SOURCE_DIR}/libc/musl/src/internal + ${CMAKE_SOURCE_DIR}/libc/musl/src/crypt + ${CMAKE_SOURCE_DIR}/libc/musl/arch/eos + ${CMAKE_CURRENT_SOURCE_DIR}/libcxx/include) -install(TARGETS c++ EXPORT EosioLib - LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) +target_link_libraries(c++ c) +target_link_libraries(native_c++ native_c) -add_custom_command( TARGET c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/lib ) +add_custom_command( TARGET c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/libcxx/include/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libcxx) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libcxx/include/ DESTINATION ${CMAKE_BINARY_DIR}/include/libcxx) +add_custom_command( TARGET native_c++ POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/libcxx/include/ DESTINATION ${BASE_BINARY_DIR}/include/libcxx) diff --git a/libraries/libc++/libcxx b/libraries/libc++/libcxx index 5e49eb5807..bfc1bddd18 160000 --- a/libraries/libc++/libcxx +++ b/libraries/libc++/libcxx @@ -1 +1 @@ -Subproject commit 5e49eb58072f2cc63879ea7f990f254e7514c774 +Subproject commit bfc1bddd181bb0b1a62610d526f01385a919d0cb diff --git a/libraries/libc/CMakeLists.txt b/libraries/libc/CMakeLists.txt index d20166b5c5..f7f0af18a4 100644 --- a/libraries/libc/CMakeLists.txt +++ b/libraries/libc/CMakeLists.txt @@ -20,8 +20,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-everything") file(GLOB HEADERS "${CMAKE_CURRENT_SOURCE_DIR}/musl/include/*.h" "${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal/*.h" - "${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos/*.h" -) + "${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos/*.h") add_library(c ${CRYPT_SOURCES} @@ -44,22 +43,46 @@ add_library(c "musl/src/malloc/memalign.c" ${HEADERS}) -add_dependencies(c EosioTools) +add_native_library(native_c + ${CRYPT_SOURCES} + ${CTYPE_SOURCES} + ${ENV_SOURCES} + ${ERRNO_SOURCES} + ${EXIT_SOURCES} + ${INTERNAL_SOURCES} + ${LOCALE_SOURCES} + ${MATH_SOURCES} + ${MBYTE_SOURCES} + ${MISC_SOURCES} + ${SEARCH_SOURCES} + ${STDIO_SOURCES} + ${STDLIB_SOURCES} + ${STRING_SOURCES} + ${TIME_SOURCES} + ${THREAD_SOURCES} + "musl/src/malloc/posix_memalign.c" + "musl/src/malloc/memalign.c" + ${HEADERS}) + target_include_directories(c PUBLIC - "$" - $) + ${CMAKE_CURRENT_SOURCE_DIR}/musl/include + ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal + ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/crypt + ${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos + ${CMAKE_SOURCE_DIR}) -install(TARGETS c EXPORT EosioLib - LIBRARY DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR}) - -add_custom_command( TARGET c POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/lib ) +target_include_directories(native_c + PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR}/musl/include + ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal + ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/crypt + ${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos + ${CMAKE_SOURCE_DIR}) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/musl/include/ DESTINATION ${CMAKE_BINARY_DIR}/include/libc/) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal/ DESTINATION ${CMAKE_BINARY_DIR}/include/libc/) -file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos/ DESTINATION ${CMAKE_BINARY_DIR}/include/libc/) +add_custom_command( TARGET c POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) +add_custom_command( TARGET native_c POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/musl/include/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libc) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libc) -install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/libc) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/musl/include/ DESTINATION ${BASE_BINARY_DIR}/include/libc/) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/musl/src/internal/ DESTINATION ${BASE_BINARY_DIR}/include/libc/) +file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/musl/arch/eos/ DESTINATION ${BASE_BINARY_DIR}/include/libc/) diff --git a/libraries/libc/musl b/libraries/libc/musl index 88b5e4c8e7..208f308e1c 160000 --- a/libraries/libc/musl +++ b/libraries/libc/musl @@ -1 +1 @@ -Subproject commit 88b5e4c8e7e058df0cec57f676089e4f03c639be +Subproject commit 208f308e1cd7816f61fc83b3f1cd2e5da3f4a5a7 diff --git a/libraries/native/CMakeLists.txt b/libraries/native/CMakeLists.txt new file mode 100644 index 0000000000..7bd34222e3 --- /dev/null +++ b/libraries/native/CMakeLists.txt @@ -0,0 +1,338 @@ +project(native LANGUAGES CXX ASM) + +if (NOT __APPLE) + set(CRT_ASM elf_crt.s) +else() + set(CRT_ASM macho_crt.s) +endif() + +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-everything") + +file(GLOB HEADERS "*.hpp" + "*.h") + +# Softfloat +# generate compile command database for external tools +set (CMAKE_EXPORT_COMPILE_COMMANDS "ON") + +message ( STATUS "Configuring SoftFloat" ) +set( C_DEFINES "-DSOFTFLOAT_FAST_INT64 -DSOFTFLOAT_ROUND_EVEN -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32" ) +set( CMAKE_C_FLAGS " -Wall -Werror-implicit-function-declaration -Wno-conversion ${CMAKE_C_FLAGS} ${C_DEFINES}" ) +set ( softfloat_sources + softfloat/source/s_eq128.c + softfloat/source/s_le128.c + softfloat/source/s_lt128.c + softfloat/source/s_shortShiftLeft128.c + softfloat/source/s_shortShiftRight128.c + softfloat/source/s_shortShiftRightJam64.c + softfloat/source/s_shortShiftRightJam64Extra.c + softfloat/source/s_shortShiftRightJam128.c + softfloat/source/s_shortShiftRightJam128Extra.c + softfloat/source/s_shiftRightJam32.c + softfloat/source/s_shiftRightJam64.c + softfloat/source/s_shiftRightJam64Extra.c + softfloat/source/s_shiftRightJam128.c + softfloat/source/s_shiftRightJam128Extra.c + softfloat/source/s_shiftRightJam256M.c + softfloat/source/s_countLeadingZeros8.c + softfloat/source/s_countLeadingZeros16.c + softfloat/source/s_countLeadingZeros32.c + softfloat/source/s_countLeadingZeros64.c + softfloat/source/s_add128.c + softfloat/source/s_add256M.c + softfloat/source/s_sub128.c + softfloat/source/s_sub256M.c + softfloat/source/s_mul64ByShifted32To128.c + softfloat/source/s_mul64To128.c + softfloat/source/s_mul128By32.c + softfloat/source/s_mul128To256M.c + softfloat/source/s_approxRecip_1Ks.c + softfloat/source/s_approxRecip32_1.c + softfloat/source/s_approxRecipSqrt_1Ks.c + softfloat/source/s_approxRecipSqrt32_1.c + softfloat/source/8086-SSE/softfloat_raiseFlags.c + softfloat/source/8086-SSE/s_f16UIToCommonNaN.c + softfloat/source/8086-SSE/s_commonNaNToF16UI.c + softfloat/source/8086-SSE/s_propagateNaNF16UI.c + softfloat/source/8086-SSE/s_f32UIToCommonNaN.c + softfloat/source/8086-SSE/s_commonNaNToF32UI.c + softfloat/source/8086-SSE/s_propagateNaNF32UI.c + softfloat/source/8086-SSE/s_f64UIToCommonNaN.c + softfloat/source/8086-SSE/s_commonNaNToF64UI.c + softfloat/source/8086-SSE/s_propagateNaNF64UI.c + softfloat/source/8086-SSE/extF80M_isSignalingNaN.c + softfloat/source/8086-SSE/s_extF80UIToCommonNaN.c + softfloat/source/8086-SSE/s_commonNaNToExtF80UI.c + softfloat/source/8086-SSE/s_propagateNaNExtF80UI.c + softfloat/source/8086-SSE/f128M_isSignalingNaN.c + softfloat/source/8086-SSE/s_f128UIToCommonNaN.c + softfloat/source/8086-SSE/s_commonNaNToF128UI.c + softfloat/source/8086-SSE/s_propagateNaNF128UI.c + softfloat/source/s_roundToUI32.c + softfloat/source/s_roundToUI64.c + softfloat/source/s_roundToI32.c + softfloat/source/s_roundToI64.c + softfloat/source/s_normSubnormalF16Sig.c + softfloat/source/s_roundPackToF16.c + softfloat/source/s_normRoundPackToF16.c + softfloat/source/s_addMagsF16.c + softfloat/source/s_subMagsF16.c + softfloat/source/s_mulAddF16.c + softfloat/source/s_normSubnormalF32Sig.c + softfloat/source/s_roundPackToF32.c + softfloat/source/s_normRoundPackToF32.c + softfloat/source/s_addMagsF32.c + softfloat/source/s_subMagsF32.c + softfloat/source/s_mulAddF32.c + softfloat/source/s_normSubnormalF64Sig.c + softfloat/source/s_roundPackToF64.c + softfloat/source/s_normRoundPackToF64.c + softfloat/source/s_addMagsF64.c + softfloat/source/s_subMagsF64.c + softfloat/source/s_mulAddF64.c + softfloat/source/s_normSubnormalExtF80Sig.c + softfloat/source/s_roundPackToExtF80.c + softfloat/source/s_normRoundPackToExtF80.c + softfloat/source/s_addMagsExtF80.c + softfloat/source/s_subMagsExtF80.c + softfloat/source/s_normSubnormalF128Sig.c + softfloat/source/s_roundPackToF128.c + softfloat/source/s_normRoundPackToF128.c + softfloat/source/s_addMagsF128.c + softfloat/source/s_subMagsF128.c + softfloat/source/s_mulAddF128.c + softfloat/source/softfloat_state.c + softfloat/source/ui32_to_f16.c + softfloat/source/ui32_to_f32.c + softfloat/source/ui32_to_f64.c + softfloat/source/ui32_to_extF80.c + softfloat/source/ui32_to_extF80M.c + softfloat/source/ui32_to_f128.c + softfloat/source/ui32_to_f128M.c + softfloat/source/ui64_to_f16.c + softfloat/source/ui64_to_f32.c + softfloat/source/ui64_to_f64.c + softfloat/source/ui64_to_extF80.c + softfloat/source/ui64_to_extF80M.c + softfloat/source/ui64_to_f128.c + softfloat/source/ui64_to_f128M.c + softfloat/source/i32_to_f16.c + softfloat/source/i32_to_f32.c + softfloat/source/i32_to_f64.c + softfloat/source/i32_to_extF80.c + softfloat/source/i32_to_extF80M.c + softfloat/source/i32_to_f128.c + softfloat/source/i32_to_f128M.c + softfloat/source/i64_to_f16.c + softfloat/source/i64_to_f32.c + softfloat/source/i64_to_f64.c + softfloat/source/i64_to_extF80.c + softfloat/source/i64_to_extF80M.c + softfloat/source/i64_to_f128.c + softfloat/source/i64_to_f128M.c + softfloat/source/f16_to_ui32.c + softfloat/source/f16_to_ui64.c + softfloat/source/f16_to_i32.c + softfloat/source/f16_to_i64.c + softfloat/source/f16_to_ui32_r_minMag.c + softfloat/source/f16_to_ui64_r_minMag.c + softfloat/source/f16_to_i32_r_minMag.c + softfloat/source/f16_to_i64_r_minMag.c + softfloat/source/f16_to_f32.c + softfloat/source/f16_to_f64.c + softfloat/source/f16_to_extF80.c + softfloat/source/f16_to_extF80M.c + softfloat/source/f16_to_f128.c + softfloat/source/f16_to_f128M.c + softfloat/source/f16_roundToInt.c + softfloat/source/f16_add.c + softfloat/source/f16_sub.c + softfloat/source/f16_mul.c + softfloat/source/f16_mulAdd.c + softfloat/source/f16_div.c + softfloat/source/f16_rem.c + softfloat/source/f16_sqrt.c + softfloat/source/f16_eq.c + softfloat/source/f16_le.c + softfloat/source/f16_lt.c + softfloat/source/f16_eq_signaling.c + softfloat/source/f16_le_quiet.c + softfloat/source/f16_lt_quiet.c + softfloat/source/f16_isSignalingNaN.c + softfloat/source/f32_to_ui32.c + softfloat/source/f32_to_ui64.c + softfloat/source/f32_to_i32.c + softfloat/source/f32_to_i64.c + softfloat/source/f32_to_ui32_r_minMag.c + softfloat/source/f32_to_ui64_r_minMag.c + softfloat/source/f32_to_i32_r_minMag.c + softfloat/source/f32_to_i64_r_minMag.c + softfloat/source/f32_to_f16.c + softfloat/source/f32_to_f64.c + softfloat/source/f32_to_extF80.c + softfloat/source/f32_to_extF80M.c + softfloat/source/f32_to_f128.c + softfloat/source/f32_to_f128M.c + softfloat/source/f32_roundToInt.c + softfloat/source/f32_add.c + softfloat/source/f32_sub.c + softfloat/source/f32_mul.c + softfloat/source/f32_mulAdd.c + softfloat/source/f32_div.c + softfloat/source/f32_rem.c + softfloat/source/f32_sqrt.c + softfloat/source/f32_eq.c + softfloat/source/f32_le.c + softfloat/source/f32_lt.c + softfloat/source/f32_eq_signaling.c + softfloat/source/f32_le_quiet.c + softfloat/source/f32_lt_quiet.c + softfloat/source/f32_isSignalingNaN.c + softfloat/source/f64_to_ui32.c + softfloat/source/f64_to_ui64.c + softfloat/source/f64_to_i32.c + softfloat/source/f64_to_i64.c + softfloat/source/f64_to_ui32_r_minMag.c + softfloat/source/f64_to_ui64_r_minMag.c + softfloat/source/f64_to_i32_r_minMag.c + softfloat/source/f64_to_i64_r_minMag.c + softfloat/source/f64_to_f16.c + softfloat/source/f64_to_f32.c + softfloat/source/f64_to_extF80.c + softfloat/source/f64_to_extF80M.c + softfloat/source/f64_to_f128.c + softfloat/source/f64_to_f128M.c + softfloat/source/f64_roundToInt.c + softfloat/source/f64_add.c + softfloat/source/f64_sub.c + softfloat/source/f64_mul.c + softfloat/source/f64_mulAdd.c + softfloat/source/f64_div.c + softfloat/source/f64_rem.c + softfloat/source/f64_sqrt.c + softfloat/source/f64_eq.c + softfloat/source/f64_le.c + softfloat/source/f64_lt.c + softfloat/source/f64_eq_signaling.c + softfloat/source/f64_le_quiet.c + softfloat/source/f64_lt_quiet.c + softfloat/source/f64_isSignalingNaN.c + softfloat/source/extF80_to_ui32.c + softfloat/source/extF80_to_ui64.c + softfloat/source/extF80_to_i32.c + softfloat/source/extF80_to_i64.c + softfloat/source/extF80_to_ui32_r_minMag.c + softfloat/source/extF80_to_ui64_r_minMag.c + softfloat/source/extF80_to_i32_r_minMag.c + softfloat/source/extF80_to_i64_r_minMag.c + softfloat/source/extF80_to_f16.c + softfloat/source/extF80_to_f32.c + softfloat/source/extF80_to_f64.c + softfloat/source/extF80_to_f128.c + softfloat/source/extF80_roundToInt.c + softfloat/source/extF80_add.c + softfloat/source/extF80_sub.c + softfloat/source/extF80_mul.c + softfloat/source/extF80_div.c + softfloat/source/extF80_rem.c + softfloat/source/extF80_sqrt.c + softfloat/source/extF80_eq.c + softfloat/source/extF80_le.c + softfloat/source/extF80_lt.c + softfloat/source/extF80_eq_signaling.c + softfloat/source/extF80_le_quiet.c + softfloat/source/extF80_lt_quiet.c + softfloat/source/extF80_isSignalingNaN.c + softfloat/source/extF80M_to_ui32.c + softfloat/source/extF80M_to_ui64.c + softfloat/source/extF80M_to_i32.c + softfloat/source/extF80M_to_i64.c + softfloat/source/extF80M_to_ui32_r_minMag.c + softfloat/source/extF80M_to_ui64_r_minMag.c + softfloat/source/extF80M_to_i32_r_minMag.c + softfloat/source/extF80M_to_i64_r_minMag.c + softfloat/source/extF80M_to_f16.c + softfloat/source/extF80M_to_f32.c + softfloat/source/extF80M_to_f64.c + softfloat/source/extF80M_to_f128M.c + softfloat/source/extF80M_roundToInt.c + softfloat/source/extF80M_add.c + softfloat/source/extF80M_sub.c + softfloat/source/extF80M_mul.c + softfloat/source/extF80M_div.c + softfloat/source/extF80M_rem.c + softfloat/source/extF80M_sqrt.c + softfloat/source/extF80M_eq.c + softfloat/source/extF80M_le.c + softfloat/source/extF80M_lt.c + softfloat/source/extF80M_eq_signaling.c + softfloat/source/extF80M_le_quiet.c + softfloat/source/extF80M_lt_quiet.c + softfloat/source/f128_to_ui32.c + softfloat/source/f128_to_ui64.c + softfloat/source/f128_to_i32.c + softfloat/source/f128_to_i64.c + softfloat/source/f128_to_ui32_r_minMag.c + softfloat/source/f128_to_ui64_r_minMag.c + softfloat/source/f128_to_i32_r_minMag.c + softfloat/source/f128_to_i64_r_minMag.c + softfloat/source/f128_to_f16.c + softfloat/source/f128_to_f32.c + softfloat/source/f128_to_extF80.c + softfloat/source/f128_to_f64.c + softfloat/source/f128_roundToInt.c + softfloat/source/f128_add.c + softfloat/source/f128_sub.c + softfloat/source/f128_mul.c + softfloat/source/f128_mulAdd.c + softfloat/source/f128_div.c + softfloat/source/f128_rem.c + softfloat/source/f128_sqrt.c + softfloat/source/f128_eq.c + softfloat/source/f128_le.c + softfloat/source/f128_lt.c + softfloat/source/f128_eq_signaling.c + softfloat/source/f128_le_quiet.c + softfloat/source/f128_lt_quiet.c + softfloat/source/f128_isSignalingNaN.c + softfloat/source/f128M_to_ui32.c + softfloat/source/f128M_to_ui64.c + softfloat/source/f128M_to_i32.c + softfloat/source/f128M_to_i64.c + softfloat/source/f128M_to_ui32_r_minMag.c + softfloat/source/f128M_to_ui64_r_minMag.c + softfloat/source/f128M_to_i32_r_minMag.c + softfloat/source/f128M_to_i64_r_minMag.c + softfloat/source/f128M_to_f16.c + softfloat/source/f128M_to_f32.c + softfloat/source/f128M_to_extF80M.c + softfloat/source/f128M_to_f64.c + softfloat/source/f128M_roundToInt.c + softfloat/source/f128M_add.c + softfloat/source/f128M_sub.c + softfloat/source/f128M_mul.c + softfloat/source/f128M_mulAdd.c + softfloat/source/f128M_div.c + softfloat/source/f128M_rem.c + softfloat/source/f128M_sqrt.c + softfloat/source/f128M_eq.c + softfloat/source/f128M_le.c + softfloat/source/f128M_lt.c + softfloat/source/f128M_eq_signaling.c + softfloat/source/f128M_le_quiet.c + softfloat/source/f128M_lt_quiet.c +) + +file ( GLOB softfloat_headers "${CMAKE_CURRENT_SOURCE_DIR}/softfloat/source/include/*.h" + "${CMAKE_CURRENT_SOURCE_DIR}/softfloat/build/Linux-x86_64-GCC/platform.h" + "${CMAKE_CURRENT_SOURCE_DIR}/softfloat/source/8086-SSE/specialize.h" ) +list( APPEND softfloat_sources ${softfloat_headers} ) + +add_native_library ( native STATIC ${softfloat_sources} intrinsics.cpp crt.cpp ${CRT_ASM} ) +target_include_directories( native PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/softfloat/source/include" "${CMAKE_CURRENT_SOURCE_DIR}/softfloat/source/8086-SSE" "${CMAKE_CURRENT_SOURCE_DIR}/softfloat/build/Linux-x86_64-GCC" ${CMAKE_SOURCE_DIR}) + +add_dependencies(native native_eosio) + +add_custom_command( TARGET native POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy $ ${BASE_BINARY_DIR}/lib ) + +file(COPY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${BASE_BINARY_DIR}/include/eosio FILES_MATCHING PATTERN "*.h" PATTERN "*.hpp" PATTERN "softfloat" EXCLUDE) diff --git a/libraries/native/crt.cpp b/libraries/native/crt.cpp new file mode 100644 index 0000000000..4d2b126033 --- /dev/null +++ b/libraries/native/crt.cpp @@ -0,0 +1,139 @@ +#include +#include +#include "intrinsics.hpp" +#include "crt.hpp" +#include +#include +#include +#include + +eosio::cdt::output_stream std_out; +eosio::cdt::output_stream std_err; + +extern "C" { +#ifdef __APPLE__ + void* alloca(size_t s) { + return malloc(s); + } +#endif + int main(int, char**); + char* _mmap(); + + static jmp_buf env; + static jmp_buf test_env; + static volatile int jmp_ret; + jmp_buf* ___env_ptr = &env; + char* ___heap; + char* ___heap_ptr; + void ___putc(char c); + bool ___disable_output; + bool ___has_failed; + + void _prints_l(const char* cstr, uint32_t len, uint8_t which) { + for (int i=0; i < len; i++) { + if (which == eosio::cdt::output_stream_kind::std_out) + std_out.push(cstr[i]); + else if (which == eosio::cdt::output_stream_kind::std_err) + std_err.push(cstr[i]); + if (!___disable_output) + ___putc(cstr[i]); + } + } + + void _prints(const char* cstr, uint8_t which) { + for (int i=0; cstr[i] != '\0'; i++) { + if (which == eosio::cdt::output_stream_kind::std_out) + std_out.push(cstr[i]); + else if (which == eosio::cdt::output_stream_kind::std_err) + std_err.push(cstr[i]); + if (!___disable_output) + ___putc(cstr[i]); + } + } + + void __set_env_test() { + ___env_ptr = &test_env; + } + void __reset_env() { + ___env_ptr = &env; + } + + int _wrap_main(int argc, char** argv) { + using namespace eosio::native; + int ret_val = 0; + ___heap = _mmap(); + ___heap_ptr = ___heap; + ___disable_output = false; + ___has_failed = false; + // preset the print functions + intrinsics::set_intrinsic([](const char* cs, uint32_t l) { + _prints_l(cs, l, eosio::cdt::output_stream_kind::std_out); + }); + intrinsics::set_intrinsic([](const char* cs) { + _prints(cs, eosio::cdt::output_stream_kind::std_out); + }); + intrinsics::set_intrinsic([](int64_t v) { + printf("%lli\n", v); + }); + intrinsics::set_intrinsic([](uint64_t v) { + printf("%llu\n", v); + }); + intrinsics::set_intrinsic([](const int128_t* v) { + int* tmp = (int*)v; + printf("0x%04x%04x%04x%04x\n", tmp[0], tmp[1], tmp[2], tmp[3]); + }); + intrinsics::set_intrinsic([](const uint128_t* v) { + int* tmp = (int*)v; + printf("0x%04x%04x%04x%04x\n", tmp[0], tmp[1], tmp[2], tmp[3]); + }); + intrinsics::set_intrinsic([](float v) { + char buff[512] = {0}; + std::string ret = std::to_string((int)v); + memcpy(buff, ret.c_str(), ret.size()); + v -= (int)v; + buff[ret.size()] = '.'; + size_t size = ret.size(); + for (size_t i=size+1; i < size+10; i++) { + v *= 10; + buff[i] = ((int)v)+'0'; + v -= (int)v; + } + prints(buff); + }); + intrinsics::set_intrinsic([](double v) { + char buff[512] = {0}; + std::string ret = std::to_string((long)v); + memcpy(buff, ret.c_str(), ret.size()); + v -= (long)v; + buff[ret.size()] = '.'; + size_t size = ret.size(); + for (size_t i=size+1; i < size+10; i++) { + v *= 10; + buff[i] = ((int)v)+'0'; + v -= (int)v; + } + prints(buff); + }); + intrinsics::set_intrinsic([](const long double* v) { + int* tmp = (int*)v; + printf("0x%04x%04x%04x%04x\n", tmp[0], tmp[1], tmp[2], tmp[3]); + }); + intrinsics::set_intrinsic([](uint64_t nm) { + std::string s = eosio::name(nm).to_string(); + prints_l(s.c_str(), s.length()); + }); + + jmp_ret = setjmp(env); + if (jmp_ret == 0) { + ret_val = main(argc, argv); + } else { + ret_val = -1; + } + return ret_val; + } + + extern "C" void* memset(void*, int, size_t); + extern "C" void __bzero(void* to, size_t cnt) { + memset(to, 0, cnt); + } +} diff --git a/libraries/native/crt.hpp b/libraries/native/crt.hpp new file mode 100644 index 0000000000..770a49bba2 --- /dev/null +++ b/libraries/native/crt.hpp @@ -0,0 +1,30 @@ +#pragma once +#include + +namespace eosio { namespace cdt { + enum output_stream_kind { + std_out, + std_err, + none + }; + struct output_stream { + char output[1024*2]; + size_t index = 0; + std::string to_string()const { return std::string((const char*)output, index); } + const char* get()const { return output; } + void push(char c) { output[index++] = c; } + void clear() { index = 0; } + }; +}} //ns eosio::cdt + +extern eosio::cdt::output_stream std_out; +extern eosio::cdt::output_stream std_err; +extern "C" jmp_buf* ___env_ptr; +extern "C" char* ___heap_ptr; + +extern "C" { + void __set_env_test(); + void __reset_env(); + void _prints_l(const char* cstr, uint32_t len, uint8_t which); + void _prints(const char* cstr, uint8_t which); +} diff --git a/libraries/native/elf_crt.s b/libraries/native/elf_crt.s new file mode 100644 index 0000000000..f5f5f41810 --- /dev/null +++ b/libraries/native/elf_crt.s @@ -0,0 +1,75 @@ +.global _start +.global ___putc +.global _mmap +.global setjmp +.global longjmp +.type _start,@function +.type ___putc,@function +.type _mmap,@function +.type setjmp,@function +.type longjmp,@function + +_start: + mov %rsp, %rbp + mov 0(%rbp), %rdi + lea 8(%rbp), %rsi + call _wrap_main + mov %rax, %rdi + mov $60, %rax + syscall + +___putc: + dec %rsp + mov %rbx, %r8 + mov %rdi, %rax + mov %al, 0(%rsp) + mov $1, %edi + mov %rsp, %rsi + mov $1, %edx + mov $1, %eax + syscall + inc %rsp + mov %r8, %rbx + ret + +_mmap: + mov $9, %eax + mov $0, %rdi + mov $0x6400000, %rsi # 100Mb + mov $3, %rdx + mov $0x22, %r10 + mov $-1, %r8 + mov $0, %r9 + syscall + ret + +setjmp: + mov %rbx, 0(%rdi) + mov %rbp, 8(%rdi) + mov %r12, 16(%rdi) + mov %r13, 24(%rdi) + mov %r14, 32(%rdi) + mov %r15, 40(%rdi) + lea 8(%rsp), %rdx + mov %rdx, 48(%rdi) + mov (%rsp), %rdx + mov %rdx, 56(%rdi) + xor %rax, %rax + ret + +longjmp: + mov %rsi, %rax + test %rax, %rax + jnz 1f + inc %rax +1: + mov 0(%rdi), %rbx + mov 8(%rdi), %rbp + mov 16(%rdi), %r12 + mov 24(%rdi), %r13 + mov 32(%rdi), %r14 + mov 40(%rdi), %r15 + mov 48(%rdi), %rdx + mov %rdx, %rsp + mov 56(%rdi), %rdx + jmp *%rdx diff --git a/libraries/native/intrinsics.cpp b/libraries/native/intrinsics.cpp new file mode 100644 index 0000000000..18b11e45c6 --- /dev/null +++ b/libraries/native/intrinsics.cpp @@ -0,0 +1,891 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "intrinsics.hpp" +#include "crt.hpp" +#include +#include + +// Boilerplate +using namespace eosio::native; +extern "C" { + void get_resource_limits( capi_name account, int64_t* ram_bytes, int64_t* net_weight, int64_t* cpu_weight ) { + return intrinsics::get().call(account, ram_bytes, net_weight, cpu_weight); + } + void set_resource_limits( capi_name account, int64_t ram_bytes, int64_t net_weight, int64_t cpu_weight ) { + return intrinsics::get().call(account, ram_bytes, net_weight, cpu_weight); + } + int64_t set_proposed_producers( char *producer_data, uint32_t producer_data_size ) { + return intrinsics::get().call(producer_data, producer_data_size); + } + uint32_t get_blockchain_parameters_packed( char* data, uint32_t datalen ) { + return intrinsics::get().call(data, datalen); + } + void set_blockchain_parameters_packed( char* data, uint32_t datalen ) { + return intrinsics::get().call(data, datalen); + } + bool is_privileged( capi_name account ) { + return intrinsics::get().call(account); + } + void set_privileged( capi_name account, bool is_priv ) { + return intrinsics::get().call(account, is_priv); + } + uint32_t get_active_producers( capi_name* producers, uint32_t datalen ) { + return intrinsics::get().call(producers, datalen); + } + int32_t db_idx64_store(uint64_t scope, capi_name table, capi_name payer, uint64_t id, const uint64_t* secondary) { + return intrinsics::get().call(scope, table, payer, id, secondary); + } + void db_idx64_remove(int32_t iterator) { + return intrinsics::get().call(iterator); + } + void db_idx64_update(int32_t iterator, capi_name payer, const uint64_t* secondary) { + return intrinsics::get().call(iterator, payer, secondary); + } + int32_t db_idx64_find_primary(capi_name code, uint64_t scope, capi_name table, uint64_t* secondary, uint64_t primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx64_find_secondary(capi_name code, uint64_t scope, capi_name table, const uint64_t* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx64_lowerbound(capi_name code, uint64_t scope, capi_name table, uint64_t* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx64_upperbound(capi_name code, uint64_t scope, capi_name table, uint64_t* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx64_end(capi_name code, uint64_t scope, capi_name table) { + return intrinsics::get().call(code, scope, table); + } + int32_t db_idx64_next(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx64_previous(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx128_store(uint64_t scope, capi_name table, capi_name payer, uint64_t id, const uint128_t* secondary) { + return intrinsics::get().call(scope, table, payer, id, secondary); + } + void db_idx128_remove(int32_t iterator) { + return intrinsics::get().call(iterator); + } + void db_idx128_update(int32_t iterator, capi_name payer, const uint128_t* secondary) { + return intrinsics::get().call(iterator, payer, secondary); + } + int32_t db_idx128_find_primary(capi_name code, uint64_t scope, capi_name table, uint128_t* secondary, uint64_t primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx128_find_secondary(capi_name code, uint64_t scope, capi_name table, const uint128_t* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx128_lowerbound(capi_name code, uint64_t scope, capi_name table, uint128_t* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx128_upperbound(capi_name code, uint64_t scope, capi_name table, uint128_t* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx128_end(capi_name code, uint64_t scope, capi_name table) { + return intrinsics::get().call(code, scope, table); + } + int32_t db_idx128_next(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx128_previous(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx256_store(uint64_t scope, capi_name table, capi_name payer, uint64_t id, const uint128_t* data, uint32_t datalen) { + return intrinsics::get().call(scope, table, payer, id, data, datalen); + } + void db_idx256_remove(int32_t iterator) { + return intrinsics::get().call(iterator); + } + void db_idx256_update(int32_t iterator, capi_name payer, const uint128_t* data, uint32_t datalen) { + return intrinsics::get().call(iterator, payer, data, datalen); + } + int32_t db_idx256_find_primary(capi_name code, uint64_t scope, capi_name table, uint128_t* data, uint32_t datalen, uint64_t primary) { + return intrinsics::get().call(code, scope, table, data, datalen, primary); + } + int32_t db_idx256_find_secondary(capi_name code, uint64_t scope, capi_name table, const uint128_t* data, uint32_t datalen, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, data, datalen, primary); + } + int32_t db_idx256_lowerbound(capi_name code, uint64_t scope, capi_name table, uint128_t* data, uint32_t datalen, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, data, datalen, primary); + } + int32_t db_idx256_upperbound(capi_name code, uint64_t scope, capi_name table, uint128_t* data, uint32_t datalen, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, data, datalen, primary); + } + int32_t db_idx256_end(capi_name code, uint64_t scope, capi_name table) { + return intrinsics::get().call(code, scope, table); + } + int32_t db_idx256_next(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx256_previous(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx_double_store(uint64_t scope, capi_name table, capi_name payer, uint64_t id, const double* secondary) { + return intrinsics::get().call(scope, table, payer, id, secondary); + } + void db_idx_double_remove(int32_t iterator) { + return intrinsics::get().call(iterator); + } + void db_idx_double_update(int32_t iterator, capi_name payer, const double* secondary) { + return intrinsics::get().call(iterator, payer, secondary); + } + int32_t db_idx_double_find_primary(capi_name code, uint64_t scope, capi_name table, double* secondary, uint64_t primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_double_find_secondary(capi_name code, uint64_t scope, capi_name table, const double* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_double_lowerbound(capi_name code, uint64_t scope, capi_name table, double* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_double_upperbound(capi_name code, uint64_t scope, capi_name table, double* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_double_end(capi_name code, uint64_t scope, capi_name table) { + return intrinsics::get().call(code, scope, table); + } + int32_t db_idx_double_next(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx_double_previous(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx_long_double_store(uint64_t scope, capi_name table, capi_name payer, uint64_t id, const long double* secondary) { + return intrinsics::get().call(scope, table, payer, id, secondary); + } + void db_idx_long_double_remove(int32_t iterator) { + return intrinsics::get().call(iterator); + } + void db_idx_long_double_update(int32_t iterator, capi_name payer, const long double* secondary) { + return intrinsics::get().call(iterator, payer, secondary); + } + int32_t db_idx_long_double_find_primary(capi_name code, uint64_t scope, capi_name table, long double* secondary, uint64_t primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_long_double_find_secondary(capi_name code, uint64_t scope, capi_name table, const long double* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_long_double_lowerbound(capi_name code, uint64_t scope, capi_name table, long double* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_long_double_upperbound(capi_name code, uint64_t scope, capi_name table, long double* secondary, uint64_t* primary) { + return intrinsics::get().call(code, scope, table, secondary, primary); + } + int32_t db_idx_long_double_end(capi_name code, uint64_t scope, capi_name table) { + return intrinsics::get().call(code, scope, table); + } + int32_t db_idx_long_double_next(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_idx_long_double_previous(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_store_i64(uint64_t scope, capi_name table, capi_name payer, uint64_t id, const void* data, uint32_t len) { + return intrinsics::get().call(scope, table, payer, id, data, len); + } + void db_update_i64(int32_t iterator, capi_name payer, const void* data, uint32_t len) { + return intrinsics::get().call(iterator, payer, data, len); + } + void db_remove_i64(int32_t iterator) { + return intrinsics::get().call(iterator); + } + int32_t db_get_i64(int32_t iterator, const void* data, uint32_t len) { + return intrinsics::get().call(iterator, data, len); + } + int32_t db_next_i64(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_previous_i64(int32_t iterator, uint64_t* primary) { + return intrinsics::get().call(iterator, primary); + } + int32_t db_find_i64(capi_name code, uint64_t scope, capi_name table, uint64_t id) { + return intrinsics::get().call(code, scope, table, id); + } + int32_t db_lowerbound_i64(capi_name code, uint64_t scope, capi_name table, uint64_t id) { + return intrinsics::get().call(code, scope, table, id); + } + int32_t db_upperbound_i64(capi_name code, uint64_t scope, capi_name table, uint64_t id) { + return intrinsics::get().call(code, scope, table, id); + } + int32_t db_end_i64(capi_name code, uint64_t scope, capi_name table) { + return intrinsics::get().call(code, scope, table); + } + void assert_recover_key( const capi_checksum256* digest, const char* sig, size_t siglen, const char* pub, size_t publen ) { + return intrinsics::get().call(digest, sig, siglen, pub, publen); + } + int recover_key( const capi_checksum256* digest, const char* sig, size_t siglen, char* pub, size_t publen ) { + return intrinsics::get().call(digest, sig, siglen, pub, publen); + } + void assert_sha256( const char* data, uint32_t length, const capi_checksum256* hash ) { + return intrinsics::get().call(data, length, hash); + } + void assert_sha1( const char* data, uint32_t length, const capi_checksum160* hash ) { + return intrinsics::get().call(data, length, hash); + } + void assert_sha512( const char* data, uint32_t length, const capi_checksum512* hash ) { + return intrinsics::get().call(data, length, hash); + } + void assert_ripemd160( const char* data, uint32_t length, const capi_checksum160* hash ) { + return intrinsics::get().call(data, length, hash); + } + void sha256( const char* data, uint32_t length, capi_checksum256* hash ) { + return intrinsics::get().call(data, length, hash); + } + void sha1( const char* data, uint32_t length, capi_checksum160* hash ) { + return intrinsics::get().call(data, length, hash); + } + void sha512( const char* data, uint32_t length, capi_checksum512* hash ) { + return intrinsics::get().call(data, length, hash); + } + void ripemd160( const char* data, uint32_t length, capi_checksum160* hash ) { + return intrinsics::get().call(data, length, hash); + } + int32_t check_transaction_authorization( const char* trx_data, uint32_t trx_size, + const char* pubkeys_data, uint32_t pubkeys_size, + const char* perms_data, uint32_t perms_size + ) { + return intrinsics::get().call(trx_data, trx_size, pubkeys_data, pubkeys_size, perms_data, perms_size); + } + int32_t check_permission_authorization( capi_name account, capi_name permission, + const char* pubkeys_data, uint32_t pubkeys_size, + const char* perms_data, uint32_t perms_size, uint64_t delay_us + ) { + return intrinsics::get().call(account, permission, pubkeys_data, pubkeys_size, perms_data, perms_size, delay_us); + } + int64_t get_permission_last_used( capi_name account, capi_name permission ) { + return intrinsics::get().call(account, permission); + } + int64_t get_account_creation_time( capi_name account ) { + return intrinsics::get().call(account); + } + uint64_t current_time() { + return intrinsics::get().call(); + } + uint64_t publication_time() { + return intrinsics::get().call(); + } + uint32_t read_action_data( void* msg, uint32_t len ) { + return intrinsics::get().call(msg, len); + } + uint32_t action_data_size() { + return intrinsics::get().call(); + } + capi_name current_receiver() { + return intrinsics::get().call(); + } + void require_recipient( capi_name name ) { + return intrinsics::get().call(name); + } + void require_auth( capi_name name ) { + return intrinsics::get().call(name); + } + void require_auth2( capi_name name, capi_name permission ) { + return intrinsics::get().call(name, permission); + } + bool has_auth( capi_name name ) { + return intrinsics::get().call(name); + } + bool is_account( capi_name name ) { + return intrinsics::get().call(name); + } + size_t read_transaction(char *buffer, size_t size) { + return intrinsics::get().call(buffer, size); + } + size_t transaction_size() { + return intrinsics::get().call(); + } + uint32_t expiration() { + return intrinsics::get().call(); + } + int tapos_block_prefix() { + return intrinsics::get().call(); + } + int tapos_block_num() { + return intrinsics::get().call(); + } + int get_action( uint32_t type, uint32_t index, char* buff, size_t size ) { + return intrinsics::get().call(type, index, buff, size); + } + void send_inline(char *serialized_action, size_t size) { + return intrinsics::get().call(serialized_action, size); + } + void send_context_free_inline(char *serialized_action, size_t size) { + return intrinsics::get().call(serialized_action, size); + } + void send_deferred(const uint128_t& sender_id, capi_name payer, const char *serialized_transaction, size_t size, uint32_t replace_existing) { + return intrinsics::get().call(sender_id, payer, serialized_transaction, size, replace_existing); + } + int cancel_deferred(const uint128_t& sender_id) { + return intrinsics::get().call(sender_id); + } + int get_context_free_data( uint32_t index, char* buff, size_t size ) { + return intrinsics::get().call(index, buff, size); + } + + // softfloat + static constexpr uint32_t inv_float_eps = 0x4B000000; + static constexpr uint64_t inv_double_eps = 0x4330000000000000; + + float _eosio_f32_add( float a, float b ) { + float32_t ret = f32_add( to_softfloat32(a), to_softfloat32(b) ); + return *reinterpret_cast(&ret); + } + float _eosio_f32_sub( float a, float b ) { + float32_t ret = f32_sub( to_softfloat32(a), to_softfloat32(b) ); + return *reinterpret_cast(&ret); + } + float _eosio_f32_div( float a, float b ) { + float32_t ret = f32_div( to_softfloat32(a), to_softfloat32(b) ); + return *reinterpret_cast(&ret); + } + float _eosio_f32_mul( float a, float b ) { + float32_t ret = f32_mul( to_softfloat32(a), to_softfloat32(b) ); + return *reinterpret_cast(&ret); + } + float _eosio_f32_min( float af, float bf ) { + float32_t a = to_softfloat32(af); + float32_t b = to_softfloat32(bf); + if (f32_is_nan(a)) { + return af; + } + if (f32_is_nan(b)) { + return bf; + } + if ( f32_sign_bit(a) != f32_sign_bit(b) ) { + return f32_sign_bit(a) ? af : bf; + } + return f32_lt(a,b) ? af : bf; + } + float _eosio_f32_max( float af, float bf ) { + float32_t a = to_softfloat32(af); + float32_t b = to_softfloat32(bf); + if (f32_is_nan(a)) { + return af; + } + if (f32_is_nan(b)) { + return bf; + } + if ( f32_sign_bit(a) != f32_sign_bit(b) ) { + return f32_sign_bit(a) ? bf : af; + } + return f32_lt( a, b ) ? bf : af; + } + float _eosio_f32_copysign( float af, float bf ) { + float32_t a = to_softfloat32(af); + float32_t b = to_softfloat32(bf); + uint32_t sign_of_a = a.v >> 31; + uint32_t sign_of_b = b.v >> 31; + a.v &= ~(1 << 31); // clear the sign bit + a.v = a.v | (sign_of_b << 31); // add the sign of b + return from_softfloat32(a); + } + // float unops + float _eosio_f32_abs( float af ) { + float32_t a = to_softfloat32(af); + a.v &= ~(1 << 31); + return from_softfloat32(a); + } + float _eosio_f32_neg( float af ) { + float32_t a = to_softfloat32(af); + uint32_t sign = a.v >> 31; + a.v &= ~(1 << 31); + a.v |= (!sign << 31); + return from_softfloat32(a); + } + float _eosio_f32_sqrt( float a ) { + float32_t ret = f32_sqrt( to_softfloat32(a) ); + return from_softfloat32(ret); + } + // ceil, floor, trunc and nearest are lifted from libc + float _eosio_f32_ceil( float af ) { + float32_t a = to_softfloat32(af); + int e = (int)(a.v >> 23 & 0xFF) - 0X7F; + uint32_t m; + if (e >= 23) + return af; + if (e >= 0) { + m = 0x007FFFFF >> e; + if ((a.v & m) == 0) + return af; + if (a.v >> 31 == 0) + a.v += m; + a.v &= ~m; + } else { + if (a.v >> 31) + a.v = 0x80000000; // return -0.0f + else if (a.v << 1) + a.v = 0x3F800000; // return 1.0f + } + + return from_softfloat32(a); + } + float _eosio_f32_floor( float af ) { + float32_t a = to_softfloat32(af); + int e = (int)(a.v >> 23 & 0xFF) - 0X7F; + uint32_t m; + if (e >= 23) + return af; + if (e >= 0) { + m = 0x007FFFFF >> e; + if ((a.v & m) == 0) + return af; + if (a.v >> 31) + a.v += m; + a.v &= ~m; + } else { + if (a.v >> 31 == 0) + a.v = 0; + else if (a.v << 1) + a.v = 0xBF800000; // return -1.0f + } + return from_softfloat32(a); + } + float _eosio_f32_trunc( float af ) { + float32_t a = to_softfloat32(af); + int e = (int)(a.v >> 23 & 0xff) - 0x7f + 9; + uint32_t m; + if (e >= 23 + 9) + return af; + if (e < 9) + e = 1; + m = -1U >> e; + if ((a.v & m) == 0) + return af; + a.v &= ~m; + return from_softfloat32(a); + } + float _eosio_f32_nearest( float af ) { + float32_t a = to_softfloat32(af); + int e = a.v>>23 & 0xff; + int s = a.v>>31; + float32_t y; + if (e >= 0x7f+23) + return af; + if (s) + y = f32_add( f32_sub( a, float32_t{inv_float_eps} ), float32_t{inv_float_eps} ); + else + y = f32_sub( f32_add( a, float32_t{inv_float_eps} ), float32_t{inv_float_eps} ); + if (f32_eq( y, {0} ) ) + return s ? -0.0f : 0.0f; + return from_softfloat32(y); + } + + // float relops + bool _eosio_f32_eq( float a, float b ) { return f32_eq( to_softfloat32(a), to_softfloat32(b) ); } + bool _eosio_f32_ne( float a, float b ) { return !f32_eq( to_softfloat32(a), to_softfloat32(b) ); } + bool _eosio_f32_lt( float a, float b ) { return f32_lt( to_softfloat32(a), to_softfloat32(b) ); } + bool _eosio_f32_le( float a, float b ) { return f32_le( to_softfloat32(a), to_softfloat32(b) ); } + bool _eosio_f32_gt( float af, float bf ) { + float32_t a = to_softfloat32(af); + float32_t b = to_softfloat32(bf); + if (f32_is_nan(a)) + return false; + if (f32_is_nan(b)) + return false; + return !f32_le( a, b ); + } + bool _eosio_f32_ge( float af, float bf ) { + float32_t a = to_softfloat32(af); + float32_t b = to_softfloat32(bf); + if (f32_is_nan(a)) + return false; + if (f32_is_nan(b)) + return false; + return !f32_lt( a, b ); + } + + // double binops + double _eosio_f64_add( double a, double b ) { + float64_t ret = f64_add( to_softfloat64(a), to_softfloat64(b) ); + return from_softfloat64(ret); + } + double _eosio_f64_sub( double a, double b ) { + float64_t ret = f64_sub( to_softfloat64(a), to_softfloat64(b) ); + return from_softfloat64(ret); + } + double _eosio_f64_div( double a, double b ) { + float64_t ret = f64_div( to_softfloat64(a), to_softfloat64(b) ); + return from_softfloat64(ret); + } + double _eosio_f64_mul( double a, double b ) { + float64_t ret = f64_mul( to_softfloat64(a), to_softfloat64(b) ); + return from_softfloat64(ret); + } + double _eosio_f64_min( double af, double bf ) { + float64_t a = to_softfloat64(af); + float64_t b = to_softfloat64(bf); + if (f64_is_nan(a)) + return af; + if (f64_is_nan(b)) + return bf; + if (f64_sign_bit(a) != f64_sign_bit(b)) + return f64_sign_bit(a) ? af : bf; + return f64_lt( a, b ) ? af : bf; + } + double _eosio_f64_max( double af, double bf ) { + float64_t a = to_softfloat64(af); + float64_t b = to_softfloat64(bf); + if (f64_is_nan(a)) + return af; + if (f64_is_nan(b)) + return bf; + if (f64_sign_bit(a) != f64_sign_bit(b)) + return f64_sign_bit(a) ? bf : af; + return f64_lt( a, b ) ? bf : af; + } + double _eosio_f64_copysign( double af, double bf ) { + float64_t a = to_softfloat64(af); + float64_t b = to_softfloat64(bf); + uint64_t sign_of_a = a.v >> 63; + uint64_t sign_of_b = b.v >> 63; + a.v &= ~(uint64_t(1) << 63); // clear the sign bit + a.v = a.v | (sign_of_b << 63); // add the sign of b + return from_softfloat64(a); + } + + // double unops + double _eosio_f64_abs( double af ) { + float64_t a = to_softfloat64(af); + a.v &= ~(uint64_t(1) << 63); + return from_softfloat64(a); + } + double _eosio_f64_neg( double af ) { + float64_t a = to_softfloat64(af); + uint64_t sign = a.v >> 63; + a.v &= ~(uint64_t(1) << 63); + a.v |= (uint64_t(!sign) << 63); + return from_softfloat64(a); + } + double _eosio_f64_sqrt( double a ) { + float64_t ret = f64_sqrt( to_softfloat64(a) ); + return from_softfloat64(ret); + } + // ceil, floor, trunc and nearest are lifted from libc + double _eosio_f64_ceil( double af ) { + float64_t a = to_softfloat64( af ); + float64_t ret; + int e = a.v >> 52 & 0x7ff; + float64_t y; + if (e >= 0x3ff+52 || f64_eq( a, { 0 } )) + return af; + /* y = int(x) - x, where int(x) is an integer neighbor of x */ + if (a.v >> 63) + y = f64_sub( f64_add( f64_sub( a, float64_t{inv_double_eps} ), float64_t{inv_double_eps} ), a ); + else + y = f64_sub( f64_sub( f64_add( a, float64_t{inv_double_eps} ), float64_t{inv_double_eps} ), a ); + /* special case because of non-nearest rounding modes */ + if (e <= 0x3ff-1) { + return a.v >> 63 ? -0.0 : 1.0; //float64_t{0x8000000000000000} : float64_t{0xBE99999A3F800000}; //either -0.0 or 1 + } + if (f64_lt( y, to_softfloat64(0) )) { + ret = f64_add( f64_add( a, y ), to_softfloat64(1) ); // 0xBE99999A3F800000 } ); // plus 1 + return from_softfloat64(ret); + } + ret = f64_add( a, y ); + return from_softfloat64(ret); + } + double _eosio_f64_floor( double af ) { + float64_t a = to_softfloat64( af ); + float64_t ret; + int e = a.v >> 52 & 0x7FF; + float64_t y; + double de = 1/DBL_EPSILON; + if ( a.v == 0x8000000000000000) { + return af; + } + if (e >= 0x3FF+52 || a.v == 0) { + return af; + } + if (a.v >> 63) + y = f64_sub( f64_add( f64_sub( a, float64_t{inv_double_eps} ), float64_t{inv_double_eps} ), a ); + else + y = f64_sub( f64_sub( f64_add( a, float64_t{inv_double_eps} ), float64_t{inv_double_eps} ), a ); + if (e <= 0x3FF-1) { + return a.v>>63 ? -1.0 : 0.0; //float64_t{0xBFF0000000000000} : float64_t{0}; // -1 or 0 + } + if ( !f64_le( y, float64_t{0} ) ) { + ret = f64_sub( f64_add(a,y), to_softfloat64(1.0)); + return from_softfloat64(ret); + } + ret = f64_add( a, y ); + return from_softfloat64(ret); + } + double _eosio_f64_trunc( double af ) { + float64_t a = to_softfloat64( af ); + int e = (int)(a.v >> 52 & 0x7ff) - 0x3ff + 12; + uint64_t m; + if (e >= 52 + 12) + return af; + if (e < 12) + e = 1; + m = -1ULL >> e; + if ((a.v & m) == 0) + return af; + a.v &= ~m; + return from_softfloat64(a); + } + + double _eosio_f64_nearest( double af ) { + float64_t a = to_softfloat64( af ); + int e = (a.v >> 52 & 0x7FF); + int s = a.v >> 63; + float64_t y; + if ( e >= 0x3FF+52 ) + return af; + if ( s ) + y = f64_add( f64_sub( a, float64_t{inv_double_eps} ), float64_t{inv_double_eps} ); + else + y = f64_sub( f64_add( a, float64_t{inv_double_eps} ), float64_t{inv_double_eps} ); + if ( f64_eq( y, float64_t{0} ) ) + return s ? -0.0 : 0.0; + return from_softfloat64(y); + } + + // double relops + bool _eosio_f64_eq( double a, double b ) { return f64_eq( to_softfloat64(a), to_softfloat64(b) ); } + bool _eosio_f64_ne( double a, double b ) { return !f64_eq( to_softfloat64(a), to_softfloat64(b) ); } + bool _eosio_f64_lt( double a, double b ) { return f64_lt( to_softfloat64(a), to_softfloat64(b) ); } + bool _eosio_f64_le( double a, double b ) { return f64_le( to_softfloat64(a), to_softfloat64(b) ); } + bool _eosio_f64_gt( double af, double bf ) { + float64_t a = to_softfloat64(af); + float64_t b = to_softfloat64(bf); + if (f64_is_nan(a)) + return false; + if (f64_is_nan(b)) + return false; + return !f64_le( a, b ); + } + bool _eosio_f64_ge( double af, double bf ) { + float64_t a = to_softfloat64(af); + float64_t b = to_softfloat64(bf); + if (f64_is_nan(a)) + return false; + if (f64_is_nan(b)) + return false; + return !f64_lt( a, b ); + } + + // float and double conversions + double _eosio_f32_promote( float a ) { + return from_softfloat64(f32_to_f64( to_softfloat32(a)) ); + } + float _eosio_f64_demote( double a ) { + return from_softfloat32(f64_to_f32( to_softfloat64(a)) ); + } + int32_t _eosio_f32_trunc_i32s( float af ) { + float32_t a = to_softfloat32(af); + if (_eosio_f32_ge(af, 2147483648.0f) || _eosio_f32_lt(af, -2147483648.0f)) + eosio_assert(false, "Error, f32.convert_s/i32 overflow" ); + + if (f32_is_nan(a)) + eosio_assert(false, "Error, f32.convert_s/i32 unrepresentable"); + return f32_to_i32( to_softfloat32(_eosio_f32_trunc( af )), 0, false ); + } + int32_t _eosio_f64_trunc_i32s( double af ) { + float64_t a = to_softfloat64(af); + if (_eosio_f64_ge(af, 2147483648.0) || _eosio_f64_lt(af, -2147483648.0)) + eosio_assert(false, "Error, f64.convert_s/i32 overflow"); + if (f64_is_nan(a)) + eosio_assert(false, "Error, f64.convert_s/i32 unrepresentable"); + return f64_to_i32( to_softfloat64(_eosio_f64_trunc( af )), 0, false ); + } + uint32_t _eosio_f32_trunc_i32u( float af ) { + float32_t a = to_softfloat32(af); + if (_eosio_f32_ge(af, 4294967296.0f) || _eosio_f32_le(af, -1.0f)) + eosio_assert(false, "Error, f32.convert_u/i32 overflow"); + if (f32_is_nan(a)) + eosio_assert(false, "Error, f32.convert_u/i32 unrepresentable"); + return f32_to_ui32( to_softfloat32(_eosio_f32_trunc( af )), 0, false ); + } + uint32_t _eosio_f64_trunc_i32u( double af ) { + float64_t a = to_softfloat64(af); + if (_eosio_f64_ge(af, 4294967296.0) || _eosio_f64_le(af, -1.0)) + eosio_assert(false, "Error, f64.convert_u/i32 overflow"); + if (f64_is_nan(a)) + eosio_assert(false, "Error, f64.convert_u/i32 unrepresentable"); + return f64_to_ui32( to_softfloat64(_eosio_f64_trunc( af )), 0, false ); + } + int64_t _eosio_f32_trunc_i64s( float af ) { + float32_t a = to_softfloat32(af); + if (_eosio_f32_ge(af, 9223372036854775808.0f) || _eosio_f32_lt(af, -9223372036854775808.0f)) + eosio_assert(false, "Error, f32.convert_s/i64 overflow"); + if (f32_is_nan(a)) + eosio_assert(false, "Error, f32.convert_s/i64 unrepresentable"); + return f32_to_i64( to_softfloat32(_eosio_f32_trunc( af )), 0, false ); + } + int64_t _eosio_f64_trunc_i64s( double af ) { + float64_t a = to_softfloat64(af); + if (_eosio_f64_ge(af, 9223372036854775808.0) || _eosio_f64_lt(af, -9223372036854775808.0)) + eosio_assert(false, "Error, f64.convert_s/i64 overflow"); + if (f64_is_nan(a)) + eosio_assert(false, "Error, f64.convert_s/i64 unrepresentable"); + + return f64_to_i64( to_softfloat64(_eosio_f64_trunc( af )), 0, false ); + } + uint64_t _eosio_f32_trunc_i64u( float af ) { + float32_t a = to_softfloat32(af); + if (_eosio_f32_ge(af, 18446744073709551616.0f) || _eosio_f32_le(af, -1.0f)) + eosio_assert(false, "Error, f32.convert_u/i64 overflow"); + if (f32_is_nan(a)) + eosio_assert(false, "Error, f32.convert_u/i64 unrepresentable"); + return f32_to_ui64( to_softfloat32(_eosio_f32_trunc( af )), 0, false ); + } + uint64_t _eosio_f64_trunc_i64u( double af ) { + float64_t a = to_softfloat64(af); + if (_eosio_f64_ge(af, 18446744073709551616.0) || _eosio_f64_le(af, -1.0)) + eosio_assert(false, "Error, f64.convert_u/i64 overflow"); + if (f64_is_nan(a)) + eosio_assert(false, "Error, f64.convert_u/i64 unrepresentable"); + return f64_to_ui64( to_softfloat64(_eosio_f64_trunc( af )), 0, false ); + } + float _eosio_i32_to_f32( int32_t a ) { + return from_softfloat32(i32_to_f32( a )); + } + float _eosio_i64_to_f32( int64_t a ) { + return from_softfloat32(i64_to_f32( a )); + } + float _eosio_ui32_to_f32( uint32_t a ) { + return from_softfloat32(ui32_to_f32( a )); + } + float _eosio_ui64_to_f32( uint64_t a ) { + return from_softfloat32(ui64_to_f32( a )); + } + double _eosio_i32_to_f64( int32_t a ) { + return from_softfloat64(i32_to_f64( a )); + } + double _eosio_i64_to_f64( int64_t a ) { + return from_softfloat64(i64_to_f64( a )); + } + double _eosio_ui32_to_f64( uint32_t a ) { + return from_softfloat64(ui32_to_f64( a )); + } + double _eosio_ui64_to_f64( uint64_t a ) { + return from_softfloat64(ui64_to_f64( a )); + } + + void prints_l(const char* cstr, uint32_t len) { + return intrinsics::get().call(cstr, len); + } + + void prints(const char* cstr) { + return intrinsics::get().call(cstr); + } + + void printi(int64_t value) { + return intrinsics::get().call(value); + } + + void printui(uint64_t value) { + return intrinsics::get().call(value); + } + + void printi128(const int128_t* value) { + return intrinsics::get().call(value); + } + + void printui128(const uint128_t* value) { + return intrinsics::get().call(value); + } + + void printsf(float value) { + return intrinsics::get().call(value); + } + + void printdf(double value) { + return intrinsics::get().call(value); + } + + void printqf(const long double* value) { + return intrinsics::get().call(value); + } + + void printn(uint64_t nm) { + return intrinsics::get().call(nm); + } + + void printhex(const void* data, uint32_t len) { + return intrinsics::get().call(data, len); + } + + void* memset ( void* ptr, int value, size_t num ) { + unsigned char v = value; + char* _ptr = (char*)ptr; + for (int i=0; i < num; i++) { + _ptr[i] = v; + } + return (void*)_ptr; + } + void* memcpy ( void* destination, const void* source, size_t num ) { + char* dest = (char*)destination; + char* src = (char*)source; + for (int i=0; i < num; i++) { + dest[i] = src[i]; + } + return (void*)dest; + } + + void* memmove ( void* destination, const void* source, size_t num ) { + char tmp_buf[num]; + char* dest = (char*)destination; + char* src = (char*)source; + for (int i=0; i < num; i++) + tmp_buf[i] = src[i]; + for (int i=0; i < num; i++) + dest[i] = tmp_buf[i]; + return (void*)dest; + } + + void eosio_assert(uint32_t test, const char* msg) { + if (test == 0) { + _prints(msg, eosio::cdt::output_stream_kind::std_err); + _prints_l("\n", 1, eosio::cdt::output_stream_kind::none); + longjmp(*___env_ptr, 1); + } + } + + void eosio_assert_message(uint32_t test, const char* msg, uint32_t len) { + if (test == 0) { + _prints_l(msg, len, eosio::cdt::output_stream_kind::std_err); + _prints_l("\n", 1, eosio::cdt::output_stream_kind::none); + longjmp(*___env_ptr, 1); + } + } + + void eosio_assert_code(uint32_t test, uint64_t code) { + if (test == 0) { + char buff[32]; + snprintf(buff, 32, "%llu", code); + _prints(buff, eosio::cdt::output_stream_kind::std_err); + _prints_l("\n", 1, eosio::cdt::output_stream_kind::none); + longjmp(*___env_ptr, 1); + } + } + +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Winvalid-noreturn" + void abort() { + eosio_assert(false, "abort"); + } +#pragma clang diagnostic pop + + size_t __builtin_wasm_current_memory() { + return (size_t)___heap_ptr; + } + + size_t __builtin_wasm_grow_memory(size_t size) { + if ((___heap_ptr + (size*64*1024)) > (___heap_ptr + 100*1024*1024)) + eosio_assert(false, "__builtin_wasm_grow_memory"); + ___heap_ptr += (size*64*1024); + return (size_t)___heap_ptr; + } +} diff --git a/libraries/native/intrinsics.hpp b/libraries/native/intrinsics.hpp new file mode 100644 index 0000000000..5e43daa764 --- /dev/null +++ b/libraries/native/intrinsics.hpp @@ -0,0 +1,44 @@ +#include +#include "intrinsics_def.hpp" + +#pragma once + +namespace eosio { namespace native { + + class intrinsics { + public: + static intrinsics& get() { + static intrinsics inst; + return inst; + } + + enum intrinsic_name { + INTRINSICS(CREATE_ENUM) + INTRINSICS_SIZE + }; + + INTRINSICS(GENERATE_TYPE_MAPPING) + std::tuple< INTRINSICS(GET_TYPE) std::function > funcs { + INTRINSICS(REGISTER_INTRINSIC) + std::function{[](){}} + }; + + template + auto call(Args... args) -> decltype(std::get(intrinsics::get().funcs)(args...)) { + return std::get(intrinsics::get().funcs)(args...); + } + + template + static void set_intrinsic(F&& func) { + auto& f = std::get(intrinsics::get().funcs); + std::get(intrinsics::get().funcs) = typename std::remove_reference::type {func}; + } + + template + static auto get_intrinsic() + -> typename std::remove_reference(intrinsics::get().funcs))>::type { + return std::get(intrinsics::get().funcs); + } + }; + +}} //ns eosio::native diff --git a/libraries/native/intrinsics_def.hpp b/libraries/native/intrinsics_def.hpp new file mode 100644 index 0000000000..73d406ab4d --- /dev/null +++ b/libraries/native/intrinsics_def.hpp @@ -0,0 +1,177 @@ +#pragma once + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace eosio { namespace native { + template + auto get_args_full(std::index_sequence) { + std::tuple...> tup; + return std::tuple{std::get(tup)...}; + } + + template + auto get_args_full(R(Args...)) { + return get_args_full(std::index_sequence_for{}); + } + + template + auto get_args(R(Args...)) { + return std::tuple...>{}; + } + + template + auto create_function(std::index_sequence) { + return std::function::type ...)>{ + [](typename std::tuple_element::type ...) { + eosio_assert(false, "unsupported intrinsic"); return (R)0; + } + }; + } + +#define INTRINSICS(intrinsic_macro) \ +intrinsic_macro(get_resource_limits) \ +intrinsic_macro(set_resource_limits) \ +intrinsic_macro(set_proposed_producers) \ +intrinsic_macro(get_blockchain_parameters_packed) \ +intrinsic_macro(set_blockchain_parameters_packed) \ +intrinsic_macro(is_privileged) \ +intrinsic_macro(set_privileged) \ +intrinsic_macro(get_active_producers) \ +intrinsic_macro(db_idx64_store) \ +intrinsic_macro(db_idx64_remove) \ +intrinsic_macro(db_idx64_update) \ +intrinsic_macro(db_idx64_find_primary) \ +intrinsic_macro(db_idx64_find_secondary) \ +intrinsic_macro(db_idx64_lowerbound) \ +intrinsic_macro(db_idx64_upperbound) \ +intrinsic_macro(db_idx64_end) \ +intrinsic_macro(db_idx64_next) \ +intrinsic_macro(db_idx64_previous) \ +intrinsic_macro(db_idx128_store) \ +intrinsic_macro(db_idx128_remove) \ +intrinsic_macro(db_idx128_update) \ +intrinsic_macro(db_idx128_find_primary) \ +intrinsic_macro(db_idx128_find_secondary) \ +intrinsic_macro(db_idx128_lowerbound) \ +intrinsic_macro(db_idx128_upperbound) \ +intrinsic_macro(db_idx128_end) \ +intrinsic_macro(db_idx128_next) \ +intrinsic_macro(db_idx128_previous) \ +intrinsic_macro(db_idx256_store) \ +intrinsic_macro(db_idx256_remove) \ +intrinsic_macro(db_idx256_update) \ +intrinsic_macro(db_idx256_find_primary) \ +intrinsic_macro(db_idx256_find_secondary) \ +intrinsic_macro(db_idx256_lowerbound) \ +intrinsic_macro(db_idx256_upperbound) \ +intrinsic_macro(db_idx256_end) \ +intrinsic_macro(db_idx256_next) \ +intrinsic_macro(db_idx256_previous) \ +intrinsic_macro(db_idx_double_store) \ +intrinsic_macro(db_idx_double_remove) \ +intrinsic_macro(db_idx_double_update) \ +intrinsic_macro(db_idx_double_find_primary) \ +intrinsic_macro(db_idx_double_find_secondary) \ +intrinsic_macro(db_idx_double_lowerbound) \ +intrinsic_macro(db_idx_double_upperbound) \ +intrinsic_macro(db_idx_double_end) \ +intrinsic_macro(db_idx_double_next) \ +intrinsic_macro(db_idx_double_previous) \ +intrinsic_macro(db_idx_long_double_store) \ +intrinsic_macro(db_idx_long_double_remove) \ +intrinsic_macro(db_idx_long_double_update) \ +intrinsic_macro(db_idx_long_double_find_primary) \ +intrinsic_macro(db_idx_long_double_find_secondary) \ +intrinsic_macro(db_idx_long_double_lowerbound) \ +intrinsic_macro(db_idx_long_double_upperbound) \ +intrinsic_macro(db_idx_long_double_end) \ +intrinsic_macro(db_idx_long_double_next) \ +intrinsic_macro(db_idx_long_double_previous) \ +intrinsic_macro(db_store_i64) \ +intrinsic_macro(db_update_i64) \ +intrinsic_macro(db_remove_i64) \ +intrinsic_macro(db_get_i64) \ +intrinsic_macro(db_next_i64) \ +intrinsic_macro(db_previous_i64) \ +intrinsic_macro(db_find_i64) \ +intrinsic_macro(db_lowerbound_i64) \ +intrinsic_macro(db_upperbound_i64) \ +intrinsic_macro(db_end_i64) \ +intrinsic_macro(assert_recover_key) \ +intrinsic_macro(recover_key) \ +intrinsic_macro(assert_sha256) \ +intrinsic_macro(assert_sha1) \ +intrinsic_macro(assert_sha512) \ +intrinsic_macro(assert_ripemd160) \ +intrinsic_macro(sha1) \ +intrinsic_macro(sha256) \ +intrinsic_macro(sha512) \ +intrinsic_macro(ripemd160) \ +intrinsic_macro(check_transaction_authorization) \ +intrinsic_macro(check_permission_authorization) \ +intrinsic_macro(get_permission_last_used) \ +intrinsic_macro(get_account_creation_time) \ +intrinsic_macro(current_time) \ +intrinsic_macro(publication_time) \ +intrinsic_macro(read_action_data) \ +intrinsic_macro(action_data_size) \ +intrinsic_macro(current_receiver) \ +intrinsic_macro(require_recipient) \ +intrinsic_macro(require_auth) \ +intrinsic_macro(require_auth2) \ +intrinsic_macro(has_auth) \ +intrinsic_macro(is_account) \ +intrinsic_macro(prints) \ +intrinsic_macro(prints_l) \ +intrinsic_macro(printi) \ +intrinsic_macro(printui) \ +intrinsic_macro(printi128) \ +intrinsic_macro(printui128) \ +intrinsic_macro(printsf) \ +intrinsic_macro(printdf) \ +intrinsic_macro(printqf) \ +intrinsic_macro(printn) \ +intrinsic_macro(printhex) \ +intrinsic_macro(read_transaction) \ +intrinsic_macro(transaction_size) \ +intrinsic_macro(expiration) \ +intrinsic_macro(tapos_block_prefix) \ +intrinsic_macro(tapos_block_num) \ +intrinsic_macro(get_action) \ +intrinsic_macro(send_inline) \ +intrinsic_macro(send_context_free_inline) \ +intrinsic_macro(send_deferred) \ +intrinsic_macro(cancel_deferred) \ +intrinsic_macro(get_context_free_data) + +#define CREATE_ENUM(name) \ + name, + +#define GENERATE_TYPE_MAPPING(name) \ + struct __ ## name ## _types { \ + using deduced_full_ts = decltype(eosio::native::get_args_full(::name)); \ + using deduced_ts = decltype(eosio::native::get_args(::name)); \ + using res_t = decltype(std::apply(::name, deduced_ts{})); \ + static constexpr auto is = std::make_index_sequence::value>(); \ + }; + +#define GET_TYPE(name) \ + decltype(create_function(eosio::native::intrinsics::__ ## name ## _types::is)), + +#define REGISTER_INTRINSIC(name) \ + create_function(eosio::native::intrinsics::__ ## name ## _types::is), + +}} //ns eosio::native diff --git a/libraries/native/macho_crt.s b/libraries/native/macho_crt.s new file mode 100644 index 0000000000..3780416a15 --- /dev/null +++ b/libraries/native/macho_crt.s @@ -0,0 +1,70 @@ +.global start +.global ____putc +.global __mmap +.global _setjmp +.global _longjmp + +start: + mov %rsp, %rbp + mov 0(%rbp), %rdi + lea 8(%rbp), %rsi + call __wrap_main + mov %rax, %rdi + mov $0x2000001, %rax + syscall + +____putc: + dec %rsp + mov %rbx, %r8 + mov %rdi, %rax + mov %al, 0(%rsp) + mov $1, %edi # using stdout + mov %rsp, %rsi # point to the buffer + mov $1, %edx # buffer is only 1 char + mov $0x2000004, %eax # write syscall 0x4 + syscall + inc %rsp + mov %r8, %rbx + ret + +__mmap: + mov $0x20000C5, %eax # mmap syscall 0xC5 or 197 + mov $0, %rdi # don't map + mov $0x6400000, %rsi # size 100Mb + mov $3, %rdx + mov $0x22, %r10 + mov $-1, %r8 + mov $0, %r9 + syscall + ret + +_setjmp: + mov %rbx, 0(%rdi) + mov %rbp, 8(%rdi) + mov %r12, 16(%rdi) + mov %r13, 24(%rdi) + mov %r14, 32(%rdi) + mov %r15, 40(%rdi) + lea 8(%rsp), %rdx + mov %rdx, 48(%rdi) + mov (%rsp), %rdx + mov %rdx, 56(%rdi) + xor %rax, %rax + ret + +_longjmp: + mov %rsi, %rax + test %rax, %rax + jnz 1f + inc %rax +1: + mov 0(%rdi), %rbx + mov 8(%rdi), %rbp + mov 16(%rdi), %r12 + mov 24(%rdi), %r13 + mov 32(%rdi), %r14 + mov 40(%rdi), %r15 + mov 48(%rdi), %rdx + mov %rdx, %rsp + mov 56(%rdi), %rdx + jmp *%rdx diff --git a/libraries/native/softfloat b/libraries/native/softfloat new file mode 160000 index 0000000000..203b6df7de --- /dev/null +++ b/libraries/native/softfloat @@ -0,0 +1 @@ +Subproject commit 203b6df7dedc5bae1b2a7b1b23562335a6344578 diff --git a/libraries/native/tester.hpp b/libraries/native/tester.hpp new file mode 100644 index 0000000000..211a07e6d1 --- /dev/null +++ b/libraries/native/tester.hpp @@ -0,0 +1,122 @@ +#pragma once +#include +#include "crt.hpp" +#include "intrinsics.hpp" +#include +#include + +extern "C" bool ___disable_output; +extern "C" bool ___has_failed; + +inline void silence_output(bool t) { + ___disable_output = t; +} +inline bool has_failed() { + return ___has_failed; +} + +extern "C" void apply(uint64_t, uint64_t, uint64_t); + +template +inline bool expect_assert(bool check, const std::string& li, Pred&& pred, F&& func, Args... args) { + std_err.clear(); + __set_env_test(); + int ret = setjmp(*___env_ptr); + bool disable_out = ___disable_output; + if (ret == 0) { + func(args...); + __reset_env(); + silence_output(false); + if (!check) + eosio_assert(false, std::string("error : expect_assert, no assert {"+li+"}").c_str()); + eosio::print("error : expect_assert, no assert {"+li+"}\n"); + silence_output(disable_out); + return false; + } + __reset_env(); + bool passed = pred(std_err.get()); + std_err.clear(); + silence_output(false); + if (!check) + eosio_assert(passed, std::string("error : expect_assert, wrong assert {"+li+"}").c_str()); + if (!passed) + eosio::print("error : expect_assert, wrong assert {"+li+"}\n"); + silence_output(disable_out); + + return passed; +} + +template +inline bool expect_assert(bool check, const std::string& li, const char (&expected)[N], F&& func, Args... args) { + return expect_assert(check, li, + [&](const std::string& s) { + return std_err.index == N-1 && + memcmp(expected, s.c_str(), N-1) == 0; }, func, args...); +} + +template +inline bool expect_print(bool check, const std::string& li, Pred&& pred, F&& func, Args... args) { + std_out.clear(); + func(args...); + bool passed = pred(std_out.get()); + std_out.clear(); + bool disable_out = ___disable_output; + silence_output(false); + if (!check) + eosio_assert(passed, std::string("error : wrong print message {"+li+"}").c_str()); + if (!passed) + eosio::print("error : wrong print message {"+li+"}\n"); + silence_output(disable_out); + return passed; +} + +template +inline bool expect_print(bool check, const std::string& li, const char (&expected)[N], F&& func, Args... args) { + return expect_print(check, li, + [&](const std::string& s) { + return std_out.index-1 == N-1 && + memcmp(expected, s.c_str(), N-1) == 0; }, func, args...); + +} + +#define CHECK_ASSERT(...) \ + ___has_failed &= expect_assert(true, std::string(__FILE__)+":"+__func__+":"+(std::to_string(__LINE__)), __VA_ARGS__); + +#define REQUIRE_ASSERT(...) \ + expect_assert(false, std::string(__FILE__)+":"+__func__+":"+(std::to_string(__LINE__)), __VA_ARGS__); + +#define CHECK_PRINT(...) \ + ___has_failed &= expect_print(true, std::string(__FILE__)+":"+__func__+":"+(std::to_string(__LINE__)), __VA_ARGS__); + +#define REQUIRE_PRINT(...) \ + expect_print(false, std::string(__FILE__)+":"+__func__+":"+(std::to_string(__LINE__)), __VA_ARGS__); + +#define CHECK_EQUAL(X, Y) \ + if (X != Y) { \ + ___has_failed = true; \ + eosio::print(std::string("CHECK_EQUAL failed (")+#X+" != "+#Y+") {"+__FILE__+":"+std::to_string(__LINE__)+"}\n"); \ + } + +#define REQUIRE_EQUAL(X, Y) \ + eosio_assert(X == Y, std::string(std::string("REQUIRE_EQUAL failed (")+#X+" != "+#Y+") {"+__FILE__+":"+std::to_string(__LINE__)+"}").c_str()); + +#define EOSIO_TEST(X) \ + int X ## _ret = setjmp(*___env_ptr); \ + if ( X ## _ret == 0 ) \ + X(); \ + else { \ + silence_output(false); \ + eosio::print("\033[1;37m", #X, " \033[0;37munit test \033[1;31mfailed\033[0m\n"); \ + ___has_failed = true; \ + silence_output(___disable_output); \ + } + +#define EOSIO_TEST_BEGIN(X) \ + void X() { \ + static constexpr const char* __test_name = #X; + +#define EOSIO_TEST_END \ + silence_output(false); \ + eosio::print("\033[1;37m",__test_name," \033[0;37munit test \033[1;32mpassed\033[0m\n"); \ + silence_output(___disable_output); \ + } diff --git a/ClangExternalProject.txt b/modules/ClangExternalProject.txt similarity index 53% rename from ClangExternalProject.txt rename to modules/ClangExternalProject.txt index 400cd10064..ab7b5f6bae 100644 --- a/ClangExternalProject.txt +++ b/modules/ClangExternalProject.txt @@ -4,7 +4,7 @@ include(GNUInstallDirs) ExternalProject_Add( EosioClang - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/llvm -DCMAKE_BUILD_TYPE=Release -DEOSIO_VER_MAJOR=${VERSION_MAJOR} -DEOSIO_VER_MINOR=${VERSION_MINOR} -DEOSIO_VER_REVISION=${VERSION_PATCH} -DEOSIO_STACK_SIZE=8192 + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}/llvm -DCMAKE_BUILD_TYPE=Release -DEOSIO_VER_MAJOR=${VERSION_MAJOR} -DEOSIO_VER_MINOR=${VERSION_MINOR} -DEOSIO_VER_REVISION=${VERSION_PATCH} -DEOSIO_STACK_SIZE=8192 -DCOMPILER_RT_DEFAULT_TARGET_TRIPLE=wasm32-unknown-unknown-wasm -DCOMPILER_RT_BAREMETAL_BUILD=TRUE -DCOMPILER_RT_EXCLUDE_ATOMIC_BUILTIN=TRUE -DCAN_TARGET_wasm32=ON -DLLVM_BUILD_EXTERNAL_COMPILER_RT=ON -DCOMPILER_RT_BUILD_BUILTINS=ON -DCOMPILER_RT_BUILD_XRAY=OFF -DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_PROFILE=OFF SOURCE_DIR "${CMAKE_SOURCE_DIR}/eosio_llvm" UPDATE_COMMAND "" diff --git a/modules/EosioCDTMacros.cmake.in b/modules/EosioCDTMacros.cmake.in new file mode 100644 index 0000000000..338df87107 --- /dev/null +++ b/modules/EosioCDTMacros.cmake.in @@ -0,0 +1,40 @@ +if (NOT EOSIO_WASM_OLD_BEHAVIOR STREQUAL "On") + macro(add_contract CONTRACT_NAME TARGET) + add_executable( ${TARGET} ${ARGN} ) + target_compile_options( ${TARGET} PUBLIC -abigen ) + get_target_property(BINOUTPUT ${TARGET} BINARY_DIR) + target_compile_options( ${TARGET} PUBLIC -abigen_output=${BINOUTPUT}/${TARGET}.abi ) + target_compile_options( ${TARGET} PUBLIC -contract ${CONTRACT_NAME} ) + endmacro() + macro (target_ricardian_directory TARGET DIR) + target_compile_options( ${TARGET} PUBLIC -R${DIR} ) + file(GLOB contracts ${DIR}/*.contracts.md ${DIR}/*.clauses.md) + add_dependencies( ${TARGET} ${contracts} ) + endmacro() + +else() + macro(add_contract CONTRACT_NAME TARGET) + add_executable( ${TARGET}.wasm ${ARGN} ) + target_compile_options( ${TARGET}.wasm PUBLIC -abigen ) + get_target_property(BINOUTPUT ${TARGET}.wasm BINARY_DIR) + target_compile_options( ${TARGET}.wasm PUBLIC -abigen_output=${BINOUTPUT}/${TARGET}.abi ) + target_compile_options( ${TARGET}.wasm PUBLIC -contract ${CONTRACT_NAME} ) + endmacro() + macro (target_ricardian_directory TARGET DIR) + target_compile_options( ${TARGET}.wasm PUBLIC -R${DIR} ) + file(GLOB contracts ${DIR}/*.contracts.md ${DIR}/*.clauses.md) + add_dependencies( ${TARGET}.wasm ${contracts} ) + endmacro() +endif() + +macro (add_native_library TARGET) + add_library( ${TARGET} ${ARGN} ) + target_compile_options( ${TARGET} PUBLIC -fnative ) +endmacro() + +macro (add_native_executable TARGET) + add_executable( ${TARGET} ${ARGN} ) + target_compile_options( ${TARGET} PUBLIC -fnative ) + set_target_properties( ${TARGET} PROPERTIES LINK_FLAGS "-fnative" SUFFIX "" ) +endmacro() + diff --git a/modules/EosioWasmToolchain.cmake.in b/modules/EosioWasmToolchain.cmake.in index 77714be1f3..acdb8928af 100644 --- a/modules/EosioWasmToolchain.cmake.in +++ b/modules/EosioWasmToolchain.cmake.in @@ -1,43 +1,42 @@ -message(STATUS "Setting up Eosio Wasm Toolchain @VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@ at @CDT_ROOT_DIR@") -set(CMAKE_SYSTEM_NAME Generic) -set(CMAKE_CROSSCOMPILING 1) -set(CMAKE_C_COMPILER_WORKS 1) -set(CMAKE_CXX_COMPILER_WORKS 1) - -set(EOSIO_CDT_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") -set(EOSIO_WASMSDK_VERSION "@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@") - -set(CMAKE_C_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cc" CACHE PATH "cc" FORCE) -set(CMAKE_CXX_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cpp" CACHE PATH "cxx" FORCE) +message(STATUS "Setting up Eosio Wasm Toolchain @VERSION_FULL@ at @CDT_ROOT_DIR@") + +if (NOT EOSIO_WASM_OLD_BEHAVIOR STREQUAL "On") + set(CMAKE_SYSTEM_NAME Generic) + set(CMAKE_SYSTEM_PROCESSOR wasm) + set(CMAKE_CROSSCOMPILING 1) + set(CMAKE_C_COMPILER_WORKS 1) + set(CMAKE_CXX_COMPILER_WORKS 1) +endif() + +set(EOSIO_CDT_VERSION "@VERSION_FULL@") +set(EOSIO_WASMSDK_VERSION "@VERSION_FULL@") + +set(CMAKE_C_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cc") +set(CMAKE_CXX_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cpp") +set(CMAKE_ASM_COMPILER "@CDT_ROOT_DIR@/bin/eosio-cc") set(CMAKE_C_FLAGS " -O3 ") set(CMAKE_CXX_FLAGS " -O3 ") +set(CMAKE_ASM_FLAGS " -fnative -fasm ") set(WASM_LINKER "@CDT_ROOT_DIR@/bin/eosio-ld") set(CMAKE_C_LINK_EXECUTABLE "${WASM_LINKER} -o ") set(CMAKE_CXX_LINK_EXECUTABLE "${WASM_LINKER} -o ") -set(CMAKE_AR "@CDT_ROOT_DIR@/bin/eosio-ar" CACHE PATH "ar" FORCE) -set(CMAKE_RANLIB "@CDT_ROOT_DIR@/bin/eosio-ranlib" CACHE PATH "ranlib" FORCE) -set(ABIGEN "@CDT_ROOT_DIR@/bin/eosio-abigen") +if (NOT EOSIO_WASM_OLD_BEHAVIOR STREQUAL "On") + set(CMAKE_EXECUTABLE_SUFFIX_C ".wasm") + set(CMAKE_EXECUTABLE_SUFFIX_CXX ".wasm") -# hack for CMake on Linux -set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS) -set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) + set(CMAKE_FIND_ROOT_PATH "@CDT_ROOT_DIR@") + set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) + set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) + set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +endif() + +set(ABIGEN "@CDT_ROOT_DIR@/bin/eosio-abigen") # hack for OSX set(CMAKE_OSX_SYSROOT="@SYSROOT_DIR@") set(CMAKE_OSX_DEPLOYMENT_TARGET="") -include_directories( - @CDT_ROOT_DIR@/eosio.cdt/include/libcxx - @CDT_ROOT_DIR@/eosio.cdt/include/libc - @CDT_ROOT_DIR@/eosio.cdt/include/) - -macro(add_contract CONTRACT_NAME TARGET) - add_executable( ${TARGET}.wasm ${ARGN} ) - target_compile_options( ${TARGET}.wasm PUBLIC -abigen ) - get_target_property(BINOUTPUT ${TARGET}.wasm BINARY_DIR) - target_compile_options( ${TARGET}.wasm PUBLIC -abigen_output=${BINOUTPUT}/${TARGET}.abi ) - target_compile_options( ${TARGET}.wasm PUBLIC -contract ${CONTRACT_NAME} ) -endmacro() diff --git a/InstallClang.txt b/modules/InstallCDT.cmake similarity index 79% rename from InstallClang.txt rename to modules/InstallCDT.cmake index b52ee3af56..8c9e09e34b 100644 --- a/InstallClang.txt +++ b/modules/InstallCDT.cmake @@ -33,6 +33,13 @@ macro( eosio_tool_install_and_symlink file symlink ) PERMISSIONS OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) endmacro( eosio_tool_install_and_symlink ) +macro( eosio_libraries_install) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/lib) + execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/include) + set(BIN_DIR ${CMAKE_BINARY_DIR}/EosioWasmLibraries-prefix/src/EosioWasmLibraries-build/) + install(DIRECTORY ${CMAKE_BINARY_DIR}/lib/ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib) + install(DIRECTORY ${CMAKE_BINARY_DIR}/include/ DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +endmacro( eosio_libraries_install ) eosio_clang_install_and_symlink(llvm-ranlib eosio-ranlib) eosio_clang_install_and_symlink(llvm-ar eosio-ar) @@ -45,12 +52,20 @@ eosio_clang_install_and_symlink(llvm-strip eosio-strip) eosio_clang_install(opt) eosio_clang_install(llc) eosio_clang_install(lld) +eosio_clang_install(ld.lld) +eosio_clang_install(ld64.lld) eosio_clang_install(clang-7) eosio_clang_install(wasm-ld) +eosio_tool_install(eosio-pp) +eosio_tool_install(eosio-wast2wasm) +eosio_tool_install(eosio-wasm2wast) eosio_tool_install(eosio-cc) eosio_tool_install(eosio-cpp) eosio_tool_install(eosio-ld) eosio_tool_install(eosio-abigen) eosio_tool_install(eosio-abidiff) +eosio_tool_install(eosio-init) eosio_clang_install(../lib/LLVMEosioApply${CMAKE_SHARED_LIBRARY_SUFFIX}) +eosio_clang_install(../lib/LLVMEosioSoftfloat${CMAKE_SHARED_LIBRARY_SUFFIX}) eosio_clang_install(../lib/eosio_plugin${CMAKE_SHARED_LIBRARY_SUFFIX}) +eosio_libraries_install() diff --git a/modules/LibrariesExternalProject.txt b/modules/LibrariesExternalProject.txt new file mode 100644 index 0000000000..cb1c3aef25 --- /dev/null +++ b/modules/LibrariesExternalProject.txt @@ -0,0 +1,15 @@ +include(ExternalProject) +find_package(Git REQUIRED) +include(GNUInstallDirs) + +ExternalProject_Add( + EosioWasmLibraries + SOURCE_DIR "${CMAKE_SOURCE_DIR}/libraries" + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake -DEOSIO_CDT_BIN=${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/ -DBASE_BINARY_DIR=${CMAKE_BINARY_DIR} -D__APPLE=${APPLE} + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 + DEPENDS EosioTools +) diff --git a/modules/TestsExternalProject.txt b/modules/TestsExternalProject.txt new file mode 100644 index 0000000000..6fbb45cabc --- /dev/null +++ b/modules/TestsExternalProject.txt @@ -0,0 +1,15 @@ +include(ExternalProject) +find_package(Git REQUIRED) +include(GNUInstallDirs) + +ExternalProject_Add( + EosioWasmTests + SOURCE_DIR "${CMAKE_SOURCE_DIR}/tests/unit" + CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake -DEOSIO_CDT_BIN=${CMAKE_BINARY_DIR}/lib/cmake/eosio.cdt/ -DBASE_BINARY_DIR=${CMAKE_BINARY_DIR} -D__APPLE=${APPLE} + UPDATE_COMMAND "" + PATCH_COMMAND "" + TEST_COMMAND "" + INSTALL_COMMAND "" + BUILD_ALWAYS 1 + DEPENDS EosioWasmLibraries +) diff --git a/ToolsExternalProject.txt b/modules/ToolsExternalProject.txt similarity index 59% rename from ToolsExternalProject.txt rename to modules/ToolsExternalProject.txt index 12b4b20ad5..9e3861d3c9 100644 --- a/ToolsExternalProject.txt +++ b/modules/ToolsExternalProject.txt @@ -5,7 +5,7 @@ include(GNUInstallDirs) set(LLVM_BINDIR ${CMAKE_BINARY_DIR}/EosioClang-prefix/src/EosioClang-build) ExternalProject_Add( EosioTools - CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=Release -DVERSION_MAJOR=${VERSION_MAJOR} -DVERSION_MINOR=${VERSION_MINOR} -DVERSION_PATCH=${VERSION_PATCH} -DLLVM_SRCDIR=${CMAKE_SOURCE_DIR}/eosio_llvm -DLLVM_BINDIR=${LLVM_BINDIR} -DLLVM_DIR=${LLVM_BINDIR}/lib/cmake/llvm -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DCMAKE_BUILD_TYPE=Release -DVERSION_FULL=${VERSION_FULL} -DLLVM_SRCDIR=${CMAKE_SOURCE_DIR}/eosio_llvm -DLLVM_BINDIR=${LLVM_BINDIR} -DLLVM_DIR=${LLVM_BINDIR}/lib/cmake/llvm -DCMAKE_INSTALL_BINDIR=${CMAKE_INSTALL_BINDIR} SOURCE_DIR "${CMAKE_SOURCE_DIR}/tools" UPDATE_COMMAND "" diff --git a/modules/eosio.cdt-config.cmake b/modules/eosio.cdt-config.cmake index 6205d5252c..48e0c21eb7 100644 --- a/modules/eosio.cdt-config.cmake +++ b/modules/eosio.cdt-config.cmake @@ -1,8 +1,15 @@ if(EOSIO_CDT_ROOT STREQUAL "" OR NOT EOSIO_CDT_ROOT) set(EOSIO_CDT_ROOT "@CDT_ROOT_DIR@") endif() + list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt) -include(EosioWasmToolchain) +if (NOT EOSIO_WASM_OLD_BEHAVIOR STREQUAL "Off") + set(EOSIO_WASM_OLD_BEHAVIOR "On") + include(EosioWasmToolchain) +endif() + +include(EosioCDTMacros) + function(EXTRACT_MAJOR_MINOR_FROM_VERSION version success major minor) string(REGEX REPLACE "^([0-9]+)\\..+$" "\\1" _major "${version}") diff --git a/scripts/eosio_build_amazon.sh b/scripts/eosio_build_amazon.sh index b43a37e9ae..8b6ba4763d 100644 --- a/scripts/eosio_build_amazon.sh +++ b/scripts/eosio_build_amazon.sh @@ -64,19 +64,18 @@ for (( i=0; i<${#DEP_ARRAY[@]}; i++ )); do - pkg=$( sudo "$YUM" info "${DEP_ARRAY[$i+1]}" 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' ) - which "${DEP_ARRAY[$i+1]}" > /dev/null - installed=$? - if [ "$pkg" != "installed" ] && [ "$installed" -gt "1" ]; then - DEP=$DEP" ${DEP_ARRAY[$i+1]} " - DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i+1]}\\n\\t" - printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i+1]}" + pkg=$( sudo "$YUM" info "${DEP_ARRAY[$i]}" 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' ) + + if [ "$pkg" != "installed" ]; then + DEP=$DEP" ${DEP_ARRAY[$i]} " + DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i]}\\n\\t" + printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i]}" (( COUNT++ )) else - printf "\\tPackage %d %s found.\\n" $(( i+1 )) "${DEP_ARRAY[$i+1]}" + printf "\\tPackage %s found.\\n" "${DEP_ARRAY[$i]}" continue fi - done + done if [ "${COUNT}" -gt 1 ]; then printf "\\n\\tThe following dependencies are required to install EOSIO.\\n" diff --git a/scripts/eosio_build_centos.sh b/scripts/eosio_build_centos.sh index 2fe39f8d16..a9e264bb94 100644 --- a/scripts/eosio_build_centos.sh +++ b/scripts/eosio_build_centos.sh @@ -136,16 +136,14 @@ for (( i=0; i<${#DEP_ARRAY[@]}; i++ )); do - pkg=$( sudo "${YUM}" info "${DEP_ARRAY[$i+1]}" 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' ) - which "${DEP_ARRAY[$i+1]}" > /dev/null - installed=$? - if [ "$pkg" != "installed" ] && [ "$installed" -gt "1" ]; then - DEP=$DEP" ${DEP_ARRAY[$i+1]} " - DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i+1]}\\n\\t" - printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i+1]}" + pkg=$( sudo "${YUM}" info "${DEP_ARRAY[$i]}" 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' ) + if [ "$pkg" != "installed" ]; then + DEP=$DEP" ${DEP_ARRAY[$i]} " + DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i]}\\n\\t" + printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i]}" (( COUNT++ )) else - printf "\\tPackage %d %s found.\\n" $(( i+1 )) "${DEP_ARRAY[$i+1]}" + printf "\\tPackage %s found.\\n" "${DEP_ARRAY[$i]}" continue fi done diff --git a/scripts/eosio_build_fedora.sh b/scripts/eosio_build_fedora.sh index 34aedec217..051d0b2a33 100644 --- a/scripts/eosio_build_fedora.sh +++ b/scripts/eosio_build_fedora.sh @@ -69,17 +69,15 @@ for (( i=0; i<${#DEP_ARRAY[@]}; i++ )); do - pkg=$( sudo "${YUM}" info "${DEP_ARRAY[$i+1]}" 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' ) - pkg=$( dpkg -s "${DEP_ARRAY[$i+1]}" 2>/dev/null | grep Status | tr -s ' ' | cut -d\ -f4 ) - which "${DEP_ARRAY[$i+1]}" > /dev/null - installed=$? - if [ "$pkg" != "@System" ] && [ "$installed" -gt "1" ]; then - DEP=$DEP" ${DEP_ARRAY[$i+1]} " - DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i+1]}\\n\\t" - printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i+1]}" + pkg=$( sudo "${YUM}" info "${DEP_ARRAY[$i]}" 2>/dev/null | grep Repo | tr -s ' ' | cut -d: -f2 | sed 's/ //g' ) + + if [ "$pkg" != "@System" ]; then + DEP=$DEP" ${DEP_ARRAY[$i]} " + DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i]}\\n\\t" + printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i]}" (( COUNT++ )) else - printf "\\tPackage %d %s found.\\n" $(( i+1 )) "${DEP_ARRAY[$i+1]}" + printf "\\tPackage %s found.\\n" "${DEP_ARRAY[$i]}" continue fi done diff --git a/scripts/eosio_build_ubuntu.sh b/scripts/eosio_build_ubuntu.sh index 8da0e5a74e..7cc9ffd2c7 100644 --- a/scripts/eosio_build_ubuntu.sh +++ b/scripts/eosio_build_ubuntu.sh @@ -68,19 +68,17 @@ for (( i=0; i<${#DEP_ARRAY[@]}; i++ )); do - pkg=$( dpkg -s "${DEP_ARRAY[$i+1]}" 2>/dev/null | grep Status | tr -s ' ' | cut -d\ -f4 ) - which "${DEP_ARRAY[$i+1]}" > /dev/null - installed=$? - if [ -z "$pkg" ] && [ "$installed" -gt "1" ]; then - DEP=$DEP" ${DEP_ARRAY[$i+1]} " - DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i+1]}\\n\\t" - printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i+1]}" + pkg=$( dpkg -s "${DEP_ARRAY[$i]}" 2>/dev/null | grep Status | tr -s ' ' | cut -d\ -f4 ) + if [ -z "$pkg" ]; then + DEP=$DEP" ${DEP_ARRAY[$i]} " + DISPLAY="${DISPLAY}${COUNT}. ${DEP_ARRAY[$i]}\\n\\t" + printf "\\tPackage %s ${bldred} NOT ${txtrst} found.\\n" "${DEP_ARRAY[$i]}" (( COUNT++ )) else - printf "\\tPackage %d %s found.\\n" $(( i+1 )) "${DEP_ARRAY[$i+1]}" + printf "\\tPackage %s found.\\n" "${DEP_ARRAY[$i]}" continue fi - done + done if [ "${COUNT}" -gt 1 ]; then printf "\\n\\tThe following dependencies are required to install EOSIO.\\n" diff --git a/scripts/generate_bottle.sh b/scripts/generate_bottle.sh index 4feac525f9..f94fe1711a 100644 --- a/scripts/generate_bottle.sh +++ b/scripts/generate_bottle.sh @@ -14,6 +14,8 @@ else MAC_VERSION="high_sierra" fi +NAME="${PROJECT}-${VERSION}.${MAC_VERSION}.bottle.tar.gz" + mkdir -p ${PROJECT}/${VERSION}/opt/eosio_cdt/lib/cmake PREFIX="${PROJECT}/${VERSION}" diff --git a/scripts/generate_deb.sh b/scripts/generate_deb.sh index 5ca57978cb..f505323ffb 100644 --- a/scripts/generate_deb.sh +++ b/scripts/generate_deb.sh @@ -1,14 +1,21 @@ #! /bin/bash -NAME="${PROJECT}-${VERSION}.x86_64" PREFIX="usr" SPREFIX=${PREFIX} SUBPREFIX="opt/${PROJECT}/${VERSION}" SSUBPREFIX="opt\/${PROJECT}\/${VERSION}" +RELEASE="${VERSION_SUFFIX}" + +# default release to "1" if there is no suffix +if [[ -z $RELEASE ]]; then + RELEASE="1" +fi + +NAME="${PROJECT}_${VERSION_NO_SUFFIX}-${RELEASE}_amd64" mkdir -p ${PROJECT}/DEBIAN echo "Package: ${PROJECT} -Version: ${VERSION} +Version: ${VERSION_NO_SUFFIX}-${RELEASE} Section: devel Priority: optional Architecture: amd64 diff --git a/scripts/generate_package.sh.in b/scripts/generate_package.sh.in index 909598cf5d..ee673c26bd 100644 --- a/scripts/generate_package.sh.in +++ b/scripts/generate_package.sh.in @@ -2,7 +2,9 @@ VARIANT=$1 -VERSION="@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@" +VERSION_NO_SUFFIX="@VERSION_MAJOR@.@VERSION_MINOR@.@VERSION_PATCH@" +VERSION_SUFFIX="@VERSION_SUFFIX@" +VERSION="@VERSION_FULL@" BUILD_DIR="@CMAKE_BINARY_DIR@" @@ -13,6 +15,8 @@ URL="@URL@" EMAIL="@EMAIL@" export BUILD_DIR +export VERSION_NO_SUFFIX +export VERSION_SUFFIX export VERSION export VENDOR export PROJECT diff --git a/scripts/generate_rpm.sh b/scripts/generate_rpm.sh index bc5923b25a..2567dffc6b 100644 --- a/scripts/generate_rpm.sh +++ b/scripts/generate_rpm.sh @@ -1,10 +1,17 @@ #! /bin/bash -NAME="${PROJECT}-${VERSION}.x86_64" PREFIX="usr" SPREFIX=${PREFIX} SUBPREFIX="opt/${PROJECT}/${VERSION}" SSUBPREFIX="opt\/${PROJECT}\/${VERSION}" +RELEASE="${VERSION_SUFFIX}" + +# default release to "1" if there is no suffix +if [[ -z $RELEASE ]]; then + RELEASE="1" +fi + +NAME="${PROJECT}-${VERSION_NO_SUFFIX}-${RELEASE}" export PREFIX export SUBPREFIX @@ -13,7 +20,7 @@ export SSUBPREFIX bash generate_tarball.sh ${NAME}.tar.gz -RPMBUILD=`realpath ~/rpmbuild/BUILDROOT/${NAME}-0.x86_64` +RPMBUILD=`realpath ~/rpmbuild/BUILDROOT/${NAME}.x86_64` mkdir -p ${RPMBUILD} FILES=$(tar -xvzf ${NAME}.tar.gz -C ${RPMBUILD}) PFILES="" @@ -26,14 +33,14 @@ echo -e ${PFILES} &> ~/rpmbuild/BUILD/filenames.txt mkdir -p ${PROJECT} echo -e "Name: ${PROJECT} -Version: ${VERSION}.x86_64 +Version: ${VERSION_NO_SUFFIX} License: MIT Vendor: ${VENDOR} Source: ${URL} URL: ${URL} Packager: ${VENDOR} <${EMAIL}> Summary: ${DESC} -Release: 0 +Release: ${RELEASE} %description ${DESC} %files -f filenames.txt" &> ${PROJECT}.spec diff --git a/scripts/generate_tarball.sh b/scripts/generate_tarball.sh index cdc9849399..2c414b541d 100644 --- a/scripts/generate_tarball.sh +++ b/scripts/generate_tarball.sh @@ -18,6 +18,7 @@ cp -R ${BUILD_DIR}/bin/* ${CDT_PREFIX}/bin cp -R ${BUILD_DIR}/licenses/* ${CDT_PREFIX}/licenses # install cmake modules +sed "s/_PREFIX_/\/${SPREFIX}/g" ${BUILD_DIR}/modules/EosioCDTMacrosPackage.cmake &> ${CDT_PREFIX}/lib/cmake/${PROJECT}/EosioCDTMacros.cmake sed "s/_PREFIX_/\/${SPREFIX}/g" ${BUILD_DIR}/modules/EosioWasmToolchainPackage.cmake &> ${CDT_PREFIX}/lib/cmake/${PROJECT}/EosioWasmToolchain.cmake sed "s/_PREFIX_/\/${SPREFIX}\/${SSUBPREFIX}/g" ${BUILD_DIR}/modules/${PROJECT}-config.cmake.package &> ${CDT_PREFIX}/lib/cmake/${PROJECT}/${PROJECT}-config.cmake @@ -37,14 +38,23 @@ cp ${BUILD_DIR}/lib/*.a ${CDT_PREFIX}/lib pushd ${PREFIX}/lib/cmake/${PROJECT} &> /dev/null ln -sf ../../../${SUBPREFIX}/lib/cmake/${PROJECT}/${PROJECT}-config.cmake ${PROJECT}-config.cmake ln -sf ../../../${SUBPREFIX}/lib/cmake/${PROJECT}/EosioWasmToolchain.cmake EosioWasmToolchain.cmake +ln -sf ../../../${SUBPREFIX}/lib/cmake/${PROJECT}/EosioCDTMacros.cmake EosioCDTMacros.cmake popd &> /dev/null -pushd ${PREFIX}/bin &> /dev/null -for f in `find ${BUILD_DIR}/bin -name "eosio-*"`; do - bn=$(basename $f) - ln -sf ../${SUBPREFIX}/bin/$bn $bn -done -popd &> /dev/null +create_symlink() { + pushd ${PREFIX}/bin &> /dev/null + ln -sf ../${SUBPREFIX}/bin/$1 $2 + popd &> /dev/null +} + +create_symlink "eosio-cc eosio-cc" +create_symlink "eosio-cpp eosio-cpp" +create_symlink "eosio-ld eosio-ld" +create_symlink "eosio-pp eosio-pp" +create_symlink "eosio-init eosio-init" +create_symlink "eosio-abigen eosio-abigen" +create_symlink "eosio-wasm2wast eosio-wasm2wast" +create_symlink "eosio-wast2wasm eosio-wast2wasm" tar -cvzf $NAME ./${PREFIX}/* rm -r ${PREFIX} diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000000..fe31e26526 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,5 @@ +set(unit_test_dir ${CMAKE_BINARY_DIR}/EosioWasmTests-prefix/src/EosioWasmTests-build) + +add_test(name_tests ${unit_test_dir}/name_tests) +add_test(system_tests ${unit_test_dir}/system_tests) +add_test(print_tests ${unit_test_dir}/print_tests) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt new file mode 100644 index 0000000000..9f5cfa9494 --- /dev/null +++ b/tests/unit/CMakeLists.txt @@ -0,0 +1,9 @@ +list(APPEND CMAKE_MODULE_PATH ${EOSIO_CDT_BIN}) +include(EosioCDTMacros) + +add_native_executable(name_tests name_tests.cpp) +add_native_executable(system_tests system_tests.cpp) +add_native_executable(print_tests print_tests.cpp) +add_dependencies(name_tests EosioTools) +add_dependencies(system_tests EosioTools) +add_dependencies(print_tests EosioTools) diff --git a/tests/unit/name_tests.cpp b/tests/unit/name_tests.cpp new file mode 100644 index 0000000000..15b8290f17 --- /dev/null +++ b/tests/unit/name_tests.cpp @@ -0,0 +1,47 @@ +#include +#include + +using namespace eosio::native; + +EOSIO_TEST_BEGIN(name_test) + //silence_output(true); + eosio_assert( eosio::name{"azaa34"}.value == "azaa34"_n.value, "eosio::name != azaa34" ); + eosio_assert( eosio::name{0}.value == 0, "eosio::name != 0" ); + eosio_assert( eosio::name{"aa11"}.value == "aa11"_n.value, "eosio::name != aa11" ); + eosio_assert( eosio::name{"z11"}.value == "z11"_n.value, "eosio::name != z11" ); + + auto testa = []() { + eosio_assert( eosio::name{"bb"}.value == "aa"_n.value, "bb != aa" ); + }; + REQUIRE_ASSERT("bb != aa", testa); + REQUIRE_ASSERT("character is not in allowed character set for names", + ([]() { + eosio::name{"!"}.value; + })); + silence_output(false); +EOSIO_TEST_END + +EOSIO_TEST_BEGIN(is_account_test) + intrinsics::set_intrinsic([](uint64_t a) { + if (a == 3) + return true; + if (a == 4) + return true; + return false; + }); + + CHECK_ASSERT("is not an account", ([]() { + eosio_assert(is_account(5), "is not an account"); + })); + CHECK_EQUAL(is_account(3), true); + CHECK_EQUAL(is_account(4), true); + CHECK_EQUAL(is_account(6), true); + REQUIRE_EQUAL(is_account(7), true); + +EOSIO_TEST_END + +int main(int argc, char** argv) { + EOSIO_TEST(name_test); + EOSIO_TEST(is_account_test); + return has_failed(); +} diff --git a/tests/unit/print_tests.cpp b/tests/unit/print_tests.cpp new file mode 100644 index 0000000000..b69faf27ec --- /dev/null +++ b/tests/unit/print_tests.cpp @@ -0,0 +1,30 @@ +#include +#include + +using namespace eosio::native; + +EOSIO_TEST_BEGIN(print_test) + silence_output(true); + CHECK_PRINT("27", [](){ eosio::print((uint8_t)27); }); + CHECK_PRINT("34", [](){ eosio::print((int)34); }); + CHECK_PRINT([](std::string s){return s[0] == 'a';}, [](){ eosio::print((char)'a'); }); + CHECK_PRINT([](std::string s){return s[0] == 'b';}, [](){ eosio::print((int8_t)'b'); }); + CHECK_PRINT("202", [](){ eosio::print((unsigned int)202); }); + CHECK_PRINT("-202", [](){ eosio::print((int)-202); }); + CHECK_PRINT("707", [](){ eosio::print((unsigned long)707); }); + CHECK_PRINT("-707", [](){ eosio::print((long)-707); }); + CHECK_PRINT("909", [](){ eosio::print((unsigned long long)909); }); + CHECK_PRINT("-909", [](){ eosio::print((long long)-909); }); + CHECK_PRINT("404", [](){ eosio::print((uint32_t)404); }); + CHECK_PRINT("-404", [](){ eosio::print((int32_t)-404); }); + CHECK_PRINT("404000000", [](){ eosio::print((uint64_t)404000000); }); + CHECK_PRINT("-404000000", [](){ eosio::print((int64_t)-404000000); }); + CHECK_PRINT("0x0066000000000000", [](){ eosio::print((uint128_t)102); }); + CHECK_PRINT("0xffffff9affffffffffffffffffffffff", [](){ eosio::print((int128_t)-102); }); + silence_output(false); +EOSIO_TEST_END + +int main(int argc, char** argv) { + EOSIO_TEST(print_test); + return has_failed(); +} diff --git a/tests/unit/system_tests.cpp b/tests/unit/system_tests.cpp new file mode 100644 index 0000000000..a842444487 --- /dev/null +++ b/tests/unit/system_tests.cpp @@ -0,0 +1,33 @@ +#include +#include + +using namespace eosio::native; + +EOSIO_TEST_BEGIN(system_test) + silence_output(true); + auto test_check1 = [](bool b) { eosio::check(b, "asserted"); }; + test_check1(true); + CHECK_ASSERT("asserted", test_check1, false); + + auto test_check2 = [](bool b) { std::string s="asserted"; eosio::check(b, s); }; + test_check2(true); + REQUIRE_ASSERT("asserted", test_check2, false); + + auto test_check3 = [](bool b) { eosio::check(b, "asserted with more text", 8); }; + test_check3(true); + REQUIRE_ASSERT("asserted", test_check3, false); + + auto test_check4 = [](bool b) { std::string s="asserted with more text"; eosio::check(b, s, 8); }; + test_check4(true); + REQUIRE_ASSERT("asserted", test_check4, false); + + auto test_check5 = [](bool b) { eosio::check(b, 13); }; + test_check5(true); + REQUIRE_ASSERT("13", test_check5, false); + silence_output(false); +EOSIO_TEST_END + +int main(int argc, char** argv) { + EOSIO_TEST(system_test); + return has_failed(); +} diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index d4f0b4a9fd..2e02a3a990 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -3,6 +3,13 @@ find_package(LLVM REQUIRED CONFIG) message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}") message(STATUS "Using LLVMConfig.cmake in: ${LLVM_DIR}") +find_program(CCACHE_FOUND ccache) +if (CCACHE_FOUND) + message(STATUS "Using ccache") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +endif() + include_directories(${LLVM_INCLUDE_DIRS}) include_directories(${LLVM_SRCDIR}/tools/clang/include) include_directories(${LLVM_BINDIR}/tools/clang/include) @@ -17,9 +24,7 @@ macro (add_tool name) set(LLVM_LINK_COMPONENTS support) include_directories(include) - - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp.in ${CMAKE_BINARY_DIR}/${name}.cpp) - + add_executable(${name} ${CMAKE_BINARY_DIR}/${name}.cpp) set_property(TARGET ${name} PROPERTY CXX_STANDARD 14) target_compile_options(${name} PRIVATE -fexceptions -fno-rtti) @@ -65,6 +70,7 @@ add_subdirectory(abigen) add_subdirectory(abidiff) add_subdirectory(cc) add_subdirectory(ld) - +add_subdirectory(init) +add_subdirectory(external) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/compiler_options.hpp.in ${CMAKE_BINARY_DIR}/compiler_options.hpp) diff --git a/tools/abidiff/CMakeLists.txt b/tools/abidiff/CMakeLists.txt index 6f9d82a353..07fa7cc3ac 100644 --- a/tools/abidiff/CMakeLists.txt +++ b/tools/abidiff/CMakeLists.txt @@ -1 +1,3 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosio-abidiff.cpp.in ${CMAKE_BINARY_DIR}/eosio-abidiff.cpp) + add_tool(eosio-abidiff) diff --git a/tools/abidiff/eosio-abidiff.cpp.in b/tools/abidiff/eosio-abidiff.cpp.in index e6d24bc9db..2ab40bee1f 100644 --- a/tools/abidiff/eosio-abidiff.cpp.in +++ b/tools/abidiff/eosio-abidiff.cpp.in @@ -75,7 +75,7 @@ class abidiff { } void diff_version() { - if (abi_1["version"] == abi_2["version"]) { + if (get_version(abi_1) != get_version(abi_2)) { std::cout << "< version\n\t"; std::cout << abi_1["version"] << "\n"; std::cout << "> version\n\t"; @@ -87,7 +87,14 @@ class abidiff { std::cout << direction << " struct\n"; std::cout << pretty_print(abi["structs"].at(index)) << "\n"; } - + + ojson get_base_type(const ojson& abi, const ojson& type) { + for (int i=0; i < abi["types"].size(); i++) { + if (abi["types"].at(i)["new_type_name"] == type) + return abi["types"].at(i)["new_type_name"]; + } + return type; + } void find_structs(const ojson& abi1, const ojson& abi2, char direction) { for ( int i=0; i < abi1["structs"].size(); i++ ) { bool found = false; @@ -97,11 +104,15 @@ class abidiff { break; if (abi1["structs"].at(i)["base"] != abi2["structs"].at(j)["base"]) break; - - for (int k=0; k < abi1["structs"].at(i)["fields"].size(); k++) - if (abi1["structs"].at(i)["fields"].at(k) != abi2["structs"].at(j)["fields"].at(k)) + + bool _found = false; + for (int k=0; k < abi1["structs"].at(i)["fields"].size(); k++) { + if (abi1["structs"].at(i)["fields"].at(k)["name"] != abi2["structs"].at(j)["fields"].at(k)["name"] || + abi1["structs"].at(i)["fields"].at(k)["type"] != abi2["structs"].at(j)["fields"].at(k)["type"]) break; - found = true; + _found = true; + } + found = _found; } } if (!found) @@ -258,7 +269,7 @@ class abidiff { int main(int argc, const char **argv) { cl::SetVersionPrinter([](llvm::raw_ostream& os) { - os << "eosio-abidiff version " << ${VERSION_MAJOR} << "." << ${VERSION_MINOR} << "." << ${VERSION_PATCH} << "\n"; + os << "eosio-abidiff version " << "${VERSION_FULL}" << "\n"; }); cl::OptionCategory cat("eosio-abidiff", "generates an abi from C++ project input"); diff --git a/tools/abigen/CMakeLists.txt b/tools/abigen/CMakeLists.txt index 7927adba7e..d5001a6af0 100644 --- a/tools/abigen/CMakeLists.txt +++ b/tools/abigen/CMakeLists.txt @@ -1 +1,3 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosio-abigen.cpp.in ${CMAKE_BINARY_DIR}/eosio-abigen.cpp) + add_tool(eosio-abigen) diff --git a/tools/abigen/eosio-abigen.cpp.in b/tools/abigen/eosio-abigen.cpp.in index 4a5c277dba..97444abeeb 100644 --- a/tools/abigen/eosio-abigen.cpp.in +++ b/tools/abigen/eosio-abigen.cpp.in @@ -152,6 +152,8 @@ class abigen : public generation_utils { pair.name = get_type(type); pair.fields.push_back( {"first", translate_type(get_template_argument(type).getAsType())} ); pair.fields.push_back( {"second", translate_type(get_template_argument(type, 1).getAsType())} ); + add_type(get_template_argument(type).getAsType()); + add_type(get_template_argument(type, 1).getAsType()); _abi.structs.insert(pair); } @@ -166,6 +168,8 @@ class abigen : public generation_utils { kv.name = name.substr(0, name.length() - 2); kv.fields.push_back( {"key", translate_type(get_template_argument(type).getAsType())} ); kv.fields.push_back( {"value", translate_type(get_template_argument(type, 1).getAsType())} ); + add_type(get_template_argument(type).getAsType()); + add_type(get_template_argument(type, 1).getAsType()); _abi.structs.insert(kv); } @@ -265,7 +269,7 @@ class abigen : public generation_utils { if (!is_builtin_type(translate_type(type))) { if (is_aliasing(type)) add_typedef(type); - else if (is_template_specialization(type, {"vector", "set", "optional", "binary_extension", "ignore"})) { + else if (is_template_specialization(type, {"vector", "set", "deque", "list", "optional", "binary_extension", "ignore"})) { add_type(get_template_argument(type).getAsType()); } else if (is_template_specialization(type, {"map"})) @@ -524,7 +528,7 @@ class EosioRecordMatcher : public MatchFinder::MatchCallback { int main(int argc, const char **argv) { cl::SetVersionPrinter([](llvm::raw_ostream& os) { - os << "eosio-abigen version " << ${VERSION_MAJOR} << "." << ${VERSION_MINOR} << "." << ${VERSION_PATCH} << "\n"; + os << "eosio-abigen version " << "${VERSION_FULL}" << "\n"; }); cl::OptionCategory cat("eosio-abigen", "generates an abi from C++ project input"); diff --git a/tools/cc/CMakeLists.txt b/tools/cc/CMakeLists.txt index 173881be99..afb9265f7d 100644 --- a/tools/cc/CMakeLists.txt +++ b/tools/cc/CMakeLists.txt @@ -1,2 +1,6 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosio-cc.cpp.in ${CMAKE_BINARY_DIR}/eosio-cc.cpp) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosio-cpp.cpp.in ${CMAKE_BINARY_DIR}/eosio-cpp.cpp) + add_tool(eosio-cc) add_tool(eosio-cpp) diff --git a/tools/cc/eosio-cc.cpp.in b/tools/cc/eosio-cc.cpp.in index 4be81d6ec9..a4bc4b5286 100644 --- a/tools/cc/eosio-cc.cpp.in +++ b/tools/cc/eosio-cc.cpp.in @@ -18,8 +18,16 @@ using namespace llvm; int main(int argc, const char **argv) { + // fix to show version info without having to have any other arguments + for (int i=0; i < argc; i++) { + if (argv[i] == std::string("-v")) { + eosio::cdt::environment::exec_subprogram("clang-7", {"-v"}); + return 0; + } + } + cl::SetVersionPrinter([](llvm::raw_ostream& os) { - os << COMPILER_NAME << " version " << ${VERSION_MAJOR} << "." << ${VERSION_MINOR} << "." << ${VERSION_PATCH} << "\n"; + os << COMPILER_NAME << " version " << "${VERSION_FULL}" << "\n"; }); cl::ParseCommandLineOptions(argc, argv, std::string(COMPILER_NAME)+" (Eosio C -> WebAssembly compiler)"); Options opts = CreateOptions(); diff --git a/tools/cc/eosio-cpp.cpp.in b/tools/cc/eosio-cpp.cpp.in index aed0cc2a35..599bef6693 100644 --- a/tools/cc/eosio-cpp.cpp.in +++ b/tools/cc/eosio-cpp.cpp.in @@ -18,8 +18,16 @@ using namespace llvm; int main(int argc, const char **argv) { + // fix to show version info without having to have any other arguments + for (int i=0; i < argc; i++) { + if (argv[i] == std::string("-v")) { + eosio::cdt::environment::exec_subprogram("clang-7", {"-v"}); + return 0; + } + } + cl::SetVersionPrinter([](llvm::raw_ostream& os) { - os << COMPILER_NAME << " version " << ${VERSION_MAJOR} << "." << ${VERSION_MINOR} << "." << ${VERSION_PATCH} << "\n"; + os << COMPILER_NAME << " version " << "${VERSION_FULL}" << "\n"; }); cl::ParseCommandLineOptions(argc, argv, std::string(COMPILER_NAME)+" (Eosio C++ -> WebAssembly compiler)"); Options opts = CreateOptions(); diff --git a/external/CMakeLists.txt b/tools/external/CMakeLists.txt similarity index 100% rename from external/CMakeLists.txt rename to tools/external/CMakeLists.txt diff --git a/external/wabt/.appveyor.yml b/tools/external/wabt/.appveyor.yml similarity index 100% rename from external/wabt/.appveyor.yml rename to tools/external/wabt/.appveyor.yml diff --git a/external/wabt/.clang-format b/tools/external/wabt/.clang-format similarity index 100% rename from external/wabt/.clang-format rename to tools/external/wabt/.clang-format diff --git a/external/wabt/.gitmodules b/tools/external/wabt/.gitmodules similarity index 100% rename from external/wabt/.gitmodules rename to tools/external/wabt/.gitmodules diff --git a/external/wabt/.style.yapf b/tools/external/wabt/.style.yapf similarity index 100% rename from external/wabt/.style.yapf rename to tools/external/wabt/.style.yapf diff --git a/external/wabt/.travis.yml b/tools/external/wabt/.travis.yml similarity index 100% rename from external/wabt/.travis.yml rename to tools/external/wabt/.travis.yml diff --git a/external/wabt/CMakeLists.txt b/tools/external/wabt/CMakeLists.txt similarity index 98% rename from external/wabt/CMakeLists.txt rename to tools/external/wabt/CMakeLists.txt index 62784f966f..12aa8c9aae 100644 --- a/external/wabt/CMakeLists.txt +++ b/tools/external/wabt/CMakeLists.txt @@ -400,9 +400,9 @@ if (NOT EMSCRIPTEN) # install #install(TARGETS ${WABT_EXECUTABLES} DESTINATION bin) - install(TARGETS eosio-wast2wasm DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) - install(TARGETS eosio-wasm2wast DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) - install(TARGETS eosio-pp DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) + #install(TARGETS eosio-wast2wasm DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) + #install(TARGETS eosio-wasm2wast DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) + #install(TARGETS eosio-pp DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) else () # emscripten stuff diff --git a/external/wabt/Contributing.md b/tools/external/wabt/Contributing.md similarity index 100% rename from external/wabt/Contributing.md rename to tools/external/wabt/Contributing.md diff --git a/external/wabt/LICENSE b/tools/external/wabt/LICENSE similarity index 100% rename from external/wabt/LICENSE rename to tools/external/wabt/LICENSE diff --git a/external/wabt/Makefile b/tools/external/wabt/Makefile similarity index 100% rename from external/wabt/Makefile rename to tools/external/wabt/Makefile diff --git a/external/wabt/README.md b/tools/external/wabt/README.md similarity index 100% rename from external/wabt/README.md rename to tools/external/wabt/README.md diff --git a/external/wabt/cmake/FindRE2C.cmake b/tools/external/wabt/cmake/FindRE2C.cmake similarity index 100% rename from external/wabt/cmake/FindRE2C.cmake rename to tools/external/wabt/cmake/FindRE2C.cmake diff --git a/external/wabt/cmake/README.md b/tools/external/wabt/cmake/README.md similarity index 100% rename from external/wabt/cmake/README.md rename to tools/external/wabt/cmake/README.md diff --git a/external/wabt/demo/custom.css b/tools/external/wabt/demo/custom.css similarity index 100% rename from external/wabt/demo/custom.css rename to tools/external/wabt/demo/custom.css diff --git a/external/wabt/demo/index.html b/tools/external/wabt/demo/index.html similarity index 100% rename from external/wabt/demo/index.html rename to tools/external/wabt/demo/index.html diff --git a/external/wabt/demo/libwabt.js b/tools/external/wabt/demo/libwabt.js similarity index 100% rename from external/wabt/demo/libwabt.js rename to tools/external/wabt/demo/libwabt.js diff --git a/external/wabt/demo/third_party/codemirror/LICENSE b/tools/external/wabt/demo/third_party/codemirror/LICENSE similarity index 100% rename from external/wabt/demo/third_party/codemirror/LICENSE rename to tools/external/wabt/demo/third_party/codemirror/LICENSE diff --git a/external/wabt/demo/third_party/codemirror/codemirror.css b/tools/external/wabt/demo/third_party/codemirror/codemirror.css similarity index 100% rename from external/wabt/demo/third_party/codemirror/codemirror.css rename to tools/external/wabt/demo/third_party/codemirror/codemirror.css diff --git a/external/wabt/demo/third_party/codemirror/codemirror.js b/tools/external/wabt/demo/third_party/codemirror/codemirror.js similarity index 100% rename from external/wabt/demo/third_party/codemirror/codemirror.js rename to tools/external/wabt/demo/third_party/codemirror/codemirror.js diff --git a/external/wabt/demo/third_party/codemirror/javascript.js b/tools/external/wabt/demo/third_party/codemirror/javascript.js similarity index 100% rename from external/wabt/demo/third_party/codemirror/javascript.js rename to tools/external/wabt/demo/third_party/codemirror/javascript.js diff --git a/external/wabt/demo/third_party/codemirror/simple-mode.js b/tools/external/wabt/demo/third_party/codemirror/simple-mode.js similarity index 100% rename from external/wabt/demo/third_party/codemirror/simple-mode.js rename to tools/external/wabt/demo/third_party/codemirror/simple-mode.js diff --git a/external/wabt/demo/third_party/split/horizontal.png b/tools/external/wabt/demo/third_party/split/horizontal.png similarity index 100% rename from external/wabt/demo/third_party/split/horizontal.png rename to tools/external/wabt/demo/third_party/split/horizontal.png diff --git a/external/wabt/demo/third_party/split/split.min.js b/tools/external/wabt/demo/third_party/split/split.min.js similarity index 100% rename from external/wabt/demo/third_party/split/split.min.js rename to tools/external/wabt/demo/third_party/split/split.min.js diff --git a/external/wabt/demo/third_party/split/vertical.png b/tools/external/wabt/demo/third_party/split/vertical.png similarity index 100% rename from external/wabt/demo/third_party/split/vertical.png rename to tools/external/wabt/demo/third_party/split/vertical.png diff --git a/external/wabt/demo/wasm2wat/demo.js b/tools/external/wabt/demo/wasm2wat/demo.js similarity index 100% rename from external/wabt/demo/wasm2wat/demo.js rename to tools/external/wabt/demo/wasm2wat/demo.js diff --git a/external/wabt/demo/wasm2wat/examples.js b/tools/external/wabt/demo/wasm2wat/examples.js similarity index 100% rename from external/wabt/demo/wasm2wat/examples.js rename to tools/external/wabt/demo/wasm2wat/examples.js diff --git a/external/wabt/demo/wasm2wat/index.html b/tools/external/wabt/demo/wasm2wat/index.html similarity index 100% rename from external/wabt/demo/wasm2wat/index.html rename to tools/external/wabt/demo/wasm2wat/index.html diff --git a/external/wabt/demo/wast-mode.js b/tools/external/wabt/demo/wast-mode.js similarity index 100% rename from external/wabt/demo/wast-mode.js rename to tools/external/wabt/demo/wast-mode.js diff --git a/external/wabt/demo/wat2wasm/demo.js b/tools/external/wabt/demo/wat2wasm/demo.js similarity index 100% rename from external/wabt/demo/wat2wasm/demo.js rename to tools/external/wabt/demo/wat2wasm/demo.js diff --git a/external/wabt/demo/wat2wasm/examples.js b/tools/external/wabt/demo/wat2wasm/examples.js similarity index 100% rename from external/wabt/demo/wat2wasm/examples.js rename to tools/external/wabt/demo/wat2wasm/examples.js diff --git a/external/wabt/demo/wat2wasm/index.html b/tools/external/wabt/demo/wat2wasm/index.html similarity index 100% rename from external/wabt/demo/wat2wasm/index.html rename to tools/external/wabt/demo/wat2wasm/index.html diff --git a/external/wabt/fuzz-in/wasm/stuff.wasm b/tools/external/wabt/fuzz-in/wasm/stuff.wasm similarity index 100% rename from external/wabt/fuzz-in/wasm/stuff.wasm rename to tools/external/wabt/fuzz-in/wasm/stuff.wasm diff --git a/external/wabt/fuzz-in/wast.dict b/tools/external/wabt/fuzz-in/wast.dict similarity index 100% rename from external/wabt/fuzz-in/wast.dict rename to tools/external/wabt/fuzz-in/wast.dict diff --git a/external/wabt/fuzz-in/wast/basic.txt b/tools/external/wabt/fuzz-in/wast/basic.txt similarity index 100% rename from external/wabt/fuzz-in/wast/basic.txt rename to tools/external/wabt/fuzz-in/wast/basic.txt diff --git a/external/wabt/scripts/coverage.sh b/tools/external/wabt/scripts/coverage.sh similarity index 100% rename from external/wabt/scripts/coverage.sh rename to tools/external/wabt/scripts/coverage.sh diff --git a/external/wabt/scripts/fuzz-wasm2wat.sh b/tools/external/wabt/scripts/fuzz-wasm2wat.sh similarity index 100% rename from external/wabt/scripts/fuzz-wasm2wat.sh rename to tools/external/wabt/scripts/fuzz-wasm2wat.sh diff --git a/external/wabt/scripts/fuzz-wat2wasm.sh b/tools/external/wabt/scripts/fuzz-wat2wasm.sh similarity index 100% rename from external/wabt/scripts/fuzz-wat2wasm.sh rename to tools/external/wabt/scripts/fuzz-wat2wasm.sh diff --git a/external/wabt/scripts/gen-emscripten-exported-json.py b/tools/external/wabt/scripts/gen-emscripten-exported-json.py similarity index 100% rename from external/wabt/scripts/gen-emscripten-exported-json.py rename to tools/external/wabt/scripts/gen-emscripten-exported-json.py diff --git a/external/wabt/scripts/travis-before-install.sh b/tools/external/wabt/scripts/travis-before-install.sh similarity index 100% rename from external/wabt/scripts/travis-before-install.sh rename to tools/external/wabt/scripts/travis-before-install.sh diff --git a/external/wabt/scripts/travis-build.sh b/tools/external/wabt/scripts/travis-build.sh similarity index 100% rename from external/wabt/scripts/travis-build.sh rename to tools/external/wabt/scripts/travis-build.sh diff --git a/external/wabt/scripts/travis-common.sh b/tools/external/wabt/scripts/travis-common.sh similarity index 100% rename from external/wabt/scripts/travis-common.sh rename to tools/external/wabt/scripts/travis-common.sh diff --git a/external/wabt/scripts/travis-emcc.sh b/tools/external/wabt/scripts/travis-emcc.sh similarity index 100% rename from external/wabt/scripts/travis-emcc.sh rename to tools/external/wabt/scripts/travis-emcc.sh diff --git a/external/wabt/scripts/travis-test.sh b/tools/external/wabt/scripts/travis-test.sh similarity index 100% rename from external/wabt/scripts/travis-test.sh rename to tools/external/wabt/scripts/travis-test.sh diff --git a/external/wabt/src/apply-names.cc b/tools/external/wabt/src/apply-names.cc similarity index 100% rename from external/wabt/src/apply-names.cc rename to tools/external/wabt/src/apply-names.cc diff --git a/external/wabt/src/apply-names.h b/tools/external/wabt/src/apply-names.h similarity index 100% rename from external/wabt/src/apply-names.h rename to tools/external/wabt/src/apply-names.h diff --git a/external/wabt/src/binary-reader-interp.cc b/tools/external/wabt/src/binary-reader-interp.cc similarity index 100% rename from external/wabt/src/binary-reader-interp.cc rename to tools/external/wabt/src/binary-reader-interp.cc diff --git a/external/wabt/src/binary-reader-interp.h b/tools/external/wabt/src/binary-reader-interp.h similarity index 100% rename from external/wabt/src/binary-reader-interp.h rename to tools/external/wabt/src/binary-reader-interp.h diff --git a/external/wabt/src/binary-reader-ir.cc b/tools/external/wabt/src/binary-reader-ir.cc similarity index 100% rename from external/wabt/src/binary-reader-ir.cc rename to tools/external/wabt/src/binary-reader-ir.cc diff --git a/external/wabt/src/binary-reader-ir.h b/tools/external/wabt/src/binary-reader-ir.h similarity index 100% rename from external/wabt/src/binary-reader-ir.h rename to tools/external/wabt/src/binary-reader-ir.h diff --git a/external/wabt/src/binary-reader-logging.cc b/tools/external/wabt/src/binary-reader-logging.cc similarity index 100% rename from external/wabt/src/binary-reader-logging.cc rename to tools/external/wabt/src/binary-reader-logging.cc diff --git a/external/wabt/src/binary-reader-logging.h b/tools/external/wabt/src/binary-reader-logging.h similarity index 100% rename from external/wabt/src/binary-reader-logging.h rename to tools/external/wabt/src/binary-reader-logging.h diff --git a/external/wabt/src/binary-reader-nop.h b/tools/external/wabt/src/binary-reader-nop.h similarity index 100% rename from external/wabt/src/binary-reader-nop.h rename to tools/external/wabt/src/binary-reader-nop.h diff --git a/external/wabt/src/binary-reader-objdump.cc b/tools/external/wabt/src/binary-reader-objdump.cc similarity index 100% rename from external/wabt/src/binary-reader-objdump.cc rename to tools/external/wabt/src/binary-reader-objdump.cc diff --git a/external/wabt/src/binary-reader-objdump.h b/tools/external/wabt/src/binary-reader-objdump.h similarity index 100% rename from external/wabt/src/binary-reader-objdump.h rename to tools/external/wabt/src/binary-reader-objdump.h diff --git a/external/wabt/src/binary-reader-opcnt.cc b/tools/external/wabt/src/binary-reader-opcnt.cc similarity index 100% rename from external/wabt/src/binary-reader-opcnt.cc rename to tools/external/wabt/src/binary-reader-opcnt.cc diff --git a/external/wabt/src/binary-reader-opcnt.h b/tools/external/wabt/src/binary-reader-opcnt.h similarity index 100% rename from external/wabt/src/binary-reader-opcnt.h rename to tools/external/wabt/src/binary-reader-opcnt.h diff --git a/external/wabt/src/binary-reader.cc b/tools/external/wabt/src/binary-reader.cc similarity index 100% rename from external/wabt/src/binary-reader.cc rename to tools/external/wabt/src/binary-reader.cc diff --git a/external/wabt/src/binary-reader.h b/tools/external/wabt/src/binary-reader.h similarity index 100% rename from external/wabt/src/binary-reader.h rename to tools/external/wabt/src/binary-reader.h diff --git a/external/wabt/src/binary-writer-spec.cc b/tools/external/wabt/src/binary-writer-spec.cc similarity index 100% rename from external/wabt/src/binary-writer-spec.cc rename to tools/external/wabt/src/binary-writer-spec.cc diff --git a/external/wabt/src/binary-writer-spec.h b/tools/external/wabt/src/binary-writer-spec.h similarity index 100% rename from external/wabt/src/binary-writer-spec.h rename to tools/external/wabt/src/binary-writer-spec.h diff --git a/external/wabt/src/binary-writer.cc b/tools/external/wabt/src/binary-writer.cc similarity index 100% rename from external/wabt/src/binary-writer.cc rename to tools/external/wabt/src/binary-writer.cc diff --git a/external/wabt/src/binary-writer.h b/tools/external/wabt/src/binary-writer.h similarity index 100% rename from external/wabt/src/binary-writer.h rename to tools/external/wabt/src/binary-writer.h diff --git a/external/wabt/src/binary.cc b/tools/external/wabt/src/binary.cc similarity index 100% rename from external/wabt/src/binary.cc rename to tools/external/wabt/src/binary.cc diff --git a/external/wabt/src/binary.h b/tools/external/wabt/src/binary.h similarity index 100% rename from external/wabt/src/binary.h rename to tools/external/wabt/src/binary.h diff --git a/external/wabt/src/binding-hash.cc b/tools/external/wabt/src/binding-hash.cc similarity index 100% rename from external/wabt/src/binding-hash.cc rename to tools/external/wabt/src/binding-hash.cc diff --git a/external/wabt/src/binding-hash.h b/tools/external/wabt/src/binding-hash.h similarity index 100% rename from external/wabt/src/binding-hash.h rename to tools/external/wabt/src/binding-hash.h diff --git a/external/wabt/src/c-writer.cc b/tools/external/wabt/src/c-writer.cc similarity index 100% rename from external/wabt/src/c-writer.cc rename to tools/external/wabt/src/c-writer.cc diff --git a/external/wabt/src/c-writer.h b/tools/external/wabt/src/c-writer.h similarity index 100% rename from external/wabt/src/c-writer.h rename to tools/external/wabt/src/c-writer.h diff --git a/external/wabt/src/cast.h b/tools/external/wabt/src/cast.h similarity index 100% rename from external/wabt/src/cast.h rename to tools/external/wabt/src/cast.h diff --git a/external/wabt/src/circular-array.h b/tools/external/wabt/src/circular-array.h similarity index 100% rename from external/wabt/src/circular-array.h rename to tools/external/wabt/src/circular-array.h diff --git a/external/wabt/src/color.cc b/tools/external/wabt/src/color.cc similarity index 100% rename from external/wabt/src/color.cc rename to tools/external/wabt/src/color.cc diff --git a/external/wabt/src/color.h b/tools/external/wabt/src/color.h similarity index 100% rename from external/wabt/src/color.h rename to tools/external/wabt/src/color.h diff --git a/external/wabt/src/common.cc b/tools/external/wabt/src/common.cc similarity index 100% rename from external/wabt/src/common.cc rename to tools/external/wabt/src/common.cc diff --git a/external/wabt/src/common.h b/tools/external/wabt/src/common.h similarity index 100% rename from external/wabt/src/common.h rename to tools/external/wabt/src/common.h diff --git a/external/wabt/src/config.cc b/tools/external/wabt/src/config.cc similarity index 100% rename from external/wabt/src/config.cc rename to tools/external/wabt/src/config.cc diff --git a/external/wabt/src/config.h.in b/tools/external/wabt/src/config.h.in similarity index 100% rename from external/wabt/src/config.h.in rename to tools/external/wabt/src/config.h.in diff --git a/external/wabt/src/emscripten-exported.json b/tools/external/wabt/src/emscripten-exported.json similarity index 100% rename from external/wabt/src/emscripten-exported.json rename to tools/external/wabt/src/emscripten-exported.json diff --git a/external/wabt/src/emscripten-helpers.cc b/tools/external/wabt/src/emscripten-helpers.cc similarity index 100% rename from external/wabt/src/emscripten-helpers.cc rename to tools/external/wabt/src/emscripten-helpers.cc diff --git a/external/wabt/src/error-handler.cc b/tools/external/wabt/src/error-handler.cc similarity index 99% rename from external/wabt/src/error-handler.cc rename to tools/external/wabt/src/error-handler.cc index 49e8d81846..9d4a79429a 100644 --- a/external/wabt/src/error-handler.cc +++ b/tools/external/wabt/src/error-handler.cc @@ -117,8 +117,7 @@ void ErrorHandlerFile::PrintErrorHeader() { case PrintHeader::Once: print_header_ = PrintHeader::Never; - // Fallthrough. - + break; case PrintHeader::Always: fprintf(file_, "%s:\n", header_.c_str()); break; diff --git a/external/wabt/src/error-handler.h b/tools/external/wabt/src/error-handler.h similarity index 100% rename from external/wabt/src/error-handler.h rename to tools/external/wabt/src/error-handler.h diff --git a/external/wabt/src/expr-visitor.cc b/tools/external/wabt/src/expr-visitor.cc similarity index 100% rename from external/wabt/src/expr-visitor.cc rename to tools/external/wabt/src/expr-visitor.cc diff --git a/external/wabt/src/expr-visitor.h b/tools/external/wabt/src/expr-visitor.h similarity index 100% rename from external/wabt/src/expr-visitor.h rename to tools/external/wabt/src/expr-visitor.h diff --git a/external/wabt/src/feature.cc b/tools/external/wabt/src/feature.cc similarity index 100% rename from external/wabt/src/feature.cc rename to tools/external/wabt/src/feature.cc diff --git a/external/wabt/src/feature.def b/tools/external/wabt/src/feature.def similarity index 100% rename from external/wabt/src/feature.def rename to tools/external/wabt/src/feature.def diff --git a/external/wabt/src/feature.h b/tools/external/wabt/src/feature.h similarity index 100% rename from external/wabt/src/feature.h rename to tools/external/wabt/src/feature.h diff --git a/external/wabt/src/filenames.cc b/tools/external/wabt/src/filenames.cc similarity index 100% rename from external/wabt/src/filenames.cc rename to tools/external/wabt/src/filenames.cc diff --git a/external/wabt/src/filenames.h b/tools/external/wabt/src/filenames.h similarity index 100% rename from external/wabt/src/filenames.h rename to tools/external/wabt/src/filenames.h diff --git a/external/wabt/src/generate-names.cc b/tools/external/wabt/src/generate-names.cc similarity index 100% rename from external/wabt/src/generate-names.cc rename to tools/external/wabt/src/generate-names.cc diff --git a/external/wabt/src/generate-names.h b/tools/external/wabt/src/generate-names.h similarity index 100% rename from external/wabt/src/generate-names.h rename to tools/external/wabt/src/generate-names.h diff --git a/external/wabt/src/hash-util.cc b/tools/external/wabt/src/hash-util.cc similarity index 100% rename from external/wabt/src/hash-util.cc rename to tools/external/wabt/src/hash-util.cc diff --git a/external/wabt/src/hash-util.h b/tools/external/wabt/src/hash-util.h similarity index 100% rename from external/wabt/src/hash-util.h rename to tools/external/wabt/src/hash-util.h diff --git a/external/wabt/src/interp.cc b/tools/external/wabt/src/interp.cc similarity index 100% rename from external/wabt/src/interp.cc rename to tools/external/wabt/src/interp.cc diff --git a/external/wabt/src/interp.h b/tools/external/wabt/src/interp.h similarity index 100% rename from external/wabt/src/interp.h rename to tools/external/wabt/src/interp.h diff --git a/external/wabt/src/intrusive-list.h b/tools/external/wabt/src/intrusive-list.h similarity index 100% rename from external/wabt/src/intrusive-list.h rename to tools/external/wabt/src/intrusive-list.h diff --git a/external/wabt/src/ir.cc b/tools/external/wabt/src/ir.cc similarity index 100% rename from external/wabt/src/ir.cc rename to tools/external/wabt/src/ir.cc diff --git a/external/wabt/src/ir.h b/tools/external/wabt/src/ir.h similarity index 100% rename from external/wabt/src/ir.h rename to tools/external/wabt/src/ir.h diff --git a/external/wabt/src/leb128.cc b/tools/external/wabt/src/leb128.cc similarity index 100% rename from external/wabt/src/leb128.cc rename to tools/external/wabt/src/leb128.cc diff --git a/external/wabt/src/leb128.h b/tools/external/wabt/src/leb128.h similarity index 100% rename from external/wabt/src/leb128.h rename to tools/external/wabt/src/leb128.h diff --git a/external/wabt/src/lexer-source-line-finder.cc b/tools/external/wabt/src/lexer-source-line-finder.cc similarity index 100% rename from external/wabt/src/lexer-source-line-finder.cc rename to tools/external/wabt/src/lexer-source-line-finder.cc diff --git a/external/wabt/src/lexer-source-line-finder.h b/tools/external/wabt/src/lexer-source-line-finder.h similarity index 100% rename from external/wabt/src/lexer-source-line-finder.h rename to tools/external/wabt/src/lexer-source-line-finder.h diff --git a/external/wabt/src/lexer-source.cc b/tools/external/wabt/src/lexer-source.cc similarity index 100% rename from external/wabt/src/lexer-source.cc rename to tools/external/wabt/src/lexer-source.cc diff --git a/external/wabt/src/lexer-source.h b/tools/external/wabt/src/lexer-source.h similarity index 100% rename from external/wabt/src/lexer-source.h rename to tools/external/wabt/src/lexer-source.h diff --git a/external/wabt/src/literal.cc b/tools/external/wabt/src/literal.cc similarity index 100% rename from external/wabt/src/literal.cc rename to tools/external/wabt/src/literal.cc diff --git a/external/wabt/src/literal.h b/tools/external/wabt/src/literal.h similarity index 100% rename from external/wabt/src/literal.h rename to tools/external/wabt/src/literal.h diff --git a/external/wabt/src/make-unique.h b/tools/external/wabt/src/make-unique.h similarity index 100% rename from external/wabt/src/make-unique.h rename to tools/external/wabt/src/make-unique.h diff --git a/external/wabt/src/opcode.cc b/tools/external/wabt/src/opcode.cc similarity index 100% rename from external/wabt/src/opcode.cc rename to tools/external/wabt/src/opcode.cc diff --git a/external/wabt/src/opcode.def b/tools/external/wabt/src/opcode.def similarity index 100% rename from external/wabt/src/opcode.def rename to tools/external/wabt/src/opcode.def diff --git a/external/wabt/src/opcode.h b/tools/external/wabt/src/opcode.h similarity index 100% rename from external/wabt/src/opcode.h rename to tools/external/wabt/src/opcode.h diff --git a/external/wabt/src/option-parser.cc b/tools/external/wabt/src/option-parser.cc similarity index 100% rename from external/wabt/src/option-parser.cc rename to tools/external/wabt/src/option-parser.cc diff --git a/external/wabt/src/option-parser.h b/tools/external/wabt/src/option-parser.h similarity index 100% rename from external/wabt/src/option-parser.h rename to tools/external/wabt/src/option-parser.h diff --git a/external/wabt/src/prebuilt/wasm2c.include.c b/tools/external/wabt/src/prebuilt/wasm2c.include.c similarity index 100% rename from external/wabt/src/prebuilt/wasm2c.include.c rename to tools/external/wabt/src/prebuilt/wasm2c.include.c diff --git a/external/wabt/src/prebuilt/wasm2c.include.h b/tools/external/wabt/src/prebuilt/wasm2c.include.h similarity index 100% rename from external/wabt/src/prebuilt/wasm2c.include.h rename to tools/external/wabt/src/prebuilt/wasm2c.include.h diff --git a/external/wabt/src/prebuilt/wast-lexer-gen.cc b/tools/external/wabt/src/prebuilt/wast-lexer-gen.cc similarity index 100% rename from external/wabt/src/prebuilt/wast-lexer-gen.cc rename to tools/external/wabt/src/prebuilt/wast-lexer-gen.cc diff --git a/external/wabt/src/range.h b/tools/external/wabt/src/range.h similarity index 100% rename from external/wabt/src/range.h rename to tools/external/wabt/src/range.h diff --git a/external/wabt/src/resolve-names.cc b/tools/external/wabt/src/resolve-names.cc similarity index 100% rename from external/wabt/src/resolve-names.cc rename to tools/external/wabt/src/resolve-names.cc diff --git a/external/wabt/src/resolve-names.h b/tools/external/wabt/src/resolve-names.h similarity index 100% rename from external/wabt/src/resolve-names.h rename to tools/external/wabt/src/resolve-names.h diff --git a/external/wabt/src/result.h b/tools/external/wabt/src/result.h similarity index 100% rename from external/wabt/src/result.h rename to tools/external/wabt/src/result.h diff --git a/external/wabt/src/stream.cc b/tools/external/wabt/src/stream.cc similarity index 100% rename from external/wabt/src/stream.cc rename to tools/external/wabt/src/stream.cc diff --git a/external/wabt/src/stream.h b/tools/external/wabt/src/stream.h similarity index 100% rename from external/wabt/src/stream.h rename to tools/external/wabt/src/stream.h diff --git a/external/wabt/src/string-view.cc b/tools/external/wabt/src/string-view.cc similarity index 100% rename from external/wabt/src/string-view.cc rename to tools/external/wabt/src/string-view.cc diff --git a/external/wabt/src/string-view.h b/tools/external/wabt/src/string-view.h similarity index 100% rename from external/wabt/src/string-view.h rename to tools/external/wabt/src/string-view.h diff --git a/external/wabt/src/test-circular-array.cc b/tools/external/wabt/src/test-circular-array.cc similarity index 100% rename from external/wabt/src/test-circular-array.cc rename to tools/external/wabt/src/test-circular-array.cc diff --git a/external/wabt/src/test-filenames.cc b/tools/external/wabt/src/test-filenames.cc similarity index 100% rename from external/wabt/src/test-filenames.cc rename to tools/external/wabt/src/test-filenames.cc diff --git a/external/wabt/src/test-hexfloat.cc b/tools/external/wabt/src/test-hexfloat.cc similarity index 100% rename from external/wabt/src/test-hexfloat.cc rename to tools/external/wabt/src/test-hexfloat.cc diff --git a/external/wabt/src/test-intrusive-list.cc b/tools/external/wabt/src/test-intrusive-list.cc similarity index 100% rename from external/wabt/src/test-intrusive-list.cc rename to tools/external/wabt/src/test-intrusive-list.cc diff --git a/external/wabt/src/test-literal.cc b/tools/external/wabt/src/test-literal.cc similarity index 100% rename from external/wabt/src/test-literal.cc rename to tools/external/wabt/src/test-literal.cc diff --git a/external/wabt/src/test-string-view.cc b/tools/external/wabt/src/test-string-view.cc similarity index 100% rename from external/wabt/src/test-string-view.cc rename to tools/external/wabt/src/test-string-view.cc diff --git a/external/wabt/src/test-utf8.cc b/tools/external/wabt/src/test-utf8.cc similarity index 100% rename from external/wabt/src/test-utf8.cc rename to tools/external/wabt/src/test-utf8.cc diff --git a/external/wabt/src/test-wast-parser.cc b/tools/external/wabt/src/test-wast-parser.cc similarity index 100% rename from external/wabt/src/test-wast-parser.cc rename to tools/external/wabt/src/test-wast-parser.cc diff --git a/external/wabt/src/token.cc b/tools/external/wabt/src/token.cc similarity index 100% rename from external/wabt/src/token.cc rename to tools/external/wabt/src/token.cc diff --git a/external/wabt/src/token.def b/tools/external/wabt/src/token.def similarity index 100% rename from external/wabt/src/token.def rename to tools/external/wabt/src/token.def diff --git a/external/wabt/src/token.h b/tools/external/wabt/src/token.h similarity index 100% rename from external/wabt/src/token.h rename to tools/external/wabt/src/token.h diff --git a/external/wabt/src/tools/postpass.cc b/tools/external/wabt/src/tools/postpass.cc similarity index 100% rename from external/wabt/src/tools/postpass.cc rename to tools/external/wabt/src/tools/postpass.cc diff --git a/external/wabt/src/tools/spectest-interp.cc b/tools/external/wabt/src/tools/spectest-interp.cc similarity index 100% rename from external/wabt/src/tools/spectest-interp.cc rename to tools/external/wabt/src/tools/spectest-interp.cc diff --git a/external/wabt/src/tools/stripbss.cc b/tools/external/wabt/src/tools/stripbss.cc similarity index 100% rename from external/wabt/src/tools/stripbss.cc rename to tools/external/wabt/src/tools/stripbss.cc diff --git a/external/wabt/src/tools/wasm-interp.cc b/tools/external/wabt/src/tools/wasm-interp.cc similarity index 100% rename from external/wabt/src/tools/wasm-interp.cc rename to tools/external/wabt/src/tools/wasm-interp.cc diff --git a/external/wabt/src/tools/wasm-objdump.cc b/tools/external/wabt/src/tools/wasm-objdump.cc similarity index 100% rename from external/wabt/src/tools/wasm-objdump.cc rename to tools/external/wabt/src/tools/wasm-objdump.cc diff --git a/external/wabt/src/tools/wasm-opcodecnt.cc b/tools/external/wabt/src/tools/wasm-opcodecnt.cc similarity index 100% rename from external/wabt/src/tools/wasm-opcodecnt.cc rename to tools/external/wabt/src/tools/wasm-opcodecnt.cc diff --git a/external/wabt/src/tools/wasm-validate.cc b/tools/external/wabt/src/tools/wasm-validate.cc similarity index 100% rename from external/wabt/src/tools/wasm-validate.cc rename to tools/external/wabt/src/tools/wasm-validate.cc diff --git a/external/wabt/src/tools/wasm2c.cc b/tools/external/wabt/src/tools/wasm2c.cc similarity index 100% rename from external/wabt/src/tools/wasm2c.cc rename to tools/external/wabt/src/tools/wasm2c.cc diff --git a/external/wabt/src/tools/wasm2wat.cc b/tools/external/wabt/src/tools/wasm2wat.cc similarity index 100% rename from external/wabt/src/tools/wasm2wat.cc rename to tools/external/wabt/src/tools/wasm2wat.cc diff --git a/external/wabt/src/tools/wast2json.cc b/tools/external/wabt/src/tools/wast2json.cc similarity index 100% rename from external/wabt/src/tools/wast2json.cc rename to tools/external/wabt/src/tools/wast2json.cc diff --git a/external/wabt/src/tools/wat-desugar.cc b/tools/external/wabt/src/tools/wat-desugar.cc similarity index 100% rename from external/wabt/src/tools/wat-desugar.cc rename to tools/external/wabt/src/tools/wat-desugar.cc diff --git a/external/wabt/src/tools/wat2wasm.cc b/tools/external/wabt/src/tools/wat2wasm.cc similarity index 100% rename from external/wabt/src/tools/wat2wasm.cc rename to tools/external/wabt/src/tools/wat2wasm.cc diff --git a/external/wabt/src/tracing.cc b/tools/external/wabt/src/tracing.cc similarity index 100% rename from external/wabt/src/tracing.cc rename to tools/external/wabt/src/tracing.cc diff --git a/external/wabt/src/tracing.h b/tools/external/wabt/src/tracing.h similarity index 100% rename from external/wabt/src/tracing.h rename to tools/external/wabt/src/tracing.h diff --git a/external/wabt/src/type-checker.cc b/tools/external/wabt/src/type-checker.cc similarity index 100% rename from external/wabt/src/type-checker.cc rename to tools/external/wabt/src/type-checker.cc diff --git a/external/wabt/src/type-checker.h b/tools/external/wabt/src/type-checker.h similarity index 100% rename from external/wabt/src/type-checker.h rename to tools/external/wabt/src/type-checker.h diff --git a/external/wabt/src/utf8.cc b/tools/external/wabt/src/utf8.cc similarity index 100% rename from external/wabt/src/utf8.cc rename to tools/external/wabt/src/utf8.cc diff --git a/external/wabt/src/utf8.h b/tools/external/wabt/src/utf8.h similarity index 100% rename from external/wabt/src/utf8.h rename to tools/external/wabt/src/utf8.h diff --git a/external/wabt/src/validator.cc b/tools/external/wabt/src/validator.cc similarity index 100% rename from external/wabt/src/validator.cc rename to tools/external/wabt/src/validator.cc diff --git a/external/wabt/src/validator.h b/tools/external/wabt/src/validator.h similarity index 100% rename from external/wabt/src/validator.h rename to tools/external/wabt/src/validator.h diff --git a/external/wabt/src/wabt.post.js b/tools/external/wabt/src/wabt.post.js similarity index 100% rename from external/wabt/src/wabt.post.js rename to tools/external/wabt/src/wabt.post.js diff --git a/external/wabt/src/wasm2c.c.tmpl b/tools/external/wabt/src/wasm2c.c.tmpl similarity index 100% rename from external/wabt/src/wasm2c.c.tmpl rename to tools/external/wabt/src/wasm2c.c.tmpl diff --git a/external/wabt/src/wasm2c.h.tmpl b/tools/external/wabt/src/wasm2c.h.tmpl similarity index 100% rename from external/wabt/src/wasm2c.h.tmpl rename to tools/external/wabt/src/wasm2c.h.tmpl diff --git a/external/wabt/src/wasm2c_tmpl.py b/tools/external/wabt/src/wasm2c_tmpl.py similarity index 100% rename from external/wabt/src/wasm2c_tmpl.py rename to tools/external/wabt/src/wasm2c_tmpl.py diff --git a/external/wabt/src/wast-lexer.cc b/tools/external/wabt/src/wast-lexer.cc similarity index 100% rename from external/wabt/src/wast-lexer.cc rename to tools/external/wabt/src/wast-lexer.cc diff --git a/external/wabt/src/wast-lexer.h b/tools/external/wabt/src/wast-lexer.h similarity index 100% rename from external/wabt/src/wast-lexer.h rename to tools/external/wabt/src/wast-lexer.h diff --git a/external/wabt/src/wast-parser-lexer-shared.cc b/tools/external/wabt/src/wast-parser-lexer-shared.cc similarity index 100% rename from external/wabt/src/wast-parser-lexer-shared.cc rename to tools/external/wabt/src/wast-parser-lexer-shared.cc diff --git a/external/wabt/src/wast-parser-lexer-shared.h b/tools/external/wabt/src/wast-parser-lexer-shared.h similarity index 100% rename from external/wabt/src/wast-parser-lexer-shared.h rename to tools/external/wabt/src/wast-parser-lexer-shared.h diff --git a/external/wabt/src/wast-parser.cc b/tools/external/wabt/src/wast-parser.cc similarity index 100% rename from external/wabt/src/wast-parser.cc rename to tools/external/wabt/src/wast-parser.cc diff --git a/external/wabt/src/wast-parser.h b/tools/external/wabt/src/wast-parser.h similarity index 100% rename from external/wabt/src/wast-parser.h rename to tools/external/wabt/src/wast-parser.h diff --git a/external/wabt/src/wat-writer.cc b/tools/external/wabt/src/wat-writer.cc similarity index 100% rename from external/wabt/src/wat-writer.cc rename to tools/external/wabt/src/wat-writer.cc diff --git a/external/wabt/src/wat-writer.h b/tools/external/wabt/src/wat-writer.h similarity index 100% rename from external/wabt/src/wat-writer.h rename to tools/external/wabt/src/wat-writer.h diff --git a/external/wabt/test/README.md b/tools/external/wabt/test/README.md similarity index 100% rename from external/wabt/test/README.md rename to tools/external/wabt/test/README.md diff --git a/external/wabt/test/binary/bad-data-size.txt b/tools/external/wabt/test/binary/bad-data-size.txt similarity index 100% rename from external/wabt/test/binary/bad-data-size.txt rename to tools/external/wabt/test/binary/bad-data-size.txt diff --git a/external/wabt/test/binary/bad-duplicate-section-around-custom.txt b/tools/external/wabt/test/binary/bad-duplicate-section-around-custom.txt similarity index 100% rename from external/wabt/test/binary/bad-duplicate-section-around-custom.txt rename to tools/external/wabt/test/binary/bad-duplicate-section-around-custom.txt diff --git a/external/wabt/test/binary/bad-duplicate-section.txt b/tools/external/wabt/test/binary/bad-duplicate-section.txt similarity index 100% rename from external/wabt/test/binary/bad-duplicate-section.txt rename to tools/external/wabt/test/binary/bad-duplicate-section.txt diff --git a/external/wabt/test/binary/bad-duplicate-subsection.txt b/tools/external/wabt/test/binary/bad-duplicate-subsection.txt similarity index 100% rename from external/wabt/test/binary/bad-duplicate-subsection.txt rename to tools/external/wabt/test/binary/bad-duplicate-subsection.txt diff --git a/external/wabt/test/binary/bad-export-func.txt b/tools/external/wabt/test/binary/bad-export-func.txt similarity index 100% rename from external/wabt/test/binary/bad-export-func.txt rename to tools/external/wabt/test/binary/bad-export-func.txt diff --git a/external/wabt/test/binary/bad-extra-end.txt b/tools/external/wabt/test/binary/bad-extra-end.txt similarity index 100% rename from external/wabt/test/binary/bad-extra-end.txt rename to tools/external/wabt/test/binary/bad-extra-end.txt diff --git a/external/wabt/test/binary/bad-function-body-count.txt b/tools/external/wabt/test/binary/bad-function-body-count.txt similarity index 100% rename from external/wabt/test/binary/bad-function-body-count.txt rename to tools/external/wabt/test/binary/bad-function-body-count.txt diff --git a/external/wabt/test/binary/bad-function-body-size.txt b/tools/external/wabt/test/binary/bad-function-body-size.txt similarity index 100% rename from external/wabt/test/binary/bad-function-body-size.txt rename to tools/external/wabt/test/binary/bad-function-body-size.txt diff --git a/external/wabt/test/binary/bad-function-local-count.txt b/tools/external/wabt/test/binary/bad-function-local-count.txt similarity index 100% rename from external/wabt/test/binary/bad-function-local-count.txt rename to tools/external/wabt/test/binary/bad-function-local-count.txt diff --git a/external/wabt/test/binary/bad-function-local-type.txt b/tools/external/wabt/test/binary/bad-function-local-type.txt similarity index 100% rename from external/wabt/test/binary/bad-function-local-type.txt rename to tools/external/wabt/test/binary/bad-function-local-type.txt diff --git a/external/wabt/test/binary/bad-function-names-too-many.txt b/tools/external/wabt/test/binary/bad-function-names-too-many.txt similarity index 100% rename from external/wabt/test/binary/bad-function-names-too-many.txt rename to tools/external/wabt/test/binary/bad-function-names-too-many.txt diff --git a/external/wabt/test/binary/bad-function-param-type.txt b/tools/external/wabt/test/binary/bad-function-param-type.txt similarity index 100% rename from external/wabt/test/binary/bad-function-param-type.txt rename to tools/external/wabt/test/binary/bad-function-param-type.txt diff --git a/external/wabt/test/binary/bad-function-result-type.txt b/tools/external/wabt/test/binary/bad-function-result-type.txt similarity index 100% rename from external/wabt/test/binary/bad-function-result-type.txt rename to tools/external/wabt/test/binary/bad-function-result-type.txt diff --git a/external/wabt/test/binary/bad-function-sig.txt b/tools/external/wabt/test/binary/bad-function-sig.txt similarity index 100% rename from external/wabt/test/binary/bad-function-sig.txt rename to tools/external/wabt/test/binary/bad-function-sig.txt diff --git a/external/wabt/test/binary/bad-function-too-many-results.txt b/tools/external/wabt/test/binary/bad-function-too-many-results.txt similarity index 100% rename from external/wabt/test/binary/bad-function-too-many-results.txt rename to tools/external/wabt/test/binary/bad-function-too-many-results.txt diff --git a/external/wabt/test/binary/bad-import-sig.txt b/tools/external/wabt/test/binary/bad-import-sig.txt similarity index 100% rename from external/wabt/test/binary/bad-import-sig.txt rename to tools/external/wabt/test/binary/bad-import-sig.txt diff --git a/external/wabt/test/binary/bad-linking-metadata.txt b/tools/external/wabt/test/binary/bad-linking-metadata.txt similarity index 100% rename from external/wabt/test/binary/bad-linking-metadata.txt rename to tools/external/wabt/test/binary/bad-linking-metadata.txt diff --git a/external/wabt/test/binary/bad-logging-basic.txt b/tools/external/wabt/test/binary/bad-logging-basic.txt similarity index 100% rename from external/wabt/test/binary/bad-logging-basic.txt rename to tools/external/wabt/test/binary/bad-logging-basic.txt diff --git a/external/wabt/test/binary/bad-magic.txt b/tools/external/wabt/test/binary/bad-magic.txt similarity index 100% rename from external/wabt/test/binary/bad-magic.txt rename to tools/external/wabt/test/binary/bad-magic.txt diff --git a/external/wabt/test/binary/bad-memory-init-max-size.txt b/tools/external/wabt/test/binary/bad-memory-init-max-size.txt similarity index 100% rename from external/wabt/test/binary/bad-memory-init-max-size.txt rename to tools/external/wabt/test/binary/bad-memory-init-max-size.txt diff --git a/external/wabt/test/binary/bad-memory-init-size.txt b/tools/external/wabt/test/binary/bad-memory-init-size.txt similarity index 100% rename from external/wabt/test/binary/bad-memory-init-size.txt rename to tools/external/wabt/test/binary/bad-memory-init-size.txt diff --git a/external/wabt/test/binary/bad-memory-max-size.txt b/tools/external/wabt/test/binary/bad-memory-max-size.txt similarity index 100% rename from external/wabt/test/binary/bad-memory-max-size.txt rename to tools/external/wabt/test/binary/bad-memory-max-size.txt diff --git a/external/wabt/test/binary/bad-name-section-invalid-index.txt b/tools/external/wabt/test/binary/bad-name-section-invalid-index.txt similarity index 100% rename from external/wabt/test/binary/bad-name-section-invalid-index.txt rename to tools/external/wabt/test/binary/bad-name-section-invalid-index.txt diff --git a/external/wabt/test/binary/bad-name-section-location.txt b/tools/external/wabt/test/binary/bad-name-section-location.txt similarity index 100% rename from external/wabt/test/binary/bad-name-section-location.txt rename to tools/external/wabt/test/binary/bad-name-section-location.txt diff --git a/external/wabt/test/binary/bad-names-duplicate-locals.txt b/tools/external/wabt/test/binary/bad-names-duplicate-locals.txt similarity index 100% rename from external/wabt/test/binary/bad-names-duplicate-locals.txt rename to tools/external/wabt/test/binary/bad-names-duplicate-locals.txt diff --git a/external/wabt/test/binary/bad-names-duplicates.txt b/tools/external/wabt/test/binary/bad-names-duplicates.txt similarity index 100% rename from external/wabt/test/binary/bad-names-duplicates.txt rename to tools/external/wabt/test/binary/bad-names-duplicates.txt diff --git a/external/wabt/test/binary/bad-names-function-locals-out-of-order.txt b/tools/external/wabt/test/binary/bad-names-function-locals-out-of-order.txt similarity index 100% rename from external/wabt/test/binary/bad-names-function-locals-out-of-order.txt rename to tools/external/wabt/test/binary/bad-names-function-locals-out-of-order.txt diff --git a/external/wabt/test/binary/bad-names-locals-out-of-order.txt b/tools/external/wabt/test/binary/bad-names-locals-out-of-order.txt similarity index 100% rename from external/wabt/test/binary/bad-names-locals-out-of-order.txt rename to tools/external/wabt/test/binary/bad-names-locals-out-of-order.txt diff --git a/external/wabt/test/binary/bad-names-out-of-order.txt b/tools/external/wabt/test/binary/bad-names-out-of-order.txt similarity index 100% rename from external/wabt/test/binary/bad-names-out-of-order.txt rename to tools/external/wabt/test/binary/bad-names-out-of-order.txt diff --git a/external/wabt/test/binary/bad-op-after-end.txt b/tools/external/wabt/test/binary/bad-op-after-end.txt similarity index 100% rename from external/wabt/test/binary/bad-op-after-end.txt rename to tools/external/wabt/test/binary/bad-op-after-end.txt diff --git a/external/wabt/test/binary/bad-opcode-prefix.txt b/tools/external/wabt/test/binary/bad-opcode-prefix.txt similarity index 100% rename from external/wabt/test/binary/bad-opcode-prefix.txt rename to tools/external/wabt/test/binary/bad-opcode-prefix.txt diff --git a/external/wabt/test/binary/bad-opcode.txt b/tools/external/wabt/test/binary/bad-opcode.txt similarity index 100% rename from external/wabt/test/binary/bad-opcode.txt rename to tools/external/wabt/test/binary/bad-opcode.txt diff --git a/external/wabt/test/binary/bad-section-ends-early.txt b/tools/external/wabt/test/binary/bad-section-ends-early.txt similarity index 100% rename from external/wabt/test/binary/bad-section-ends-early.txt rename to tools/external/wabt/test/binary/bad-section-ends-early.txt diff --git a/external/wabt/test/binary/bad-section-size-zero.txt b/tools/external/wabt/test/binary/bad-section-size-zero.txt similarity index 100% rename from external/wabt/test/binary/bad-section-size-zero.txt rename to tools/external/wabt/test/binary/bad-section-size-zero.txt diff --git a/external/wabt/test/binary/bad-segment-no-memory.txt b/tools/external/wabt/test/binary/bad-segment-no-memory.txt similarity index 100% rename from external/wabt/test/binary/bad-segment-no-memory.txt rename to tools/external/wabt/test/binary/bad-segment-no-memory.txt diff --git a/external/wabt/test/binary/bad-simd-type.txt b/tools/external/wabt/test/binary/bad-simd-type.txt similarity index 100% rename from external/wabt/test/binary/bad-simd-type.txt rename to tools/external/wabt/test/binary/bad-simd-type.txt diff --git a/external/wabt/test/binary/bad-start-func.txt b/tools/external/wabt/test/binary/bad-start-func.txt similarity index 100% rename from external/wabt/test/binary/bad-start-func.txt rename to tools/external/wabt/test/binary/bad-start-func.txt diff --git a/external/wabt/test/binary/bad-subsection-out-of-order.txt b/tools/external/wabt/test/binary/bad-subsection-out-of-order.txt similarity index 100% rename from external/wabt/test/binary/bad-subsection-out-of-order.txt rename to tools/external/wabt/test/binary/bad-subsection-out-of-order.txt diff --git a/external/wabt/test/binary/bad-subsection-size.txt b/tools/external/wabt/test/binary/bad-subsection-size.txt similarity index 100% rename from external/wabt/test/binary/bad-subsection-size.txt rename to tools/external/wabt/test/binary/bad-subsection-size.txt diff --git a/external/wabt/test/binary/bad-subsection-unfinished.txt b/tools/external/wabt/test/binary/bad-subsection-unfinished.txt similarity index 100% rename from external/wabt/test/binary/bad-subsection-unfinished.txt rename to tools/external/wabt/test/binary/bad-subsection-unfinished.txt diff --git a/external/wabt/test/binary/bad-too-many-locals.txt b/tools/external/wabt/test/binary/bad-too-many-locals.txt similarity index 100% rename from external/wabt/test/binary/bad-too-many-locals.txt rename to tools/external/wabt/test/binary/bad-too-many-locals.txt diff --git a/external/wabt/test/binary/bad-type-form.txt b/tools/external/wabt/test/binary/bad-type-form.txt similarity index 100% rename from external/wabt/test/binary/bad-type-form.txt rename to tools/external/wabt/test/binary/bad-type-form.txt diff --git a/external/wabt/test/binary/bad-typecheck-fail.txt b/tools/external/wabt/test/binary/bad-typecheck-fail.txt similarity index 100% rename from external/wabt/test/binary/bad-typecheck-fail.txt rename to tools/external/wabt/test/binary/bad-typecheck-fail.txt diff --git a/external/wabt/test/binary/bad-typecheck-missing-drop.txt b/tools/external/wabt/test/binary/bad-typecheck-missing-drop.txt similarity index 100% rename from external/wabt/test/binary/bad-typecheck-missing-drop.txt rename to tools/external/wabt/test/binary/bad-typecheck-missing-drop.txt diff --git a/external/wabt/test/binary/bad-version.txt b/tools/external/wabt/test/binary/bad-version.txt similarity index 100% rename from external/wabt/test/binary/bad-version.txt rename to tools/external/wabt/test/binary/bad-version.txt diff --git a/external/wabt/test/binary/basic.txt b/tools/external/wabt/test/binary/basic.txt similarity index 100% rename from external/wabt/test/binary/basic.txt rename to tools/external/wabt/test/binary/basic.txt diff --git a/external/wabt/test/binary/duplicate-names.txt b/tools/external/wabt/test/binary/duplicate-names.txt similarity index 100% rename from external/wabt/test/binary/duplicate-names.txt rename to tools/external/wabt/test/binary/duplicate-names.txt diff --git a/external/wabt/test/binary/gen-wasm-parse-error.txt b/tools/external/wabt/test/binary/gen-wasm-parse-error.txt similarity index 100% rename from external/wabt/test/binary/gen-wasm-parse-error.txt rename to tools/external/wabt/test/binary/gen-wasm-parse-error.txt diff --git a/external/wabt/test/binary/ignore-custom-section-error-objdump.txt b/tools/external/wabt/test/binary/ignore-custom-section-error-objdump.txt similarity index 100% rename from external/wabt/test/binary/ignore-custom-section-error-objdump.txt rename to tools/external/wabt/test/binary/ignore-custom-section-error-objdump.txt diff --git a/external/wabt/test/binary/ignore-custom-section-error-wasm2wat.txt b/tools/external/wabt/test/binary/ignore-custom-section-error-wasm2wat.txt similarity index 100% rename from external/wabt/test/binary/ignore-custom-section-error-wasm2wat.txt rename to tools/external/wabt/test/binary/ignore-custom-section-error-wasm2wat.txt diff --git a/external/wabt/test/binary/invalid-name.txt b/tools/external/wabt/test/binary/invalid-name.txt similarity index 100% rename from external/wabt/test/binary/invalid-name.txt rename to tools/external/wabt/test/binary/invalid-name.txt diff --git a/external/wabt/test/binary/linking-section.txt b/tools/external/wabt/test/binary/linking-section.txt similarity index 100% rename from external/wabt/test/binary/linking-section.txt rename to tools/external/wabt/test/binary/linking-section.txt diff --git a/external/wabt/test/binary/names.txt b/tools/external/wabt/test/binary/names.txt similarity index 100% rename from external/wabt/test/binary/names.txt rename to tools/external/wabt/test/binary/names.txt diff --git a/external/wabt/test/binary/no-global-names.txt b/tools/external/wabt/test/binary/no-global-names.txt similarity index 100% rename from external/wabt/test/binary/no-global-names.txt rename to tools/external/wabt/test/binary/no-global-names.txt diff --git a/external/wabt/test/binary/no-names.txt b/tools/external/wabt/test/binary/no-names.txt similarity index 100% rename from external/wabt/test/binary/no-names.txt rename to tools/external/wabt/test/binary/no-names.txt diff --git a/external/wabt/test/binary/relocs.txt b/tools/external/wabt/test/binary/relocs.txt similarity index 100% rename from external/wabt/test/binary/relocs.txt rename to tools/external/wabt/test/binary/relocs.txt diff --git a/external/wabt/test/binary/user-section.txt b/tools/external/wabt/test/binary/user-section.txt similarity index 100% rename from external/wabt/test/binary/user-section.txt rename to tools/external/wabt/test/binary/user-section.txt diff --git a/external/wabt/test/desugar/basic.txt b/tools/external/wabt/test/desugar/basic.txt similarity index 100% rename from external/wabt/test/desugar/basic.txt rename to tools/external/wabt/test/desugar/basic.txt diff --git a/external/wabt/test/desugar/implicit-func-type.txt b/tools/external/wabt/test/desugar/implicit-func-type.txt similarity index 100% rename from external/wabt/test/desugar/implicit-func-type.txt rename to tools/external/wabt/test/desugar/implicit-func-type.txt diff --git a/external/wabt/test/desugar/try.txt b/tools/external/wabt/test/desugar/try.txt similarity index 100% rename from external/wabt/test/desugar/try.txt rename to tools/external/wabt/test/desugar/try.txt diff --git a/external/wabt/test/dump/atomic.txt b/tools/external/wabt/test/dump/atomic.txt similarity index 100% rename from external/wabt/test/dump/atomic.txt rename to tools/external/wabt/test/dump/atomic.txt diff --git a/external/wabt/test/dump/bad-version-logging.txt b/tools/external/wabt/test/dump/bad-version-logging.txt similarity index 100% rename from external/wabt/test/dump/bad-version-logging.txt rename to tools/external/wabt/test/dump/bad-version-logging.txt diff --git a/external/wabt/test/dump/bad-version.txt b/tools/external/wabt/test/dump/bad-version.txt similarity index 100% rename from external/wabt/test/dump/bad-version.txt rename to tools/external/wabt/test/dump/bad-version.txt diff --git a/external/wabt/test/dump/basic.txt b/tools/external/wabt/test/dump/basic.txt similarity index 100% rename from external/wabt/test/dump/basic.txt rename to tools/external/wabt/test/dump/basic.txt diff --git a/external/wabt/test/dump/basic_dump_only.txt b/tools/external/wabt/test/dump/basic_dump_only.txt similarity index 100% rename from external/wabt/test/dump/basic_dump_only.txt rename to tools/external/wabt/test/dump/basic_dump_only.txt diff --git a/external/wabt/test/dump/binary.txt b/tools/external/wabt/test/dump/binary.txt similarity index 100% rename from external/wabt/test/dump/binary.txt rename to tools/external/wabt/test/dump/binary.txt diff --git a/external/wabt/test/dump/block-257-exprs-br.txt b/tools/external/wabt/test/dump/block-257-exprs-br.txt similarity index 100% rename from external/wabt/test/dump/block-257-exprs-br.txt rename to tools/external/wabt/test/dump/block-257-exprs-br.txt diff --git a/external/wabt/test/dump/block-257-exprs.txt b/tools/external/wabt/test/dump/block-257-exprs.txt similarity index 100% rename from external/wabt/test/dump/block-257-exprs.txt rename to tools/external/wabt/test/dump/block-257-exprs.txt diff --git a/external/wabt/test/dump/block-multi.txt b/tools/external/wabt/test/dump/block-multi.txt similarity index 100% rename from external/wabt/test/dump/block-multi.txt rename to tools/external/wabt/test/dump/block-multi.txt diff --git a/external/wabt/test/dump/block.txt b/tools/external/wabt/test/dump/block.txt similarity index 100% rename from external/wabt/test/dump/block.txt rename to tools/external/wabt/test/dump/block.txt diff --git a/external/wabt/test/dump/br-block-named.txt b/tools/external/wabt/test/dump/br-block-named.txt similarity index 100% rename from external/wabt/test/dump/br-block-named.txt rename to tools/external/wabt/test/dump/br-block-named.txt diff --git a/external/wabt/test/dump/br-block.txt b/tools/external/wabt/test/dump/br-block.txt similarity index 100% rename from external/wabt/test/dump/br-block.txt rename to tools/external/wabt/test/dump/br-block.txt diff --git a/external/wabt/test/dump/br-loop-inner-expr.txt b/tools/external/wabt/test/dump/br-loop-inner-expr.txt similarity index 100% rename from external/wabt/test/dump/br-loop-inner-expr.txt rename to tools/external/wabt/test/dump/br-loop-inner-expr.txt diff --git a/external/wabt/test/dump/br-loop-inner.txt b/tools/external/wabt/test/dump/br-loop-inner.txt similarity index 100% rename from external/wabt/test/dump/br-loop-inner.txt rename to tools/external/wabt/test/dump/br-loop-inner.txt diff --git a/external/wabt/test/dump/br-loop.txt b/tools/external/wabt/test/dump/br-loop.txt similarity index 100% rename from external/wabt/test/dump/br-loop.txt rename to tools/external/wabt/test/dump/br-loop.txt diff --git a/external/wabt/test/dump/brif-loop.txt b/tools/external/wabt/test/dump/brif-loop.txt similarity index 100% rename from external/wabt/test/dump/brif-loop.txt rename to tools/external/wabt/test/dump/brif-loop.txt diff --git a/external/wabt/test/dump/brif.txt b/tools/external/wabt/test/dump/brif.txt similarity index 100% rename from external/wabt/test/dump/brif.txt rename to tools/external/wabt/test/dump/brif.txt diff --git a/external/wabt/test/dump/brtable-empty.txt b/tools/external/wabt/test/dump/brtable-empty.txt similarity index 100% rename from external/wabt/test/dump/brtable-empty.txt rename to tools/external/wabt/test/dump/brtable-empty.txt diff --git a/external/wabt/test/dump/brtable.txt b/tools/external/wabt/test/dump/brtable.txt similarity index 100% rename from external/wabt/test/dump/brtable.txt rename to tools/external/wabt/test/dump/brtable.txt diff --git a/external/wabt/test/dump/call.txt b/tools/external/wabt/test/dump/call.txt similarity index 100% rename from external/wabt/test/dump/call.txt rename to tools/external/wabt/test/dump/call.txt diff --git a/external/wabt/test/dump/callimport.txt b/tools/external/wabt/test/dump/callimport.txt similarity index 100% rename from external/wabt/test/dump/callimport.txt rename to tools/external/wabt/test/dump/callimport.txt diff --git a/external/wabt/test/dump/callindirect.txt b/tools/external/wabt/test/dump/callindirect.txt similarity index 100% rename from external/wabt/test/dump/callindirect.txt rename to tools/external/wabt/test/dump/callindirect.txt diff --git a/external/wabt/test/dump/cast.txt b/tools/external/wabt/test/dump/cast.txt similarity index 100% rename from external/wabt/test/dump/cast.txt rename to tools/external/wabt/test/dump/cast.txt diff --git a/external/wabt/test/dump/compare.txt b/tools/external/wabt/test/dump/compare.txt similarity index 100% rename from external/wabt/test/dump/compare.txt rename to tools/external/wabt/test/dump/compare.txt diff --git a/external/wabt/test/dump/const.txt b/tools/external/wabt/test/dump/const.txt similarity index 100% rename from external/wabt/test/dump/const.txt rename to tools/external/wabt/test/dump/const.txt diff --git a/external/wabt/test/dump/convert-sat.txt b/tools/external/wabt/test/dump/convert-sat.txt similarity index 100% rename from external/wabt/test/dump/convert-sat.txt rename to tools/external/wabt/test/dump/convert-sat.txt diff --git a/external/wabt/test/dump/convert.txt b/tools/external/wabt/test/dump/convert.txt similarity index 100% rename from external/wabt/test/dump/convert.txt rename to tools/external/wabt/test/dump/convert.txt diff --git a/external/wabt/test/dump/current-memory.txt b/tools/external/wabt/test/dump/current-memory.txt similarity index 100% rename from external/wabt/test/dump/current-memory.txt rename to tools/external/wabt/test/dump/current-memory.txt diff --git a/external/wabt/test/dump/debug-import-names.txt b/tools/external/wabt/test/dump/debug-import-names.txt similarity index 100% rename from external/wabt/test/dump/debug-import-names.txt rename to tools/external/wabt/test/dump/debug-import-names.txt diff --git a/external/wabt/test/dump/debug-names.txt b/tools/external/wabt/test/dump/debug-names.txt similarity index 100% rename from external/wabt/test/dump/debug-names.txt rename to tools/external/wabt/test/dump/debug-names.txt diff --git a/external/wabt/test/dump/dedupe-sig.txt b/tools/external/wabt/test/dump/dedupe-sig.txt similarity index 100% rename from external/wabt/test/dump/dedupe-sig.txt rename to tools/external/wabt/test/dump/dedupe-sig.txt diff --git a/external/wabt/test/dump/drop.txt b/tools/external/wabt/test/dump/drop.txt similarity index 100% rename from external/wabt/test/dump/drop.txt rename to tools/external/wabt/test/dump/drop.txt diff --git a/external/wabt/test/dump/except.txt b/tools/external/wabt/test/dump/except.txt similarity index 100% rename from external/wabt/test/dump/except.txt rename to tools/external/wabt/test/dump/except.txt diff --git a/external/wabt/test/dump/export-multi.txt b/tools/external/wabt/test/dump/export-multi.txt similarity index 100% rename from external/wabt/test/dump/export-multi.txt rename to tools/external/wabt/test/dump/export-multi.txt diff --git a/external/wabt/test/dump/expr-br.txt b/tools/external/wabt/test/dump/expr-br.txt similarity index 100% rename from external/wabt/test/dump/expr-br.txt rename to tools/external/wabt/test/dump/expr-br.txt diff --git a/external/wabt/test/dump/expr-brif.txt b/tools/external/wabt/test/dump/expr-brif.txt similarity index 100% rename from external/wabt/test/dump/expr-brif.txt rename to tools/external/wabt/test/dump/expr-brif.txt diff --git a/external/wabt/test/dump/func-exported.txt b/tools/external/wabt/test/dump/func-exported.txt similarity index 100% rename from external/wabt/test/dump/func-exported.txt rename to tools/external/wabt/test/dump/func-exported.txt diff --git a/external/wabt/test/dump/func-multi.txt b/tools/external/wabt/test/dump/func-multi.txt similarity index 100% rename from external/wabt/test/dump/func-multi.txt rename to tools/external/wabt/test/dump/func-multi.txt diff --git a/external/wabt/test/dump/func-named.txt b/tools/external/wabt/test/dump/func-named.txt similarity index 100% rename from external/wabt/test/dump/func-named.txt rename to tools/external/wabt/test/dump/func-named.txt diff --git a/external/wabt/test/dump/func-result-multi.txt b/tools/external/wabt/test/dump/func-result-multi.txt similarity index 100% rename from external/wabt/test/dump/func-result-multi.txt rename to tools/external/wabt/test/dump/func-result-multi.txt diff --git a/external/wabt/test/dump/getglobal.txt b/tools/external/wabt/test/dump/getglobal.txt similarity index 100% rename from external/wabt/test/dump/getglobal.txt rename to tools/external/wabt/test/dump/getglobal.txt diff --git a/external/wabt/test/dump/getlocal-param.txt b/tools/external/wabt/test/dump/getlocal-param.txt similarity index 100% rename from external/wabt/test/dump/getlocal-param.txt rename to tools/external/wabt/test/dump/getlocal-param.txt diff --git a/external/wabt/test/dump/getlocal.txt b/tools/external/wabt/test/dump/getlocal.txt similarity index 100% rename from external/wabt/test/dump/getlocal.txt rename to tools/external/wabt/test/dump/getlocal.txt diff --git a/external/wabt/test/dump/global.txt b/tools/external/wabt/test/dump/global.txt similarity index 100% rename from external/wabt/test/dump/global.txt rename to tools/external/wabt/test/dump/global.txt diff --git a/external/wabt/test/dump/grow-memory.txt b/tools/external/wabt/test/dump/grow-memory.txt similarity index 100% rename from external/wabt/test/dump/grow-memory.txt rename to tools/external/wabt/test/dump/grow-memory.txt diff --git a/external/wabt/test/dump/hexfloat_f32.txt b/tools/external/wabt/test/dump/hexfloat_f32.txt similarity index 100% rename from external/wabt/test/dump/hexfloat_f32.txt rename to tools/external/wabt/test/dump/hexfloat_f32.txt diff --git a/external/wabt/test/dump/hexfloat_f64.txt b/tools/external/wabt/test/dump/hexfloat_f64.txt similarity index 100% rename from external/wabt/test/dump/hexfloat_f64.txt rename to tools/external/wabt/test/dump/hexfloat_f64.txt diff --git a/external/wabt/test/dump/if-multi.txt b/tools/external/wabt/test/dump/if-multi.txt similarity index 100% rename from external/wabt/test/dump/if-multi.txt rename to tools/external/wabt/test/dump/if-multi.txt diff --git a/external/wabt/test/dump/if-then-else-list.txt b/tools/external/wabt/test/dump/if-then-else-list.txt similarity index 100% rename from external/wabt/test/dump/if-then-else-list.txt rename to tools/external/wabt/test/dump/if-then-else-list.txt diff --git a/external/wabt/test/dump/if-then-list.txt b/tools/external/wabt/test/dump/if-then-list.txt similarity index 100% rename from external/wabt/test/dump/if-then-list.txt rename to tools/external/wabt/test/dump/if-then-list.txt diff --git a/external/wabt/test/dump/if.txt b/tools/external/wabt/test/dump/if.txt similarity index 100% rename from external/wabt/test/dump/if.txt rename to tools/external/wabt/test/dump/if.txt diff --git a/external/wabt/test/dump/if_except-multi.txt b/tools/external/wabt/test/dump/if_except-multi.txt similarity index 100% rename from external/wabt/test/dump/if_except-multi.txt rename to tools/external/wabt/test/dump/if_except-multi.txt diff --git a/external/wabt/test/dump/if_except.txt b/tools/external/wabt/test/dump/if_except.txt similarity index 100% rename from external/wabt/test/dump/if_except.txt rename to tools/external/wabt/test/dump/if_except.txt diff --git a/external/wabt/test/dump/import.txt b/tools/external/wabt/test/dump/import.txt similarity index 100% rename from external/wabt/test/dump/import.txt rename to tools/external/wabt/test/dump/import.txt diff --git a/external/wabt/test/dump/invalid-data-segment-no-memory.txt b/tools/external/wabt/test/dump/invalid-data-segment-no-memory.txt similarity index 100% rename from external/wabt/test/dump/invalid-data-segment-no-memory.txt rename to tools/external/wabt/test/dump/invalid-data-segment-no-memory.txt diff --git a/external/wabt/test/dump/invalid-data-segment-offset.txt b/tools/external/wabt/test/dump/invalid-data-segment-offset.txt similarity index 100% rename from external/wabt/test/dump/invalid-data-segment-offset.txt rename to tools/external/wabt/test/dump/invalid-data-segment-offset.txt diff --git a/external/wabt/test/dump/invalid-elem-segment-no-table.txt b/tools/external/wabt/test/dump/invalid-elem-segment-no-table.txt similarity index 100% rename from external/wabt/test/dump/invalid-elem-segment-no-table.txt rename to tools/external/wabt/test/dump/invalid-elem-segment-no-table.txt diff --git a/external/wabt/test/dump/invalid-elem-segment-offset.txt b/tools/external/wabt/test/dump/invalid-elem-segment-offset.txt similarity index 100% rename from external/wabt/test/dump/invalid-elem-segment-offset.txt rename to tools/external/wabt/test/dump/invalid-elem-segment-offset.txt diff --git a/external/wabt/test/dump/load-aligned.txt b/tools/external/wabt/test/dump/load-aligned.txt similarity index 100% rename from external/wabt/test/dump/load-aligned.txt rename to tools/external/wabt/test/dump/load-aligned.txt diff --git a/external/wabt/test/dump/load.txt b/tools/external/wabt/test/dump/load.txt similarity index 100% rename from external/wabt/test/dump/load.txt rename to tools/external/wabt/test/dump/load.txt diff --git a/external/wabt/test/dump/locals.txt b/tools/external/wabt/test/dump/locals.txt similarity index 100% rename from external/wabt/test/dump/locals.txt rename to tools/external/wabt/test/dump/locals.txt diff --git a/external/wabt/test/dump/loop-257-exprs-br.txt b/tools/external/wabt/test/dump/loop-257-exprs-br.txt similarity index 100% rename from external/wabt/test/dump/loop-257-exprs-br.txt rename to tools/external/wabt/test/dump/loop-257-exprs-br.txt diff --git a/external/wabt/test/dump/loop-257-exprs.txt b/tools/external/wabt/test/dump/loop-257-exprs.txt similarity index 100% rename from external/wabt/test/dump/loop-257-exprs.txt rename to tools/external/wabt/test/dump/loop-257-exprs.txt diff --git a/external/wabt/test/dump/loop-multi.txt b/tools/external/wabt/test/dump/loop-multi.txt similarity index 100% rename from external/wabt/test/dump/loop-multi.txt rename to tools/external/wabt/test/dump/loop-multi.txt diff --git a/external/wabt/test/dump/loop.txt b/tools/external/wabt/test/dump/loop.txt similarity index 100% rename from external/wabt/test/dump/loop.txt rename to tools/external/wabt/test/dump/loop.txt diff --git a/external/wabt/test/dump/memory-1-byte.txt b/tools/external/wabt/test/dump/memory-1-byte.txt similarity index 100% rename from external/wabt/test/dump/memory-1-byte.txt rename to tools/external/wabt/test/dump/memory-1-byte.txt diff --git a/external/wabt/test/dump/memory-data-size.txt b/tools/external/wabt/test/dump/memory-data-size.txt similarity index 100% rename from external/wabt/test/dump/memory-data-size.txt rename to tools/external/wabt/test/dump/memory-data-size.txt diff --git a/external/wabt/test/dump/memory-hex.txt b/tools/external/wabt/test/dump/memory-hex.txt similarity index 100% rename from external/wabt/test/dump/memory-hex.txt rename to tools/external/wabt/test/dump/memory-hex.txt diff --git a/external/wabt/test/dump/memory.txt b/tools/external/wabt/test/dump/memory.txt similarity index 100% rename from external/wabt/test/dump/memory.txt rename to tools/external/wabt/test/dump/memory.txt diff --git a/external/wabt/test/dump/module-name.txt b/tools/external/wabt/test/dump/module-name.txt similarity index 100% rename from external/wabt/test/dump/module-name.txt rename to tools/external/wabt/test/dump/module-name.txt diff --git a/external/wabt/test/dump/multi_file.txt b/tools/external/wabt/test/dump/multi_file.txt similarity index 100% rename from external/wabt/test/dump/multi_file.txt rename to tools/external/wabt/test/dump/multi_file.txt diff --git a/external/wabt/test/dump/mutable-global.txt b/tools/external/wabt/test/dump/mutable-global.txt similarity index 100% rename from external/wabt/test/dump/mutable-global.txt rename to tools/external/wabt/test/dump/mutable-global.txt diff --git a/external/wabt/test/dump/no-canonicalize.txt b/tools/external/wabt/test/dump/no-canonicalize.txt similarity index 100% rename from external/wabt/test/dump/no-canonicalize.txt rename to tools/external/wabt/test/dump/no-canonicalize.txt diff --git a/external/wabt/test/dump/nocheck.txt b/tools/external/wabt/test/dump/nocheck.txt similarity index 100% rename from external/wabt/test/dump/nocheck.txt rename to tools/external/wabt/test/dump/nocheck.txt diff --git a/external/wabt/test/dump/nop.txt b/tools/external/wabt/test/dump/nop.txt similarity index 100% rename from external/wabt/test/dump/nop.txt rename to tools/external/wabt/test/dump/nop.txt diff --git a/external/wabt/test/dump/param-multi.txt b/tools/external/wabt/test/dump/param-multi.txt similarity index 100% rename from external/wabt/test/dump/param-multi.txt rename to tools/external/wabt/test/dump/param-multi.txt diff --git a/external/wabt/test/dump/relocations.txt b/tools/external/wabt/test/dump/relocations.txt similarity index 100% rename from external/wabt/test/dump/relocations.txt rename to tools/external/wabt/test/dump/relocations.txt diff --git a/external/wabt/test/dump/result.txt b/tools/external/wabt/test/dump/result.txt similarity index 100% rename from external/wabt/test/dump/result.txt rename to tools/external/wabt/test/dump/result.txt diff --git a/external/wabt/test/dump/rethrow.txt b/tools/external/wabt/test/dump/rethrow.txt similarity index 100% rename from external/wabt/test/dump/rethrow.txt rename to tools/external/wabt/test/dump/rethrow.txt diff --git a/external/wabt/test/dump/return.txt b/tools/external/wabt/test/dump/return.txt similarity index 100% rename from external/wabt/test/dump/return.txt rename to tools/external/wabt/test/dump/return.txt diff --git a/external/wabt/test/dump/select.txt b/tools/external/wabt/test/dump/select.txt similarity index 100% rename from external/wabt/test/dump/select.txt rename to tools/external/wabt/test/dump/select.txt diff --git a/external/wabt/test/dump/setglobal.txt b/tools/external/wabt/test/dump/setglobal.txt similarity index 100% rename from external/wabt/test/dump/setglobal.txt rename to tools/external/wabt/test/dump/setglobal.txt diff --git a/external/wabt/test/dump/setlocal-param.txt b/tools/external/wabt/test/dump/setlocal-param.txt similarity index 100% rename from external/wabt/test/dump/setlocal-param.txt rename to tools/external/wabt/test/dump/setlocal-param.txt diff --git a/external/wabt/test/dump/setlocal.txt b/tools/external/wabt/test/dump/setlocal.txt similarity index 100% rename from external/wabt/test/dump/setlocal.txt rename to tools/external/wabt/test/dump/setlocal.txt diff --git a/external/wabt/test/dump/signatures.txt b/tools/external/wabt/test/dump/signatures.txt similarity index 100% rename from external/wabt/test/dump/signatures.txt rename to tools/external/wabt/test/dump/signatures.txt diff --git a/external/wabt/test/dump/start.txt b/tools/external/wabt/test/dump/start.txt similarity index 100% rename from external/wabt/test/dump/start.txt rename to tools/external/wabt/test/dump/start.txt diff --git a/external/wabt/test/dump/store-aligned.txt b/tools/external/wabt/test/dump/store-aligned.txt similarity index 100% rename from external/wabt/test/dump/store-aligned.txt rename to tools/external/wabt/test/dump/store-aligned.txt diff --git a/external/wabt/test/dump/store.txt b/tools/external/wabt/test/dump/store.txt similarity index 100% rename from external/wabt/test/dump/store.txt rename to tools/external/wabt/test/dump/store.txt diff --git a/external/wabt/test/dump/string-escape.txt b/tools/external/wabt/test/dump/string-escape.txt similarity index 100% rename from external/wabt/test/dump/string-escape.txt rename to tools/external/wabt/test/dump/string-escape.txt diff --git a/external/wabt/test/dump/string-hex.txt b/tools/external/wabt/test/dump/string-hex.txt similarity index 100% rename from external/wabt/test/dump/string-hex.txt rename to tools/external/wabt/test/dump/string-hex.txt diff --git a/external/wabt/test/dump/table.txt b/tools/external/wabt/test/dump/table.txt similarity index 100% rename from external/wabt/test/dump/table.txt rename to tools/external/wabt/test/dump/table.txt diff --git a/external/wabt/test/dump/tee_local.txt b/tools/external/wabt/test/dump/tee_local.txt similarity index 100% rename from external/wabt/test/dump/tee_local.txt rename to tools/external/wabt/test/dump/tee_local.txt diff --git a/external/wabt/test/dump/throw.txt b/tools/external/wabt/test/dump/throw.txt similarity index 100% rename from external/wabt/test/dump/throw.txt rename to tools/external/wabt/test/dump/throw.txt diff --git a/external/wabt/test/dump/try-multi.txt b/tools/external/wabt/test/dump/try-multi.txt similarity index 100% rename from external/wabt/test/dump/try-multi.txt rename to tools/external/wabt/test/dump/try-multi.txt diff --git a/external/wabt/test/dump/try.txt b/tools/external/wabt/test/dump/try.txt similarity index 100% rename from external/wabt/test/dump/try.txt rename to tools/external/wabt/test/dump/try.txt diff --git a/external/wabt/test/dump/unary-extend.txt b/tools/external/wabt/test/dump/unary-extend.txt similarity index 100% rename from external/wabt/test/dump/unary-extend.txt rename to tools/external/wabt/test/dump/unary-extend.txt diff --git a/external/wabt/test/dump/unary.txt b/tools/external/wabt/test/dump/unary.txt similarity index 100% rename from external/wabt/test/dump/unary.txt rename to tools/external/wabt/test/dump/unary.txt diff --git a/external/wabt/test/dump/unreachable.txt b/tools/external/wabt/test/dump/unreachable.txt similarity index 100% rename from external/wabt/test/dump/unreachable.txt rename to tools/external/wabt/test/dump/unreachable.txt diff --git a/external/wabt/test/find_exe.py b/tools/external/wabt/test/find_exe.py similarity index 100% rename from external/wabt/test/find_exe.py rename to tools/external/wabt/test/find_exe.py diff --git a/external/wabt/test/gen-spec-empty-prefix.js b/tools/external/wabt/test/gen-spec-empty-prefix.js similarity index 100% rename from external/wabt/test/gen-spec-empty-prefix.js rename to tools/external/wabt/test/gen-spec-empty-prefix.js diff --git a/external/wabt/test/gen-spec-js.py b/tools/external/wabt/test/gen-spec-js.py similarity index 100% rename from external/wabt/test/gen-spec-js.py rename to tools/external/wabt/test/gen-spec-js.py diff --git a/external/wabt/test/gen-spec-js/action.txt b/tools/external/wabt/test/gen-spec-js/action.txt similarity index 100% rename from external/wabt/test/gen-spec-js/action.txt rename to tools/external/wabt/test/gen-spec-js/action.txt diff --git a/external/wabt/test/gen-spec-js/assert_exhaustion.txt b/tools/external/wabt/test/gen-spec-js/assert_exhaustion.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_exhaustion.txt rename to tools/external/wabt/test/gen-spec-js/assert_exhaustion.txt diff --git a/external/wabt/test/gen-spec-js/assert_malformed-quote.txt b/tools/external/wabt/test/gen-spec-js/assert_malformed-quote.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_malformed-quote.txt rename to tools/external/wabt/test/gen-spec-js/assert_malformed-quote.txt diff --git a/external/wabt/test/gen-spec-js/assert_malformed.txt b/tools/external/wabt/test/gen-spec-js/assert_malformed.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_malformed.txt rename to tools/external/wabt/test/gen-spec-js/assert_malformed.txt diff --git a/external/wabt/test/gen-spec-js/assert_return.txt b/tools/external/wabt/test/gen-spec-js/assert_return.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_return.txt rename to tools/external/wabt/test/gen-spec-js/assert_return.txt diff --git a/external/wabt/test/gen-spec-js/assert_return_nan.txt b/tools/external/wabt/test/gen-spec-js/assert_return_nan.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_return_nan.txt rename to tools/external/wabt/test/gen-spec-js/assert_return_nan.txt diff --git a/external/wabt/test/gen-spec-js/assert_trap.txt b/tools/external/wabt/test/gen-spec-js/assert_trap.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_trap.txt rename to tools/external/wabt/test/gen-spec-js/assert_trap.txt diff --git a/external/wabt/test/gen-spec-js/assert_uninstantiable.txt b/tools/external/wabt/test/gen-spec-js/assert_uninstantiable.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_uninstantiable.txt rename to tools/external/wabt/test/gen-spec-js/assert_uninstantiable.txt diff --git a/external/wabt/test/gen-spec-js/assert_unlinkable.txt b/tools/external/wabt/test/gen-spec-js/assert_unlinkable.txt similarity index 100% rename from external/wabt/test/gen-spec-js/assert_unlinkable.txt rename to tools/external/wabt/test/gen-spec-js/assert_unlinkable.txt diff --git a/external/wabt/test/gen-spec-js/basic.txt b/tools/external/wabt/test/gen-spec-js/basic.txt similarity index 100% rename from external/wabt/test/gen-spec-js/basic.txt rename to tools/external/wabt/test/gen-spec-js/basic.txt diff --git a/external/wabt/test/gen-spec-js/many-modules.txt b/tools/external/wabt/test/gen-spec-js/many-modules.txt similarity index 100% rename from external/wabt/test/gen-spec-js/many-modules.txt rename to tools/external/wabt/test/gen-spec-js/many-modules.txt diff --git a/external/wabt/test/gen-spec-js/register.txt b/tools/external/wabt/test/gen-spec-js/register.txt similarity index 100% rename from external/wabt/test/gen-spec-js/register.txt rename to tools/external/wabt/test/gen-spec-js/register.txt diff --git a/external/wabt/test/gen-spec-prefix.js b/tools/external/wabt/test/gen-spec-prefix.js similarity index 100% rename from external/wabt/test/gen-spec-prefix.js rename to tools/external/wabt/test/gen-spec-prefix.js diff --git a/external/wabt/test/gen-wasm.py b/tools/external/wabt/test/gen-wasm.py similarity index 100% rename from external/wabt/test/gen-wasm.py rename to tools/external/wabt/test/gen-wasm.py diff --git a/external/wabt/test/help/spectest-interp.txt b/tools/external/wabt/test/help/spectest-interp.txt similarity index 100% rename from external/wabt/test/help/spectest-interp.txt rename to tools/external/wabt/test/help/spectest-interp.txt diff --git a/external/wabt/test/help/wasm-interp.txt b/tools/external/wabt/test/help/wasm-interp.txt similarity index 100% rename from external/wabt/test/help/wasm-interp.txt rename to tools/external/wabt/test/help/wasm-interp.txt diff --git a/external/wabt/test/help/wasm-objdump.txt b/tools/external/wabt/test/help/wasm-objdump.txt similarity index 100% rename from external/wabt/test/help/wasm-objdump.txt rename to tools/external/wabt/test/help/wasm-objdump.txt diff --git a/external/wabt/test/help/wasm-opcodecnt.txt b/tools/external/wabt/test/help/wasm-opcodecnt.txt similarity index 100% rename from external/wabt/test/help/wasm-opcodecnt.txt rename to tools/external/wabt/test/help/wasm-opcodecnt.txt diff --git a/external/wabt/test/help/wasm-validate.txt b/tools/external/wabt/test/help/wasm-validate.txt similarity index 100% rename from external/wabt/test/help/wasm-validate.txt rename to tools/external/wabt/test/help/wasm-validate.txt diff --git a/external/wabt/test/help/wasm2wat.txt b/tools/external/wabt/test/help/wasm2wat.txt similarity index 100% rename from external/wabt/test/help/wasm2wat.txt rename to tools/external/wabt/test/help/wasm2wat.txt diff --git a/external/wabt/test/help/wast2json.txt b/tools/external/wabt/test/help/wast2json.txt similarity index 100% rename from external/wabt/test/help/wast2json.txt rename to tools/external/wabt/test/help/wast2json.txt diff --git a/external/wabt/test/help/wat-desugar.txt b/tools/external/wabt/test/help/wat-desugar.txt similarity index 100% rename from external/wabt/test/help/wat-desugar.txt rename to tools/external/wabt/test/help/wat-desugar.txt diff --git a/external/wabt/test/help/wat2wasm.txt b/tools/external/wabt/test/help/wat2wasm.txt similarity index 100% rename from external/wabt/test/help/wat2wasm.txt rename to tools/external/wabt/test/help/wat2wasm.txt diff --git a/external/wabt/test/interp/atomic-load.txt b/tools/external/wabt/test/interp/atomic-load.txt similarity index 100% rename from external/wabt/test/interp/atomic-load.txt rename to tools/external/wabt/test/interp/atomic-load.txt diff --git a/external/wabt/test/interp/atomic-rmw-add.txt b/tools/external/wabt/test/interp/atomic-rmw-add.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-add.txt rename to tools/external/wabt/test/interp/atomic-rmw-add.txt diff --git a/external/wabt/test/interp/atomic-rmw-and.txt b/tools/external/wabt/test/interp/atomic-rmw-and.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-and.txt rename to tools/external/wabt/test/interp/atomic-rmw-and.txt diff --git a/external/wabt/test/interp/atomic-rmw-cmpxchg.txt b/tools/external/wabt/test/interp/atomic-rmw-cmpxchg.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-cmpxchg.txt rename to tools/external/wabt/test/interp/atomic-rmw-cmpxchg.txt diff --git a/external/wabt/test/interp/atomic-rmw-or.txt b/tools/external/wabt/test/interp/atomic-rmw-or.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-or.txt rename to tools/external/wabt/test/interp/atomic-rmw-or.txt diff --git a/external/wabt/test/interp/atomic-rmw-sub.txt b/tools/external/wabt/test/interp/atomic-rmw-sub.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-sub.txt rename to tools/external/wabt/test/interp/atomic-rmw-sub.txt diff --git a/external/wabt/test/interp/atomic-rmw-xchg.txt b/tools/external/wabt/test/interp/atomic-rmw-xchg.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-xchg.txt rename to tools/external/wabt/test/interp/atomic-rmw-xchg.txt diff --git a/external/wabt/test/interp/atomic-rmw-xor.txt b/tools/external/wabt/test/interp/atomic-rmw-xor.txt similarity index 100% rename from external/wabt/test/interp/atomic-rmw-xor.txt rename to tools/external/wabt/test/interp/atomic-rmw-xor.txt diff --git a/external/wabt/test/interp/atomic-store.txt b/tools/external/wabt/test/interp/atomic-store.txt similarity index 100% rename from external/wabt/test/interp/atomic-store.txt rename to tools/external/wabt/test/interp/atomic-store.txt diff --git a/external/wabt/test/interp/basic-logging.txt b/tools/external/wabt/test/interp/basic-logging.txt similarity index 100% rename from external/wabt/test/interp/basic-logging.txt rename to tools/external/wabt/test/interp/basic-logging.txt diff --git a/external/wabt/test/interp/basic-tracing.txt b/tools/external/wabt/test/interp/basic-tracing.txt similarity index 100% rename from external/wabt/test/interp/basic-tracing.txt rename to tools/external/wabt/test/interp/basic-tracing.txt diff --git a/external/wabt/test/interp/basic.txt b/tools/external/wabt/test/interp/basic.txt similarity index 100% rename from external/wabt/test/interp/basic.txt rename to tools/external/wabt/test/interp/basic.txt diff --git a/external/wabt/test/interp/binary.txt b/tools/external/wabt/test/interp/binary.txt similarity index 100% rename from external/wabt/test/interp/binary.txt rename to tools/external/wabt/test/interp/binary.txt diff --git a/external/wabt/test/interp/block-multi.txt b/tools/external/wabt/test/interp/block-multi.txt similarity index 100% rename from external/wabt/test/interp/block-multi.txt rename to tools/external/wabt/test/interp/block-multi.txt diff --git a/external/wabt/test/interp/br.txt b/tools/external/wabt/test/interp/br.txt similarity index 100% rename from external/wabt/test/interp/br.txt rename to tools/external/wabt/test/interp/br.txt diff --git a/external/wabt/test/interp/brif-loop.txt b/tools/external/wabt/test/interp/brif-loop.txt similarity index 100% rename from external/wabt/test/interp/brif-loop.txt rename to tools/external/wabt/test/interp/brif-loop.txt diff --git a/external/wabt/test/interp/brif.txt b/tools/external/wabt/test/interp/brif.txt similarity index 100% rename from external/wabt/test/interp/brif.txt rename to tools/external/wabt/test/interp/brif.txt diff --git a/external/wabt/test/interp/brtable.txt b/tools/external/wabt/test/interp/brtable.txt similarity index 100% rename from external/wabt/test/interp/brtable.txt rename to tools/external/wabt/test/interp/brtable.txt diff --git a/external/wabt/test/interp/call-multi-result.txt b/tools/external/wabt/test/interp/call-multi-result.txt similarity index 100% rename from external/wabt/test/interp/call-multi-result.txt rename to tools/external/wabt/test/interp/call-multi-result.txt diff --git a/external/wabt/test/interp/call-zero-args.txt b/tools/external/wabt/test/interp/call-zero-args.txt similarity index 100% rename from external/wabt/test/interp/call-zero-args.txt rename to tools/external/wabt/test/interp/call-zero-args.txt diff --git a/external/wabt/test/interp/call.txt b/tools/external/wabt/test/interp/call.txt similarity index 100% rename from external/wabt/test/interp/call.txt rename to tools/external/wabt/test/interp/call.txt diff --git a/external/wabt/test/interp/callimport-zero-args.txt b/tools/external/wabt/test/interp/callimport-zero-args.txt similarity index 100% rename from external/wabt/test/interp/callimport-zero-args.txt rename to tools/external/wabt/test/interp/callimport-zero-args.txt diff --git a/external/wabt/test/interp/callindirect.txt b/tools/external/wabt/test/interp/callindirect.txt similarity index 100% rename from external/wabt/test/interp/callindirect.txt rename to tools/external/wabt/test/interp/callindirect.txt diff --git a/external/wabt/test/interp/cast.txt b/tools/external/wabt/test/interp/cast.txt similarity index 100% rename from external/wabt/test/interp/cast.txt rename to tools/external/wabt/test/interp/cast.txt diff --git a/external/wabt/test/interp/compare.txt b/tools/external/wabt/test/interp/compare.txt similarity index 100% rename from external/wabt/test/interp/compare.txt rename to tools/external/wabt/test/interp/compare.txt diff --git a/external/wabt/test/interp/convert-sat.txt b/tools/external/wabt/test/interp/convert-sat.txt similarity index 100% rename from external/wabt/test/interp/convert-sat.txt rename to tools/external/wabt/test/interp/convert-sat.txt diff --git a/external/wabt/test/interp/convert.txt b/tools/external/wabt/test/interp/convert.txt similarity index 100% rename from external/wabt/test/interp/convert.txt rename to tools/external/wabt/test/interp/convert.txt diff --git a/external/wabt/test/interp/empty.txt b/tools/external/wabt/test/interp/empty.txt similarity index 100% rename from external/wabt/test/interp/empty.txt rename to tools/external/wabt/test/interp/empty.txt diff --git a/external/wabt/test/interp/expr-block.txt b/tools/external/wabt/test/interp/expr-block.txt similarity index 100% rename from external/wabt/test/interp/expr-block.txt rename to tools/external/wabt/test/interp/expr-block.txt diff --git a/external/wabt/test/interp/expr-br.txt b/tools/external/wabt/test/interp/expr-br.txt similarity index 100% rename from external/wabt/test/interp/expr-br.txt rename to tools/external/wabt/test/interp/expr-br.txt diff --git a/external/wabt/test/interp/expr-brif.txt b/tools/external/wabt/test/interp/expr-brif.txt similarity index 100% rename from external/wabt/test/interp/expr-brif.txt rename to tools/external/wabt/test/interp/expr-brif.txt diff --git a/external/wabt/test/interp/expr-if.txt b/tools/external/wabt/test/interp/expr-if.txt similarity index 100% rename from external/wabt/test/interp/expr-if.txt rename to tools/external/wabt/test/interp/expr-if.txt diff --git a/external/wabt/test/interp/if-multi.txt b/tools/external/wabt/test/interp/if-multi.txt similarity index 100% rename from external/wabt/test/interp/if-multi.txt rename to tools/external/wabt/test/interp/if-multi.txt diff --git a/external/wabt/test/interp/if.txt b/tools/external/wabt/test/interp/if.txt similarity index 100% rename from external/wabt/test/interp/if.txt rename to tools/external/wabt/test/interp/if.txt diff --git a/external/wabt/test/interp/import.txt b/tools/external/wabt/test/interp/import.txt similarity index 100% rename from external/wabt/test/interp/import.txt rename to tools/external/wabt/test/interp/import.txt diff --git a/external/wabt/test/interp/load.txt b/tools/external/wabt/test/interp/load.txt similarity index 100% rename from external/wabt/test/interp/load.txt rename to tools/external/wabt/test/interp/load.txt diff --git a/external/wabt/test/interp/logging-all-opcodes.txt b/tools/external/wabt/test/interp/logging-all-opcodes.txt similarity index 100% rename from external/wabt/test/interp/logging-all-opcodes.txt rename to tools/external/wabt/test/interp/logging-all-opcodes.txt diff --git a/external/wabt/test/interp/loop-multi.txt b/tools/external/wabt/test/interp/loop-multi.txt similarity index 100% rename from external/wabt/test/interp/loop-multi.txt rename to tools/external/wabt/test/interp/loop-multi.txt diff --git a/external/wabt/test/interp/loop.txt b/tools/external/wabt/test/interp/loop.txt similarity index 100% rename from external/wabt/test/interp/loop.txt rename to tools/external/wabt/test/interp/loop.txt diff --git a/external/wabt/test/interp/memory-empty-segment.txt b/tools/external/wabt/test/interp/memory-empty-segment.txt similarity index 100% rename from external/wabt/test/interp/memory-empty-segment.txt rename to tools/external/wabt/test/interp/memory-empty-segment.txt diff --git a/external/wabt/test/interp/nested-if.txt b/tools/external/wabt/test/interp/nested-if.txt similarity index 100% rename from external/wabt/test/interp/nested-if.txt rename to tools/external/wabt/test/interp/nested-if.txt diff --git a/external/wabt/test/interp/return-void.txt b/tools/external/wabt/test/interp/return-void.txt similarity index 100% rename from external/wabt/test/interp/return-void.txt rename to tools/external/wabt/test/interp/return-void.txt diff --git a/external/wabt/test/interp/return.txt b/tools/external/wabt/test/interp/return.txt similarity index 100% rename from external/wabt/test/interp/return.txt rename to tools/external/wabt/test/interp/return.txt diff --git a/external/wabt/test/interp/select.txt b/tools/external/wabt/test/interp/select.txt similarity index 100% rename from external/wabt/test/interp/select.txt rename to tools/external/wabt/test/interp/select.txt diff --git a/external/wabt/test/interp/simd-basic.txt b/tools/external/wabt/test/interp/simd-basic.txt similarity index 100% rename from external/wabt/test/interp/simd-basic.txt rename to tools/external/wabt/test/interp/simd-basic.txt diff --git a/external/wabt/test/interp/simd-binary.txt b/tools/external/wabt/test/interp/simd-binary.txt similarity index 100% rename from external/wabt/test/interp/simd-binary.txt rename to tools/external/wabt/test/interp/simd-binary.txt diff --git a/external/wabt/test/interp/simd-bitselect.txt b/tools/external/wabt/test/interp/simd-bitselect.txt similarity index 100% rename from external/wabt/test/interp/simd-bitselect.txt rename to tools/external/wabt/test/interp/simd-bitselect.txt diff --git a/external/wabt/test/interp/simd-compare.txt b/tools/external/wabt/test/interp/simd-compare.txt similarity index 100% rename from external/wabt/test/interp/simd-compare.txt rename to tools/external/wabt/test/interp/simd-compare.txt diff --git a/external/wabt/test/interp/simd-lane.txt b/tools/external/wabt/test/interp/simd-lane.txt similarity index 100% rename from external/wabt/test/interp/simd-lane.txt rename to tools/external/wabt/test/interp/simd-lane.txt diff --git a/external/wabt/test/interp/simd-load-store.txt b/tools/external/wabt/test/interp/simd-load-store.txt similarity index 100% rename from external/wabt/test/interp/simd-load-store.txt rename to tools/external/wabt/test/interp/simd-load-store.txt diff --git a/external/wabt/test/interp/simd-shift.txt b/tools/external/wabt/test/interp/simd-shift.txt similarity index 100% rename from external/wabt/test/interp/simd-shift.txt rename to tools/external/wabt/test/interp/simd-shift.txt diff --git a/external/wabt/test/interp/simd-splat.txt b/tools/external/wabt/test/interp/simd-splat.txt similarity index 100% rename from external/wabt/test/interp/simd-splat.txt rename to tools/external/wabt/test/interp/simd-splat.txt diff --git a/external/wabt/test/interp/simd-unary.txt b/tools/external/wabt/test/interp/simd-unary.txt similarity index 100% rename from external/wabt/test/interp/simd-unary.txt rename to tools/external/wabt/test/interp/simd-unary.txt diff --git a/external/wabt/test/interp/start.txt b/tools/external/wabt/test/interp/start.txt similarity index 100% rename from external/wabt/test/interp/start.txt rename to tools/external/wabt/test/interp/start.txt diff --git a/external/wabt/test/interp/store.txt b/tools/external/wabt/test/interp/store.txt similarity index 100% rename from external/wabt/test/interp/store.txt rename to tools/external/wabt/test/interp/store.txt diff --git a/external/wabt/test/interp/tracing-all-opcodes.txt b/tools/external/wabt/test/interp/tracing-all-opcodes.txt similarity index 100% rename from external/wabt/test/interp/tracing-all-opcodes.txt rename to tools/external/wabt/test/interp/tracing-all-opcodes.txt diff --git a/external/wabt/test/interp/trap-with-callstack.txt b/tools/external/wabt/test/interp/trap-with-callstack.txt similarity index 100% rename from external/wabt/test/interp/trap-with-callstack.txt rename to tools/external/wabt/test/interp/trap-with-callstack.txt diff --git a/external/wabt/test/interp/unary-extend.txt b/tools/external/wabt/test/interp/unary-extend.txt similarity index 100% rename from external/wabt/test/interp/unary-extend.txt rename to tools/external/wabt/test/interp/unary-extend.txt diff --git a/external/wabt/test/interp/unary.txt b/tools/external/wabt/test/interp/unary.txt similarity index 100% rename from external/wabt/test/interp/unary.txt rename to tools/external/wabt/test/interp/unary.txt diff --git a/external/wabt/test/interp/unreachable.txt b/tools/external/wabt/test/interp/unreachable.txt similarity index 100% rename from external/wabt/test/interp/unreachable.txt rename to tools/external/wabt/test/interp/unreachable.txt diff --git a/external/wabt/test/opcodecnt/basic.txt b/tools/external/wabt/test/opcodecnt/basic.txt similarity index 100% rename from external/wabt/test/opcodecnt/basic.txt rename to tools/external/wabt/test/opcodecnt/basic.txt diff --git a/external/wabt/test/opcodecnt/cutoff.txt b/tools/external/wabt/test/opcodecnt/cutoff.txt similarity index 100% rename from external/wabt/test/opcodecnt/cutoff.txt rename to tools/external/wabt/test/opcodecnt/cutoff.txt diff --git a/external/wabt/test/opcodecnt/immediates.txt b/tools/external/wabt/test/opcodecnt/immediates.txt similarity index 100% rename from external/wabt/test/opcodecnt/immediates.txt rename to tools/external/wabt/test/opcodecnt/immediates.txt diff --git a/external/wabt/test/parse/assert/assert-after-module.txt b/tools/external/wabt/test/parse/assert/assert-after-module.txt similarity index 100% rename from external/wabt/test/parse/assert/assert-after-module.txt rename to tools/external/wabt/test/parse/assert/assert-after-module.txt diff --git a/external/wabt/test/parse/assert/assert-return-arithmetic-nan.txt b/tools/external/wabt/test/parse/assert/assert-return-arithmetic-nan.txt similarity index 100% rename from external/wabt/test/parse/assert/assert-return-arithmetic-nan.txt rename to tools/external/wabt/test/parse/assert/assert-return-arithmetic-nan.txt diff --git a/external/wabt/test/parse/assert/assert-return-canonical-nan.txt b/tools/external/wabt/test/parse/assert/assert-return-canonical-nan.txt similarity index 100% rename from external/wabt/test/parse/assert/assert-return-canonical-nan.txt rename to tools/external/wabt/test/parse/assert/assert-return-canonical-nan.txt diff --git a/external/wabt/test/parse/assert/assertinvalid-binary-module.txt b/tools/external/wabt/test/parse/assert/assertinvalid-binary-module.txt similarity index 100% rename from external/wabt/test/parse/assert/assertinvalid-binary-module.txt rename to tools/external/wabt/test/parse/assert/assertinvalid-binary-module.txt diff --git a/external/wabt/test/parse/assert/assertinvalid.txt b/tools/external/wabt/test/parse/assert/assertinvalid.txt similarity index 100% rename from external/wabt/test/parse/assert/assertinvalid.txt rename to tools/external/wabt/test/parse/assert/assertinvalid.txt diff --git a/external/wabt/test/parse/assert/assertmalformed.txt b/tools/external/wabt/test/parse/assert/assertmalformed.txt similarity index 100% rename from external/wabt/test/parse/assert/assertmalformed.txt rename to tools/external/wabt/test/parse/assert/assertmalformed.txt diff --git a/external/wabt/test/parse/assert/assertreturn.txt b/tools/external/wabt/test/parse/assert/assertreturn.txt similarity index 100% rename from external/wabt/test/parse/assert/assertreturn.txt rename to tools/external/wabt/test/parse/assert/assertreturn.txt diff --git a/external/wabt/test/parse/assert/bad-assert-before-module.txt b/tools/external/wabt/test/parse/assert/bad-assert-before-module.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-before-module.txt rename to tools/external/wabt/test/parse/assert/bad-assert-before-module.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-invalid-return-type.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-few.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-too-many.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-arithmetic-nan-unknown-function.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-invalid-return-type.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-few.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-too-many.txt diff --git a/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt b/tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt rename to tools/external/wabt/test/parse/assert/bad-assert-return-canonical-nan-unknown-function.txt diff --git a/external/wabt/test/parse/assert/bad-assertreturn-non-const.txt b/tools/external/wabt/test/parse/assert/bad-assertreturn-non-const.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assertreturn-non-const.txt rename to tools/external/wabt/test/parse/assert/bad-assertreturn-non-const.txt diff --git a/external/wabt/test/parse/assert/bad-assertreturn-too-few.txt b/tools/external/wabt/test/parse/assert/bad-assertreturn-too-few.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assertreturn-too-few.txt rename to tools/external/wabt/test/parse/assert/bad-assertreturn-too-few.txt diff --git a/external/wabt/test/parse/assert/bad-assertreturn-too-many.txt b/tools/external/wabt/test/parse/assert/bad-assertreturn-too-many.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assertreturn-too-many.txt rename to tools/external/wabt/test/parse/assert/bad-assertreturn-too-many.txt diff --git a/external/wabt/test/parse/assert/bad-assertreturn-unknown-function.txt b/tools/external/wabt/test/parse/assert/bad-assertreturn-unknown-function.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-assertreturn-unknown-function.txt rename to tools/external/wabt/test/parse/assert/bad-assertreturn-unknown-function.txt diff --git a/external/wabt/test/parse/assert/bad-invoke-no-module.txt b/tools/external/wabt/test/parse/assert/bad-invoke-no-module.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-invoke-no-module.txt rename to tools/external/wabt/test/parse/assert/bad-invoke-no-module.txt diff --git a/external/wabt/test/parse/assert/bad-invoke-too-few.txt b/tools/external/wabt/test/parse/assert/bad-invoke-too-few.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-invoke-too-few.txt rename to tools/external/wabt/test/parse/assert/bad-invoke-too-few.txt diff --git a/external/wabt/test/parse/assert/bad-invoke-too-many.txt b/tools/external/wabt/test/parse/assert/bad-invoke-too-many.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-invoke-too-many.txt rename to tools/external/wabt/test/parse/assert/bad-invoke-too-many.txt diff --git a/external/wabt/test/parse/assert/bad-invoke-unknown-function.txt b/tools/external/wabt/test/parse/assert/bad-invoke-unknown-function.txt similarity index 100% rename from external/wabt/test/parse/assert/bad-invoke-unknown-function.txt rename to tools/external/wabt/test/parse/assert/bad-invoke-unknown-function.txt diff --git a/external/wabt/test/parse/assert/invoke.txt b/tools/external/wabt/test/parse/assert/invoke.txt similarity index 100% rename from external/wabt/test/parse/assert/invoke.txt rename to tools/external/wabt/test/parse/assert/invoke.txt diff --git a/external/wabt/test/parse/bad-crlf.txt b/tools/external/wabt/test/parse/bad-crlf.txt similarity index 100% rename from external/wabt/test/parse/bad-crlf.txt rename to tools/external/wabt/test/parse/bad-crlf.txt diff --git a/external/wabt/test/parse/bad-error-long-line.txt b/tools/external/wabt/test/parse/bad-error-long-line.txt similarity index 100% rename from external/wabt/test/parse/bad-error-long-line.txt rename to tools/external/wabt/test/parse/bad-error-long-line.txt diff --git a/external/wabt/test/parse/bad-error-long-token.txt b/tools/external/wabt/test/parse/bad-error-long-token.txt similarity index 100% rename from external/wabt/test/parse/bad-error-long-token.txt rename to tools/external/wabt/test/parse/bad-error-long-token.txt diff --git a/external/wabt/test/parse/bad-single-semicolon.txt b/tools/external/wabt/test/parse/bad-single-semicolon.txt similarity index 100% rename from external/wabt/test/parse/bad-single-semicolon.txt rename to tools/external/wabt/test/parse/bad-single-semicolon.txt diff --git a/external/wabt/test/parse/bad-string-eof.txt b/tools/external/wabt/test/parse/bad-string-eof.txt similarity index 100% rename from external/wabt/test/parse/bad-string-eof.txt rename to tools/external/wabt/test/parse/bad-string-eof.txt diff --git a/external/wabt/test/parse/bad-string-escape.txt b/tools/external/wabt/test/parse/bad-string-escape.txt similarity index 100% rename from external/wabt/test/parse/bad-string-escape.txt rename to tools/external/wabt/test/parse/bad-string-escape.txt diff --git a/external/wabt/test/parse/bad-string-hex-escape.txt b/tools/external/wabt/test/parse/bad-string-hex-escape.txt similarity index 100% rename from external/wabt/test/parse/bad-string-hex-escape.txt rename to tools/external/wabt/test/parse/bad-string-hex-escape.txt diff --git a/external/wabt/test/parse/bad-toplevel.txt b/tools/external/wabt/test/parse/bad-toplevel.txt similarity index 100% rename from external/wabt/test/parse/bad-toplevel.txt rename to tools/external/wabt/test/parse/bad-toplevel.txt diff --git a/external/wabt/test/parse/basic.txt b/tools/external/wabt/test/parse/basic.txt similarity index 100% rename from external/wabt/test/parse/basic.txt rename to tools/external/wabt/test/parse/basic.txt diff --git a/external/wabt/test/parse/empty-file.txt b/tools/external/wabt/test/parse/empty-file.txt similarity index 100% rename from external/wabt/test/parse/empty-file.txt rename to tools/external/wabt/test/parse/empty-file.txt diff --git a/external/wabt/test/parse/export-mutable-global.txt b/tools/external/wabt/test/parse/export-mutable-global.txt similarity index 100% rename from external/wabt/test/parse/export-mutable-global.txt rename to tools/external/wabt/test/parse/export-mutable-global.txt diff --git a/external/wabt/test/parse/expr/atomic-align.txt b/tools/external/wabt/test/parse/expr/atomic-align.txt similarity index 100% rename from external/wabt/test/parse/expr/atomic-align.txt rename to tools/external/wabt/test/parse/expr/atomic-align.txt diff --git a/external/wabt/test/parse/expr/atomic-disabled.txt b/tools/external/wabt/test/parse/expr/atomic-disabled.txt similarity index 100% rename from external/wabt/test/parse/expr/atomic-disabled.txt rename to tools/external/wabt/test/parse/expr/atomic-disabled.txt diff --git a/external/wabt/test/parse/expr/atomic.txt b/tools/external/wabt/test/parse/expr/atomic.txt similarity index 100% rename from external/wabt/test/parse/expr/atomic.txt rename to tools/external/wabt/test/parse/expr/atomic.txt diff --git a/external/wabt/test/parse/expr/bad-atomic-unnatural-align.txt b/tools/external/wabt/test/parse/expr/bad-atomic-unnatural-align.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-atomic-unnatural-align.txt rename to tools/external/wabt/test/parse/expr/bad-atomic-unnatural-align.txt diff --git a/external/wabt/test/parse/expr/bad-binary-one-expr.txt b/tools/external/wabt/test/parse/expr/bad-binary-one-expr.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-binary-one-expr.txt rename to tools/external/wabt/test/parse/expr/bad-binary-one-expr.txt diff --git a/external/wabt/test/parse/expr/bad-block-end-label.txt b/tools/external/wabt/test/parse/expr/bad-block-end-label.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-block-end-label.txt rename to tools/external/wabt/test/parse/expr/bad-block-end-label.txt diff --git a/external/wabt/test/parse/expr/bad-block-mismatch-label.txt b/tools/external/wabt/test/parse/expr/bad-block-mismatch-label.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-block-mismatch-label.txt rename to tools/external/wabt/test/parse/expr/bad-block-mismatch-label.txt diff --git a/external/wabt/test/parse/expr/bad-block-sig-multi.txt b/tools/external/wabt/test/parse/expr/bad-block-sig-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-block-sig-multi.txt rename to tools/external/wabt/test/parse/expr/bad-block-sig-multi.txt diff --git a/external/wabt/test/parse/expr/bad-br-bad-depth.txt b/tools/external/wabt/test/parse/expr/bad-br-bad-depth.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-br-bad-depth.txt rename to tools/external/wabt/test/parse/expr/bad-br-bad-depth.txt diff --git a/external/wabt/test/parse/expr/bad-br-defined-later.txt b/tools/external/wabt/test/parse/expr/bad-br-defined-later.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-br-defined-later.txt rename to tools/external/wabt/test/parse/expr/bad-br-defined-later.txt diff --git a/external/wabt/test/parse/expr/bad-br-name-undefined.txt b/tools/external/wabt/test/parse/expr/bad-br-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-br-name-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-br-name-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-br-name.txt b/tools/external/wabt/test/parse/expr/bad-br-name.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-br-name.txt rename to tools/external/wabt/test/parse/expr/bad-br-name.txt diff --git a/external/wabt/test/parse/expr/bad-br-no-depth.txt b/tools/external/wabt/test/parse/expr/bad-br-no-depth.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-br-no-depth.txt rename to tools/external/wabt/test/parse/expr/bad-br-no-depth.txt diff --git a/external/wabt/test/parse/expr/bad-br-undefined.txt b/tools/external/wabt/test/parse/expr/bad-br-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-br-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-br-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-brtable-bad-depth.txt b/tools/external/wabt/test/parse/expr/bad-brtable-bad-depth.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-brtable-bad-depth.txt rename to tools/external/wabt/test/parse/expr/bad-brtable-bad-depth.txt diff --git a/external/wabt/test/parse/expr/bad-compare-one-expr.txt b/tools/external/wabt/test/parse/expr/bad-compare-one-expr.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-compare-one-expr.txt rename to tools/external/wabt/test/parse/expr/bad-compare-one-expr.txt diff --git a/external/wabt/test/parse/expr/bad-const-f32-trailing.txt b/tools/external/wabt/test/parse/expr/bad-const-f32-trailing.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-f32-trailing.txt rename to tools/external/wabt/test/parse/expr/bad-const-f32-trailing.txt diff --git a/external/wabt/test/parse/expr/bad-const-i32-garbage.txt b/tools/external/wabt/test/parse/expr/bad-const-i32-garbage.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-i32-garbage.txt rename to tools/external/wabt/test/parse/expr/bad-const-i32-garbage.txt diff --git a/external/wabt/test/parse/expr/bad-const-i32-just-negative-sign.txt b/tools/external/wabt/test/parse/expr/bad-const-i32-just-negative-sign.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-i32-just-negative-sign.txt rename to tools/external/wabt/test/parse/expr/bad-const-i32-just-negative-sign.txt diff --git a/external/wabt/test/parse/expr/bad-const-i32-overflow.txt b/tools/external/wabt/test/parse/expr/bad-const-i32-overflow.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-i32-overflow.txt rename to tools/external/wabt/test/parse/expr/bad-const-i32-overflow.txt diff --git a/external/wabt/test/parse/expr/bad-const-i32-trailing.txt b/tools/external/wabt/test/parse/expr/bad-const-i32-trailing.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-i32-trailing.txt rename to tools/external/wabt/test/parse/expr/bad-const-i32-trailing.txt diff --git a/external/wabt/test/parse/expr/bad-const-i32-underflow.txt b/tools/external/wabt/test/parse/expr/bad-const-i32-underflow.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-i32-underflow.txt rename to tools/external/wabt/test/parse/expr/bad-const-i32-underflow.txt diff --git a/external/wabt/test/parse/expr/bad-const-i64-overflow.txt b/tools/external/wabt/test/parse/expr/bad-const-i64-overflow.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-i64-overflow.txt rename to tools/external/wabt/test/parse/expr/bad-const-i64-overflow.txt diff --git a/external/wabt/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt b/tools/external/wabt/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt rename to tools/external/wabt/test/parse/expr/bad-const-type-i32-in-non-simd-const.txt diff --git a/external/wabt/test/parse/expr/bad-const-v128-nat-expected.txt b/tools/external/wabt/test/parse/expr/bad-const-v128-nat-expected.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-v128-nat-expected.txt rename to tools/external/wabt/test/parse/expr/bad-const-v128-nat-expected.txt diff --git a/external/wabt/test/parse/expr/bad-const-v128-nat-overflow.txt b/tools/external/wabt/test/parse/expr/bad-const-v128-nat-overflow.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-v128-nat-overflow.txt rename to tools/external/wabt/test/parse/expr/bad-const-v128-nat-overflow.txt diff --git a/external/wabt/test/parse/expr/bad-const-v128-type-i32-expected.txt b/tools/external/wabt/test/parse/expr/bad-const-v128-type-i32-expected.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-const-v128-type-i32-expected.txt rename to tools/external/wabt/test/parse/expr/bad-const-v128-type-i32-expected.txt diff --git a/external/wabt/test/parse/expr/bad-convert-float-sign.txt b/tools/external/wabt/test/parse/expr/bad-convert-float-sign.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-convert-float-sign.txt rename to tools/external/wabt/test/parse/expr/bad-convert-float-sign.txt diff --git a/external/wabt/test/parse/expr/bad-convert-int-no-sign.txt b/tools/external/wabt/test/parse/expr/bad-convert-int-no-sign.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-convert-int-no-sign.txt rename to tools/external/wabt/test/parse/expr/bad-convert-int-no-sign.txt diff --git a/external/wabt/test/parse/expr/bad-getglobal-name-undefined.txt b/tools/external/wabt/test/parse/expr/bad-getglobal-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-getglobal-name-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-getglobal-name-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-getglobal-undefined.txt b/tools/external/wabt/test/parse/expr/bad-getglobal-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-getglobal-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-getglobal-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-getlocal-name-undefined.txt b/tools/external/wabt/test/parse/expr/bad-getlocal-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-getlocal-name-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-getlocal-name-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-getlocal-name.txt b/tools/external/wabt/test/parse/expr/bad-getlocal-name.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-getlocal-name.txt rename to tools/external/wabt/test/parse/expr/bad-getlocal-name.txt diff --git a/external/wabt/test/parse/expr/bad-getlocal-undefined.txt b/tools/external/wabt/test/parse/expr/bad-getlocal-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-getlocal-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-getlocal-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-if-end-label.txt b/tools/external/wabt/test/parse/expr/bad-if-end-label.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-if-end-label.txt rename to tools/external/wabt/test/parse/expr/bad-if-end-label.txt diff --git a/external/wabt/test/parse/expr/bad-if-mismatch-label.txt b/tools/external/wabt/test/parse/expr/bad-if-mismatch-label.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-if-mismatch-label.txt rename to tools/external/wabt/test/parse/expr/bad-if-mismatch-label.txt diff --git a/external/wabt/test/parse/expr/bad-if-no-then.txt b/tools/external/wabt/test/parse/expr/bad-if-no-then.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-if-no-then.txt rename to tools/external/wabt/test/parse/expr/bad-if-no-then.txt diff --git a/external/wabt/test/parse/expr/bad-if-sig-multi.txt b/tools/external/wabt/test/parse/expr/bad-if-sig-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-if-sig-multi.txt rename to tools/external/wabt/test/parse/expr/bad-if-sig-multi.txt diff --git a/external/wabt/test/parse/expr/bad-if_except-sig-multi.txt b/tools/external/wabt/test/parse/expr/bad-if_except-sig-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-if_except-sig-multi.txt rename to tools/external/wabt/test/parse/expr/bad-if_except-sig-multi.txt diff --git a/external/wabt/test/parse/expr/bad-load-align-misspelled.txt b/tools/external/wabt/test/parse/expr/bad-load-align-misspelled.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-align-misspelled.txt rename to tools/external/wabt/test/parse/expr/bad-load-align-misspelled.txt diff --git a/external/wabt/test/parse/expr/bad-load-align-negative.txt b/tools/external/wabt/test/parse/expr/bad-load-align-negative.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-align-negative.txt rename to tools/external/wabt/test/parse/expr/bad-load-align-negative.txt diff --git a/external/wabt/test/parse/expr/bad-load-align-not-pot.txt b/tools/external/wabt/test/parse/expr/bad-load-align-not-pot.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-align-not-pot.txt rename to tools/external/wabt/test/parse/expr/bad-load-align-not-pot.txt diff --git a/external/wabt/test/parse/expr/bad-load-align.txt b/tools/external/wabt/test/parse/expr/bad-load-align.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-align.txt rename to tools/external/wabt/test/parse/expr/bad-load-align.txt diff --git a/external/wabt/test/parse/expr/bad-load-float-sign.txt b/tools/external/wabt/test/parse/expr/bad-load-float-sign.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-float-sign.txt rename to tools/external/wabt/test/parse/expr/bad-load-float-sign.txt diff --git a/external/wabt/test/parse/expr/bad-load-offset-negative.txt b/tools/external/wabt/test/parse/expr/bad-load-offset-negative.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-offset-negative.txt rename to tools/external/wabt/test/parse/expr/bad-load-offset-negative.txt diff --git a/external/wabt/test/parse/expr/bad-load-type.txt b/tools/external/wabt/test/parse/expr/bad-load-type.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-load-type.txt rename to tools/external/wabt/test/parse/expr/bad-load-type.txt diff --git a/external/wabt/test/parse/expr/bad-loop-end-label.txt b/tools/external/wabt/test/parse/expr/bad-loop-end-label.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-loop-end-label.txt rename to tools/external/wabt/test/parse/expr/bad-loop-end-label.txt diff --git a/external/wabt/test/parse/expr/bad-loop-mismatch-label.txt b/tools/external/wabt/test/parse/expr/bad-loop-mismatch-label.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-loop-mismatch-label.txt rename to tools/external/wabt/test/parse/expr/bad-loop-mismatch-label.txt diff --git a/external/wabt/test/parse/expr/bad-loop-sig-multi.txt b/tools/external/wabt/test/parse/expr/bad-loop-sig-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-loop-sig-multi.txt rename to tools/external/wabt/test/parse/expr/bad-loop-sig-multi.txt diff --git a/external/wabt/test/parse/expr/bad-nop.txt b/tools/external/wabt/test/parse/expr/bad-nop.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-nop.txt rename to tools/external/wabt/test/parse/expr/bad-nop.txt diff --git a/external/wabt/test/parse/expr/bad-return-multi.txt b/tools/external/wabt/test/parse/expr/bad-return-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-return-multi.txt rename to tools/external/wabt/test/parse/expr/bad-return-multi.txt diff --git a/external/wabt/test/parse/expr/bad-setglobal-name-undefined.txt b/tools/external/wabt/test/parse/expr/bad-setglobal-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-setglobal-name-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-setglobal-name-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-setglobal-undefined.txt b/tools/external/wabt/test/parse/expr/bad-setglobal-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-setglobal-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-setglobal-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-setlocal-name-undefined.txt b/tools/external/wabt/test/parse/expr/bad-setlocal-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-setlocal-name-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-setlocal-name-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-setlocal-name.txt b/tools/external/wabt/test/parse/expr/bad-setlocal-name.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-setlocal-name.txt rename to tools/external/wabt/test/parse/expr/bad-setlocal-name.txt diff --git a/external/wabt/test/parse/expr/bad-setlocal-no-value.txt b/tools/external/wabt/test/parse/expr/bad-setlocal-no-value.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-setlocal-no-value.txt rename to tools/external/wabt/test/parse/expr/bad-setlocal-no-value.txt diff --git a/external/wabt/test/parse/expr/bad-setlocal-undefined.txt b/tools/external/wabt/test/parse/expr/bad-setlocal-undefined.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-setlocal-undefined.txt rename to tools/external/wabt/test/parse/expr/bad-setlocal-undefined.txt diff --git a/external/wabt/test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt b/tools/external/wabt/test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt rename to tools/external/wabt/test/parse/expr/bad-simd-shuffle-lane-index-overflow.txt diff --git a/external/wabt/test/parse/expr/bad-simd-shuffle-nat-expected.txt b/tools/external/wabt/test/parse/expr/bad-simd-shuffle-nat-expected.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-simd-shuffle-nat-expected.txt rename to tools/external/wabt/test/parse/expr/bad-simd-shuffle-nat-expected.txt diff --git a/external/wabt/test/parse/expr/bad-store-align-not-pot.txt b/tools/external/wabt/test/parse/expr/bad-store-align-not-pot.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-store-align-not-pot.txt rename to tools/external/wabt/test/parse/expr/bad-store-align-not-pot.txt diff --git a/external/wabt/test/parse/expr/bad-store-align.txt b/tools/external/wabt/test/parse/expr/bad-store-align.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-store-align.txt rename to tools/external/wabt/test/parse/expr/bad-store-align.txt diff --git a/external/wabt/test/parse/expr/bad-store-float.sign.txt b/tools/external/wabt/test/parse/expr/bad-store-float.sign.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-store-float.sign.txt rename to tools/external/wabt/test/parse/expr/bad-store-float.sign.txt diff --git a/external/wabt/test/parse/expr/bad-store-offset-negative.txt b/tools/external/wabt/test/parse/expr/bad-store-offset-negative.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-store-offset-negative.txt rename to tools/external/wabt/test/parse/expr/bad-store-offset-negative.txt diff --git a/external/wabt/test/parse/expr/bad-store-type.txt b/tools/external/wabt/test/parse/expr/bad-store-type.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-store-type.txt rename to tools/external/wabt/test/parse/expr/bad-store-type.txt diff --git a/external/wabt/test/parse/expr/bad-try-multiple-catch.txt b/tools/external/wabt/test/parse/expr/bad-try-multiple-catch.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-try-multiple-catch.txt rename to tools/external/wabt/test/parse/expr/bad-try-multiple-catch.txt diff --git a/external/wabt/test/parse/expr/bad-try-no-catch.txt b/tools/external/wabt/test/parse/expr/bad-try-no-catch.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-try-no-catch.txt rename to tools/external/wabt/test/parse/expr/bad-try-no-catch.txt diff --git a/external/wabt/test/parse/expr/bad-try-sig-multi.txt b/tools/external/wabt/test/parse/expr/bad-try-sig-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-try-sig-multi.txt rename to tools/external/wabt/test/parse/expr/bad-try-sig-multi.txt diff --git a/external/wabt/test/parse/expr/bad-unexpected.txt b/tools/external/wabt/test/parse/expr/bad-unexpected.txt similarity index 100% rename from external/wabt/test/parse/expr/bad-unexpected.txt rename to tools/external/wabt/test/parse/expr/bad-unexpected.txt diff --git a/external/wabt/test/parse/expr/binary.txt b/tools/external/wabt/test/parse/expr/binary.txt similarity index 100% rename from external/wabt/test/parse/expr/binary.txt rename to tools/external/wabt/test/parse/expr/binary.txt diff --git a/external/wabt/test/parse/expr/block-multi.txt b/tools/external/wabt/test/parse/expr/block-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/block-multi.txt rename to tools/external/wabt/test/parse/expr/block-multi.txt diff --git a/external/wabt/test/parse/expr/block-named.txt b/tools/external/wabt/test/parse/expr/block-named.txt similarity index 100% rename from external/wabt/test/parse/expr/block-named.txt rename to tools/external/wabt/test/parse/expr/block-named.txt diff --git a/external/wabt/test/parse/expr/block-return.txt b/tools/external/wabt/test/parse/expr/block-return.txt similarity index 100% rename from external/wabt/test/parse/expr/block-return.txt rename to tools/external/wabt/test/parse/expr/block-return.txt diff --git a/external/wabt/test/parse/expr/block.txt b/tools/external/wabt/test/parse/expr/block.txt similarity index 100% rename from external/wabt/test/parse/expr/block.txt rename to tools/external/wabt/test/parse/expr/block.txt diff --git a/external/wabt/test/parse/expr/br-block.txt b/tools/external/wabt/test/parse/expr/br-block.txt similarity index 100% rename from external/wabt/test/parse/expr/br-block.txt rename to tools/external/wabt/test/parse/expr/br-block.txt diff --git a/external/wabt/test/parse/expr/br-loop.txt b/tools/external/wabt/test/parse/expr/br-loop.txt similarity index 100% rename from external/wabt/test/parse/expr/br-loop.txt rename to tools/external/wabt/test/parse/expr/br-loop.txt diff --git a/external/wabt/test/parse/expr/br-named.txt b/tools/external/wabt/test/parse/expr/br-named.txt similarity index 100% rename from external/wabt/test/parse/expr/br-named.txt rename to tools/external/wabt/test/parse/expr/br-named.txt diff --git a/external/wabt/test/parse/expr/br.txt b/tools/external/wabt/test/parse/expr/br.txt similarity index 100% rename from external/wabt/test/parse/expr/br.txt rename to tools/external/wabt/test/parse/expr/br.txt diff --git a/external/wabt/test/parse/expr/brif-named.txt b/tools/external/wabt/test/parse/expr/brif-named.txt similarity index 100% rename from external/wabt/test/parse/expr/brif-named.txt rename to tools/external/wabt/test/parse/expr/brif-named.txt diff --git a/external/wabt/test/parse/expr/brif.txt b/tools/external/wabt/test/parse/expr/brif.txt similarity index 100% rename from external/wabt/test/parse/expr/brif.txt rename to tools/external/wabt/test/parse/expr/brif.txt diff --git a/external/wabt/test/parse/expr/brtable-multi.txt b/tools/external/wabt/test/parse/expr/brtable-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/brtable-multi.txt rename to tools/external/wabt/test/parse/expr/brtable-multi.txt diff --git a/external/wabt/test/parse/expr/brtable-named.txt b/tools/external/wabt/test/parse/expr/brtable-named.txt similarity index 100% rename from external/wabt/test/parse/expr/brtable-named.txt rename to tools/external/wabt/test/parse/expr/brtable-named.txt diff --git a/external/wabt/test/parse/expr/brtable.txt b/tools/external/wabt/test/parse/expr/brtable.txt similarity index 100% rename from external/wabt/test/parse/expr/brtable.txt rename to tools/external/wabt/test/parse/expr/brtable.txt diff --git a/external/wabt/test/parse/expr/call-defined-later.txt b/tools/external/wabt/test/parse/expr/call-defined-later.txt similarity index 100% rename from external/wabt/test/parse/expr/call-defined-later.txt rename to tools/external/wabt/test/parse/expr/call-defined-later.txt diff --git a/external/wabt/test/parse/expr/call-name-prefix.txt b/tools/external/wabt/test/parse/expr/call-name-prefix.txt similarity index 100% rename from external/wabt/test/parse/expr/call-name-prefix.txt rename to tools/external/wabt/test/parse/expr/call-name-prefix.txt diff --git a/external/wabt/test/parse/expr/call-named.txt b/tools/external/wabt/test/parse/expr/call-named.txt similarity index 100% rename from external/wabt/test/parse/expr/call-named.txt rename to tools/external/wabt/test/parse/expr/call-named.txt diff --git a/external/wabt/test/parse/expr/call.txt b/tools/external/wabt/test/parse/expr/call.txt similarity index 100% rename from external/wabt/test/parse/expr/call.txt rename to tools/external/wabt/test/parse/expr/call.txt diff --git a/external/wabt/test/parse/expr/callimport-defined-later.txt b/tools/external/wabt/test/parse/expr/callimport-defined-later.txt similarity index 100% rename from external/wabt/test/parse/expr/callimport-defined-later.txt rename to tools/external/wabt/test/parse/expr/callimport-defined-later.txt diff --git a/external/wabt/test/parse/expr/callimport-named.txt b/tools/external/wabt/test/parse/expr/callimport-named.txt similarity index 100% rename from external/wabt/test/parse/expr/callimport-named.txt rename to tools/external/wabt/test/parse/expr/callimport-named.txt diff --git a/external/wabt/test/parse/expr/callimport-type.txt b/tools/external/wabt/test/parse/expr/callimport-type.txt similarity index 100% rename from external/wabt/test/parse/expr/callimport-type.txt rename to tools/external/wabt/test/parse/expr/callimport-type.txt diff --git a/external/wabt/test/parse/expr/callimport.txt b/tools/external/wabt/test/parse/expr/callimport.txt similarity index 100% rename from external/wabt/test/parse/expr/callimport.txt rename to tools/external/wabt/test/parse/expr/callimport.txt diff --git a/external/wabt/test/parse/expr/callindirect-named.txt b/tools/external/wabt/test/parse/expr/callindirect-named.txt similarity index 100% rename from external/wabt/test/parse/expr/callindirect-named.txt rename to tools/external/wabt/test/parse/expr/callindirect-named.txt diff --git a/external/wabt/test/parse/expr/callindirect.txt b/tools/external/wabt/test/parse/expr/callindirect.txt similarity index 100% rename from external/wabt/test/parse/expr/callindirect.txt rename to tools/external/wabt/test/parse/expr/callindirect.txt diff --git a/external/wabt/test/parse/expr/cast.txt b/tools/external/wabt/test/parse/expr/cast.txt similarity index 100% rename from external/wabt/test/parse/expr/cast.txt rename to tools/external/wabt/test/parse/expr/cast.txt diff --git a/external/wabt/test/parse/expr/compare.txt b/tools/external/wabt/test/parse/expr/compare.txt similarity index 100% rename from external/wabt/test/parse/expr/compare.txt rename to tools/external/wabt/test/parse/expr/compare.txt diff --git a/external/wabt/test/parse/expr/const.txt b/tools/external/wabt/test/parse/expr/const.txt similarity index 100% rename from external/wabt/test/parse/expr/const.txt rename to tools/external/wabt/test/parse/expr/const.txt diff --git a/external/wabt/test/parse/expr/convert-sat-disabled.txt b/tools/external/wabt/test/parse/expr/convert-sat-disabled.txt similarity index 100% rename from external/wabt/test/parse/expr/convert-sat-disabled.txt rename to tools/external/wabt/test/parse/expr/convert-sat-disabled.txt diff --git a/external/wabt/test/parse/expr/convert-sat.txt b/tools/external/wabt/test/parse/expr/convert-sat.txt similarity index 100% rename from external/wabt/test/parse/expr/convert-sat.txt rename to tools/external/wabt/test/parse/expr/convert-sat.txt diff --git a/external/wabt/test/parse/expr/convert.txt b/tools/external/wabt/test/parse/expr/convert.txt similarity index 100% rename from external/wabt/test/parse/expr/convert.txt rename to tools/external/wabt/test/parse/expr/convert.txt diff --git a/external/wabt/test/parse/expr/current-memory.txt b/tools/external/wabt/test/parse/expr/current-memory.txt similarity index 100% rename from external/wabt/test/parse/expr/current-memory.txt rename to tools/external/wabt/test/parse/expr/current-memory.txt diff --git a/external/wabt/test/parse/expr/drop.txt b/tools/external/wabt/test/parse/expr/drop.txt similarity index 100% rename from external/wabt/test/parse/expr/drop.txt rename to tools/external/wabt/test/parse/expr/drop.txt diff --git a/external/wabt/test/parse/expr/exceptions-disabled.txt b/tools/external/wabt/test/parse/expr/exceptions-disabled.txt similarity index 100% rename from external/wabt/test/parse/expr/exceptions-disabled.txt rename to tools/external/wabt/test/parse/expr/exceptions-disabled.txt diff --git a/external/wabt/test/parse/expr/expr-br.txt b/tools/external/wabt/test/parse/expr/expr-br.txt similarity index 100% rename from external/wabt/test/parse/expr/expr-br.txt rename to tools/external/wabt/test/parse/expr/expr-br.txt diff --git a/external/wabt/test/parse/expr/expr-brif.txt b/tools/external/wabt/test/parse/expr/expr-brif.txt similarity index 100% rename from external/wabt/test/parse/expr/expr-brif.txt rename to tools/external/wabt/test/parse/expr/expr-brif.txt diff --git a/external/wabt/test/parse/expr/getglobal-named.txt b/tools/external/wabt/test/parse/expr/getglobal-named.txt similarity index 100% rename from external/wabt/test/parse/expr/getglobal-named.txt rename to tools/external/wabt/test/parse/expr/getglobal-named.txt diff --git a/external/wabt/test/parse/expr/getglobal.txt b/tools/external/wabt/test/parse/expr/getglobal.txt similarity index 100% rename from external/wabt/test/parse/expr/getglobal.txt rename to tools/external/wabt/test/parse/expr/getglobal.txt diff --git a/external/wabt/test/parse/expr/getlocal-index-after-param.txt b/tools/external/wabt/test/parse/expr/getlocal-index-after-param.txt similarity index 100% rename from external/wabt/test/parse/expr/getlocal-index-after-param.txt rename to tools/external/wabt/test/parse/expr/getlocal-index-after-param.txt diff --git a/external/wabt/test/parse/expr/getlocal-index-mixed-named-unnamed.txt b/tools/external/wabt/test/parse/expr/getlocal-index-mixed-named-unnamed.txt similarity index 100% rename from external/wabt/test/parse/expr/getlocal-index-mixed-named-unnamed.txt rename to tools/external/wabt/test/parse/expr/getlocal-index-mixed-named-unnamed.txt diff --git a/external/wabt/test/parse/expr/getlocal-named.txt b/tools/external/wabt/test/parse/expr/getlocal-named.txt similarity index 100% rename from external/wabt/test/parse/expr/getlocal-named.txt rename to tools/external/wabt/test/parse/expr/getlocal-named.txt diff --git a/external/wabt/test/parse/expr/getlocal-param-named.txt b/tools/external/wabt/test/parse/expr/getlocal-param-named.txt similarity index 100% rename from external/wabt/test/parse/expr/getlocal-param-named.txt rename to tools/external/wabt/test/parse/expr/getlocal-param-named.txt diff --git a/external/wabt/test/parse/expr/getlocal-param.txt b/tools/external/wabt/test/parse/expr/getlocal-param.txt similarity index 100% rename from external/wabt/test/parse/expr/getlocal-param.txt rename to tools/external/wabt/test/parse/expr/getlocal-param.txt diff --git a/external/wabt/test/parse/expr/getlocal.txt b/tools/external/wabt/test/parse/expr/getlocal.txt similarity index 100% rename from external/wabt/test/parse/expr/getlocal.txt rename to tools/external/wabt/test/parse/expr/getlocal.txt diff --git a/external/wabt/test/parse/expr/grow-memory.txt b/tools/external/wabt/test/parse/expr/grow-memory.txt similarity index 100% rename from external/wabt/test/parse/expr/grow-memory.txt rename to tools/external/wabt/test/parse/expr/grow-memory.txt diff --git a/external/wabt/test/parse/expr/if-multi.txt b/tools/external/wabt/test/parse/expr/if-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/if-multi.txt rename to tools/external/wabt/test/parse/expr/if-multi.txt diff --git a/external/wabt/test/parse/expr/if-return.txt b/tools/external/wabt/test/parse/expr/if-return.txt similarity index 100% rename from external/wabt/test/parse/expr/if-return.txt rename to tools/external/wabt/test/parse/expr/if-return.txt diff --git a/external/wabt/test/parse/expr/if-then-br-named.txt b/tools/external/wabt/test/parse/expr/if-then-br-named.txt similarity index 100% rename from external/wabt/test/parse/expr/if-then-br-named.txt rename to tools/external/wabt/test/parse/expr/if-then-br-named.txt diff --git a/external/wabt/test/parse/expr/if-then-br.txt b/tools/external/wabt/test/parse/expr/if-then-br.txt similarity index 100% rename from external/wabt/test/parse/expr/if-then-br.txt rename to tools/external/wabt/test/parse/expr/if-then-br.txt diff --git a/external/wabt/test/parse/expr/if-then-else-br-named.txt b/tools/external/wabt/test/parse/expr/if-then-else-br-named.txt similarity index 100% rename from external/wabt/test/parse/expr/if-then-else-br-named.txt rename to tools/external/wabt/test/parse/expr/if-then-else-br-named.txt diff --git a/external/wabt/test/parse/expr/if-then-else-br.txt b/tools/external/wabt/test/parse/expr/if-then-else-br.txt similarity index 100% rename from external/wabt/test/parse/expr/if-then-else-br.txt rename to tools/external/wabt/test/parse/expr/if-then-else-br.txt diff --git a/external/wabt/test/parse/expr/if-then-else-list.txt b/tools/external/wabt/test/parse/expr/if-then-else-list.txt similarity index 100% rename from external/wabt/test/parse/expr/if-then-else-list.txt rename to tools/external/wabt/test/parse/expr/if-then-else-list.txt diff --git a/external/wabt/test/parse/expr/if-then-else.txt b/tools/external/wabt/test/parse/expr/if-then-else.txt similarity index 100% rename from external/wabt/test/parse/expr/if-then-else.txt rename to tools/external/wabt/test/parse/expr/if-then-else.txt diff --git a/external/wabt/test/parse/expr/if.txt b/tools/external/wabt/test/parse/expr/if.txt similarity index 100% rename from external/wabt/test/parse/expr/if.txt rename to tools/external/wabt/test/parse/expr/if.txt diff --git a/external/wabt/test/parse/expr/if_except-multi.txt b/tools/external/wabt/test/parse/expr/if_except-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/if_except-multi.txt rename to tools/external/wabt/test/parse/expr/if_except-multi.txt diff --git a/external/wabt/test/parse/expr/if_except.txt b/tools/external/wabt/test/parse/expr/if_except.txt similarity index 100% rename from external/wabt/test/parse/expr/if_except.txt rename to tools/external/wabt/test/parse/expr/if_except.txt diff --git a/external/wabt/test/parse/expr/load-aligned.txt b/tools/external/wabt/test/parse/expr/load-aligned.txt similarity index 100% rename from external/wabt/test/parse/expr/load-aligned.txt rename to tools/external/wabt/test/parse/expr/load-aligned.txt diff --git a/external/wabt/test/parse/expr/load-offset.txt b/tools/external/wabt/test/parse/expr/load-offset.txt similarity index 100% rename from external/wabt/test/parse/expr/load-offset.txt rename to tools/external/wabt/test/parse/expr/load-offset.txt diff --git a/external/wabt/test/parse/expr/load.txt b/tools/external/wabt/test/parse/expr/load.txt similarity index 100% rename from external/wabt/test/parse/expr/load.txt rename to tools/external/wabt/test/parse/expr/load.txt diff --git a/external/wabt/test/parse/expr/loop-multi.txt b/tools/external/wabt/test/parse/expr/loop-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/loop-multi.txt rename to tools/external/wabt/test/parse/expr/loop-multi.txt diff --git a/external/wabt/test/parse/expr/loop-named.txt b/tools/external/wabt/test/parse/expr/loop-named.txt similarity index 100% rename from external/wabt/test/parse/expr/loop-named.txt rename to tools/external/wabt/test/parse/expr/loop-named.txt diff --git a/external/wabt/test/parse/expr/loop.txt b/tools/external/wabt/test/parse/expr/loop.txt similarity index 100% rename from external/wabt/test/parse/expr/loop.txt rename to tools/external/wabt/test/parse/expr/loop.txt diff --git a/external/wabt/test/parse/expr/nop.txt b/tools/external/wabt/test/parse/expr/nop.txt similarity index 100% rename from external/wabt/test/parse/expr/nop.txt rename to tools/external/wabt/test/parse/expr/nop.txt diff --git a/external/wabt/test/parse/expr/rethrow.txt b/tools/external/wabt/test/parse/expr/rethrow.txt similarity index 100% rename from external/wabt/test/parse/expr/rethrow.txt rename to tools/external/wabt/test/parse/expr/rethrow.txt diff --git a/external/wabt/test/parse/expr/return-block.txt b/tools/external/wabt/test/parse/expr/return-block.txt similarity index 100% rename from external/wabt/test/parse/expr/return-block.txt rename to tools/external/wabt/test/parse/expr/return-block.txt diff --git a/external/wabt/test/parse/expr/return-if.txt b/tools/external/wabt/test/parse/expr/return-if.txt similarity index 100% rename from external/wabt/test/parse/expr/return-if.txt rename to tools/external/wabt/test/parse/expr/return-if.txt diff --git a/external/wabt/test/parse/expr/return-void.txt b/tools/external/wabt/test/parse/expr/return-void.txt similarity index 100% rename from external/wabt/test/parse/expr/return-void.txt rename to tools/external/wabt/test/parse/expr/return-void.txt diff --git a/external/wabt/test/parse/expr/return.txt b/tools/external/wabt/test/parse/expr/return.txt similarity index 100% rename from external/wabt/test/parse/expr/return.txt rename to tools/external/wabt/test/parse/expr/return.txt diff --git a/external/wabt/test/parse/expr/select.txt b/tools/external/wabt/test/parse/expr/select.txt similarity index 100% rename from external/wabt/test/parse/expr/select.txt rename to tools/external/wabt/test/parse/expr/select.txt diff --git a/external/wabt/test/parse/expr/setglobal-named.txt b/tools/external/wabt/test/parse/expr/setglobal-named.txt similarity index 100% rename from external/wabt/test/parse/expr/setglobal-named.txt rename to tools/external/wabt/test/parse/expr/setglobal-named.txt diff --git a/external/wabt/test/parse/expr/setglobal.txt b/tools/external/wabt/test/parse/expr/setglobal.txt similarity index 100% rename from external/wabt/test/parse/expr/setglobal.txt rename to tools/external/wabt/test/parse/expr/setglobal.txt diff --git a/external/wabt/test/parse/expr/setlocal-index-after-param.txt b/tools/external/wabt/test/parse/expr/setlocal-index-after-param.txt similarity index 100% rename from external/wabt/test/parse/expr/setlocal-index-after-param.txt rename to tools/external/wabt/test/parse/expr/setlocal-index-after-param.txt diff --git a/external/wabt/test/parse/expr/setlocal-index-mixed-named-unnamed.txt b/tools/external/wabt/test/parse/expr/setlocal-index-mixed-named-unnamed.txt similarity index 100% rename from external/wabt/test/parse/expr/setlocal-index-mixed-named-unnamed.txt rename to tools/external/wabt/test/parse/expr/setlocal-index-mixed-named-unnamed.txt diff --git a/external/wabt/test/parse/expr/setlocal-named.txt b/tools/external/wabt/test/parse/expr/setlocal-named.txt similarity index 100% rename from external/wabt/test/parse/expr/setlocal-named.txt rename to tools/external/wabt/test/parse/expr/setlocal-named.txt diff --git a/external/wabt/test/parse/expr/setlocal-param-named.txt b/tools/external/wabt/test/parse/expr/setlocal-param-named.txt similarity index 100% rename from external/wabt/test/parse/expr/setlocal-param-named.txt rename to tools/external/wabt/test/parse/expr/setlocal-param-named.txt diff --git a/external/wabt/test/parse/expr/setlocal-param.txt b/tools/external/wabt/test/parse/expr/setlocal-param.txt similarity index 100% rename from external/wabt/test/parse/expr/setlocal-param.txt rename to tools/external/wabt/test/parse/expr/setlocal-param.txt diff --git a/external/wabt/test/parse/expr/setlocal.txt b/tools/external/wabt/test/parse/expr/setlocal.txt similarity index 100% rename from external/wabt/test/parse/expr/setlocal.txt rename to tools/external/wabt/test/parse/expr/setlocal.txt diff --git a/external/wabt/test/parse/expr/simd.txt b/tools/external/wabt/test/parse/expr/simd.txt similarity index 100% rename from external/wabt/test/parse/expr/simd.txt rename to tools/external/wabt/test/parse/expr/simd.txt diff --git a/external/wabt/test/parse/expr/store-aligned.txt b/tools/external/wabt/test/parse/expr/store-aligned.txt similarity index 100% rename from external/wabt/test/parse/expr/store-aligned.txt rename to tools/external/wabt/test/parse/expr/store-aligned.txt diff --git a/external/wabt/test/parse/expr/store-offset.txt b/tools/external/wabt/test/parse/expr/store-offset.txt similarity index 100% rename from external/wabt/test/parse/expr/store-offset.txt rename to tools/external/wabt/test/parse/expr/store-offset.txt diff --git a/external/wabt/test/parse/expr/store.txt b/tools/external/wabt/test/parse/expr/store.txt similarity index 100% rename from external/wabt/test/parse/expr/store.txt rename to tools/external/wabt/test/parse/expr/store.txt diff --git a/external/wabt/test/parse/expr/tee_local.txt b/tools/external/wabt/test/parse/expr/tee_local.txt similarity index 100% rename from external/wabt/test/parse/expr/tee_local.txt rename to tools/external/wabt/test/parse/expr/tee_local.txt diff --git a/external/wabt/test/parse/expr/throw.txt b/tools/external/wabt/test/parse/expr/throw.txt similarity index 100% rename from external/wabt/test/parse/expr/throw.txt rename to tools/external/wabt/test/parse/expr/throw.txt diff --git a/external/wabt/test/parse/expr/try-multi.txt b/tools/external/wabt/test/parse/expr/try-multi.txt similarity index 100% rename from external/wabt/test/parse/expr/try-multi.txt rename to tools/external/wabt/test/parse/expr/try-multi.txt diff --git a/external/wabt/test/parse/expr/try.txt b/tools/external/wabt/test/parse/expr/try.txt similarity index 100% rename from external/wabt/test/parse/expr/try.txt rename to tools/external/wabt/test/parse/expr/try.txt diff --git a/external/wabt/test/parse/expr/unary-extend-disabled.txt b/tools/external/wabt/test/parse/expr/unary-extend-disabled.txt similarity index 100% rename from external/wabt/test/parse/expr/unary-extend-disabled.txt rename to tools/external/wabt/test/parse/expr/unary-extend-disabled.txt diff --git a/external/wabt/test/parse/expr/unary-extend.txt b/tools/external/wabt/test/parse/expr/unary-extend.txt similarity index 100% rename from external/wabt/test/parse/expr/unary-extend.txt rename to tools/external/wabt/test/parse/expr/unary-extend.txt diff --git a/external/wabt/test/parse/expr/unary.txt b/tools/external/wabt/test/parse/expr/unary.txt similarity index 100% rename from external/wabt/test/parse/expr/unary.txt rename to tools/external/wabt/test/parse/expr/unary.txt diff --git a/external/wabt/test/parse/expr/unreachable.txt b/tools/external/wabt/test/parse/expr/unreachable.txt similarity index 100% rename from external/wabt/test/parse/expr/unreachable.txt rename to tools/external/wabt/test/parse/expr/unreachable.txt diff --git a/external/wabt/test/parse/force-color.txt b/tools/external/wabt/test/parse/force-color.txt similarity index 100% rename from external/wabt/test/parse/force-color.txt rename to tools/external/wabt/test/parse/force-color.txt diff --git a/external/wabt/test/parse/func/bad-func-name.txt b/tools/external/wabt/test/parse/func/bad-func-name.txt similarity index 100% rename from external/wabt/test/parse/func/bad-func-name.txt rename to tools/external/wabt/test/parse/func/bad-func-name.txt diff --git a/external/wabt/test/parse/func/bad-local-binding-no-type.txt b/tools/external/wabt/test/parse/func/bad-local-binding-no-type.txt similarity index 100% rename from external/wabt/test/parse/func/bad-local-binding-no-type.txt rename to tools/external/wabt/test/parse/func/bad-local-binding-no-type.txt diff --git a/external/wabt/test/parse/func/bad-local-binding.txt b/tools/external/wabt/test/parse/func/bad-local-binding.txt similarity index 100% rename from external/wabt/test/parse/func/bad-local-binding.txt rename to tools/external/wabt/test/parse/func/bad-local-binding.txt diff --git a/external/wabt/test/parse/func/bad-local-name.txt b/tools/external/wabt/test/parse/func/bad-local-name.txt similarity index 100% rename from external/wabt/test/parse/func/bad-local-name.txt rename to tools/external/wabt/test/parse/func/bad-local-name.txt diff --git a/external/wabt/test/parse/func/bad-local-type-list.txt b/tools/external/wabt/test/parse/func/bad-local-type-list.txt similarity index 100% rename from external/wabt/test/parse/func/bad-local-type-list.txt rename to tools/external/wabt/test/parse/func/bad-local-type-list.txt diff --git a/external/wabt/test/parse/func/bad-local-type.txt b/tools/external/wabt/test/parse/func/bad-local-type.txt similarity index 100% rename from external/wabt/test/parse/func/bad-local-type.txt rename to tools/external/wabt/test/parse/func/bad-local-type.txt diff --git a/external/wabt/test/parse/func/bad-param-binding.txt b/tools/external/wabt/test/parse/func/bad-param-binding.txt similarity index 100% rename from external/wabt/test/parse/func/bad-param-binding.txt rename to tools/external/wabt/test/parse/func/bad-param-binding.txt diff --git a/external/wabt/test/parse/func/bad-param-name.txt b/tools/external/wabt/test/parse/func/bad-param-name.txt similarity index 100% rename from external/wabt/test/parse/func/bad-param-name.txt rename to tools/external/wabt/test/parse/func/bad-param-name.txt diff --git a/external/wabt/test/parse/func/bad-param-redefinition.txt b/tools/external/wabt/test/parse/func/bad-param-redefinition.txt similarity index 100% rename from external/wabt/test/parse/func/bad-param-redefinition.txt rename to tools/external/wabt/test/parse/func/bad-param-redefinition.txt diff --git a/external/wabt/test/parse/func/bad-param-type-list.txt b/tools/external/wabt/test/parse/func/bad-param-type-list.txt similarity index 100% rename from external/wabt/test/parse/func/bad-param-type-list.txt rename to tools/external/wabt/test/parse/func/bad-param-type-list.txt diff --git a/external/wabt/test/parse/func/bad-param.txt b/tools/external/wabt/test/parse/func/bad-param.txt similarity index 100% rename from external/wabt/test/parse/func/bad-param.txt rename to tools/external/wabt/test/parse/func/bad-param.txt diff --git a/external/wabt/test/parse/func/bad-result-multi.txt b/tools/external/wabt/test/parse/func/bad-result-multi.txt similarity index 100% rename from external/wabt/test/parse/func/bad-result-multi.txt rename to tools/external/wabt/test/parse/func/bad-result-multi.txt diff --git a/external/wabt/test/parse/func/bad-result-type.txt b/tools/external/wabt/test/parse/func/bad-result-type.txt similarity index 100% rename from external/wabt/test/parse/func/bad-result-type.txt rename to tools/external/wabt/test/parse/func/bad-result-type.txt diff --git a/external/wabt/test/parse/func/bad-sig-param-type-mismatch.txt b/tools/external/wabt/test/parse/func/bad-sig-param-type-mismatch.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-param-type-mismatch.txt rename to tools/external/wabt/test/parse/func/bad-sig-param-type-mismatch.txt diff --git a/external/wabt/test/parse/func/bad-sig-params-empty.txt b/tools/external/wabt/test/parse/func/bad-sig-params-empty.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-params-empty.txt rename to tools/external/wabt/test/parse/func/bad-sig-params-empty.txt diff --git a/external/wabt/test/parse/func/bad-sig-result-type-mismatch.txt b/tools/external/wabt/test/parse/func/bad-sig-result-type-mismatch.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-result-type-mismatch.txt rename to tools/external/wabt/test/parse/func/bad-sig-result-type-mismatch.txt diff --git a/external/wabt/test/parse/func/bad-sig-result-type-not-void.txt b/tools/external/wabt/test/parse/func/bad-sig-result-type-not-void.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-result-type-not-void.txt rename to tools/external/wabt/test/parse/func/bad-sig-result-type-not-void.txt diff --git a/external/wabt/test/parse/func/bad-sig-result-type-void.txt b/tools/external/wabt/test/parse/func/bad-sig-result-type-void.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-result-type-void.txt rename to tools/external/wabt/test/parse/func/bad-sig-result-type-void.txt diff --git a/external/wabt/test/parse/func/bad-sig-too-few-params.txt b/tools/external/wabt/test/parse/func/bad-sig-too-few-params.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-too-few-params.txt rename to tools/external/wabt/test/parse/func/bad-sig-too-few-params.txt diff --git a/external/wabt/test/parse/func/bad-sig-too-many-params.txt b/tools/external/wabt/test/parse/func/bad-sig-too-many-params.txt similarity index 100% rename from external/wabt/test/parse/func/bad-sig-too-many-params.txt rename to tools/external/wabt/test/parse/func/bad-sig-too-many-params.txt diff --git a/external/wabt/test/parse/func/func-named.txt b/tools/external/wabt/test/parse/func/func-named.txt similarity index 100% rename from external/wabt/test/parse/func/func-named.txt rename to tools/external/wabt/test/parse/func/func-named.txt diff --git a/external/wabt/test/parse/func/local-empty.txt b/tools/external/wabt/test/parse/func/local-empty.txt similarity index 100% rename from external/wabt/test/parse/func/local-empty.txt rename to tools/external/wabt/test/parse/func/local-empty.txt diff --git a/external/wabt/test/parse/func/local-multi.txt b/tools/external/wabt/test/parse/func/local-multi.txt similarity index 100% rename from external/wabt/test/parse/func/local-multi.txt rename to tools/external/wabt/test/parse/func/local-multi.txt diff --git a/external/wabt/test/parse/func/local.txt b/tools/external/wabt/test/parse/func/local.txt similarity index 100% rename from external/wabt/test/parse/func/local.txt rename to tools/external/wabt/test/parse/func/local.txt diff --git a/external/wabt/test/parse/func/no-space.txt b/tools/external/wabt/test/parse/func/no-space.txt similarity index 100% rename from external/wabt/test/parse/func/no-space.txt rename to tools/external/wabt/test/parse/func/no-space.txt diff --git a/external/wabt/test/parse/func/param-binding.txt b/tools/external/wabt/test/parse/func/param-binding.txt similarity index 100% rename from external/wabt/test/parse/func/param-binding.txt rename to tools/external/wabt/test/parse/func/param-binding.txt diff --git a/external/wabt/test/parse/func/param-multi.txt b/tools/external/wabt/test/parse/func/param-multi.txt similarity index 100% rename from external/wabt/test/parse/func/param-multi.txt rename to tools/external/wabt/test/parse/func/param-multi.txt diff --git a/external/wabt/test/parse/func/param-type-1.txt b/tools/external/wabt/test/parse/func/param-type-1.txt similarity index 100% rename from external/wabt/test/parse/func/param-type-1.txt rename to tools/external/wabt/test/parse/func/param-type-1.txt diff --git a/external/wabt/test/parse/func/param-type-2.txt b/tools/external/wabt/test/parse/func/param-type-2.txt similarity index 100% rename from external/wabt/test/parse/func/param-type-2.txt rename to tools/external/wabt/test/parse/func/param-type-2.txt diff --git a/external/wabt/test/parse/func/result-empty.txt b/tools/external/wabt/test/parse/func/result-empty.txt similarity index 100% rename from external/wabt/test/parse/func/result-empty.txt rename to tools/external/wabt/test/parse/func/result-empty.txt diff --git a/external/wabt/test/parse/func/result-multi.txt b/tools/external/wabt/test/parse/func/result-multi.txt similarity index 100% rename from external/wabt/test/parse/func/result-multi.txt rename to tools/external/wabt/test/parse/func/result-multi.txt diff --git a/external/wabt/test/parse/func/result.txt b/tools/external/wabt/test/parse/func/result.txt similarity index 100% rename from external/wabt/test/parse/func/result.txt rename to tools/external/wabt/test/parse/func/result.txt diff --git a/external/wabt/test/parse/func/sig-match.txt b/tools/external/wabt/test/parse/func/sig-match.txt similarity index 100% rename from external/wabt/test/parse/func/sig-match.txt rename to tools/external/wabt/test/parse/func/sig-match.txt diff --git a/external/wabt/test/parse/func/sig.txt b/tools/external/wabt/test/parse/func/sig.txt similarity index 100% rename from external/wabt/test/parse/func/sig.txt rename to tools/external/wabt/test/parse/func/sig.txt diff --git a/external/wabt/test/parse/line-comment.txt b/tools/external/wabt/test/parse/line-comment.txt similarity index 100% rename from external/wabt/test/parse/line-comment.txt rename to tools/external/wabt/test/parse/line-comment.txt diff --git a/external/wabt/test/parse/module/bad-binary-module-magic.txt b/tools/external/wabt/test/parse/module/bad-binary-module-magic.txt similarity index 100% rename from external/wabt/test/parse/module/bad-binary-module-magic.txt rename to tools/external/wabt/test/parse/module/bad-binary-module-magic.txt diff --git a/external/wabt/test/parse/module/bad-export-func-empty.txt b/tools/external/wabt/test/parse/module/bad-export-func-empty.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-func-empty.txt rename to tools/external/wabt/test/parse/module/bad-export-func-empty.txt diff --git a/external/wabt/test/parse/module/bad-export-func-name-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-func-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-func-name-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-func-name-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-func-name.txt b/tools/external/wabt/test/parse/module/bad-export-func-name.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-func-name.txt rename to tools/external/wabt/test/parse/module/bad-export-func-name.txt diff --git a/external/wabt/test/parse/module/bad-export-func-no-string.txt b/tools/external/wabt/test/parse/module/bad-export-func-no-string.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-func-no-string.txt rename to tools/external/wabt/test/parse/module/bad-export-func-no-string.txt diff --git a/external/wabt/test/parse/module/bad-export-func-too-many.txt b/tools/external/wabt/test/parse/module/bad-export-func-too-many.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-func-too-many.txt rename to tools/external/wabt/test/parse/module/bad-export-func-too-many.txt diff --git a/external/wabt/test/parse/module/bad-export-func-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-func-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-func-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-func-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-global-name-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-global-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-global-name-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-global-name-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-global-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-global-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-global-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-global-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-memory-name-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-memory-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-memory-name-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-memory-name-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-memory-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-memory-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-memory-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-memory-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-table-name-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-table-name-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-table-name-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-table-name-undefined.txt diff --git a/external/wabt/test/parse/module/bad-export-table-undefined.txt b/tools/external/wabt/test/parse/module/bad-export-table-undefined.txt similarity index 100% rename from external/wabt/test/parse/module/bad-export-table-undefined.txt rename to tools/external/wabt/test/parse/module/bad-export-table-undefined.txt diff --git a/external/wabt/test/parse/module/bad-func-redefinition.txt b/tools/external/wabt/test/parse/module/bad-func-redefinition.txt similarity index 100% rename from external/wabt/test/parse/module/bad-func-redefinition.txt rename to tools/external/wabt/test/parse/module/bad-func-redefinition.txt diff --git a/external/wabt/test/parse/module/bad-global-invalid-expr.txt b/tools/external/wabt/test/parse/module/bad-global-invalid-expr.txt similarity index 100% rename from external/wabt/test/parse/module/bad-global-invalid-expr.txt rename to tools/external/wabt/test/parse/module/bad-global-invalid-expr.txt diff --git a/external/wabt/test/parse/module/bad-global-invalid-getglobal.txt b/tools/external/wabt/test/parse/module/bad-global-invalid-getglobal.txt similarity index 100% rename from external/wabt/test/parse/module/bad-global-invalid-getglobal.txt rename to tools/external/wabt/test/parse/module/bad-global-invalid-getglobal.txt diff --git a/external/wabt/test/parse/module/bad-import-func-not-param.txt b/tools/external/wabt/test/parse/module/bad-import-func-not-param.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-func-not-param.txt rename to tools/external/wabt/test/parse/module/bad-import-func-not-param.txt diff --git a/external/wabt/test/parse/module/bad-import-func-not-result.txt b/tools/external/wabt/test/parse/module/bad-import-func-not-result.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-func-not-result.txt rename to tools/external/wabt/test/parse/module/bad-import-func-not-result.txt diff --git a/external/wabt/test/parse/module/bad-import-func-one-string.txt b/tools/external/wabt/test/parse/module/bad-import-func-one-string.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-func-one-string.txt rename to tools/external/wabt/test/parse/module/bad-import-func-one-string.txt diff --git a/external/wabt/test/parse/module/bad-import-func-redefinition.txt b/tools/external/wabt/test/parse/module/bad-import-func-redefinition.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-func-redefinition.txt rename to tools/external/wabt/test/parse/module/bad-import-func-redefinition.txt diff --git a/external/wabt/test/parse/module/bad-import-global-redefinition.txt b/tools/external/wabt/test/parse/module/bad-import-global-redefinition.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-global-redefinition.txt rename to tools/external/wabt/test/parse/module/bad-import-global-redefinition.txt diff --git a/external/wabt/test/parse/module/bad-import-memory-redefinition.txt b/tools/external/wabt/test/parse/module/bad-import-memory-redefinition.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-memory-redefinition.txt rename to tools/external/wabt/test/parse/module/bad-import-memory-redefinition.txt diff --git a/external/wabt/test/parse/module/bad-import-table-redefinition.txt b/tools/external/wabt/test/parse/module/bad-import-table-redefinition.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-table-redefinition.txt rename to tools/external/wabt/test/parse/module/bad-import-table-redefinition.txt diff --git a/external/wabt/test/parse/module/bad-import-table-shared.txt b/tools/external/wabt/test/parse/module/bad-import-table-shared.txt similarity index 100% rename from external/wabt/test/parse/module/bad-import-table-shared.txt rename to tools/external/wabt/test/parse/module/bad-import-table-shared.txt diff --git a/external/wabt/test/parse/module/bad-memory-empty.txt b/tools/external/wabt/test/parse/module/bad-memory-empty.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-empty.txt rename to tools/external/wabt/test/parse/module/bad-memory-empty.txt diff --git a/external/wabt/test/parse/module/bad-memory-init-size-negative.txt b/tools/external/wabt/test/parse/module/bad-memory-init-size-negative.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-init-size-negative.txt rename to tools/external/wabt/test/parse/module/bad-memory-init-size-negative.txt diff --git a/external/wabt/test/parse/module/bad-memory-init-size-too-big.txt b/tools/external/wabt/test/parse/module/bad-memory-init-size-too-big.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-init-size-too-big.txt rename to tools/external/wabt/test/parse/module/bad-memory-init-size-too-big.txt diff --git a/external/wabt/test/parse/module/bad-memory-init-size.txt b/tools/external/wabt/test/parse/module/bad-memory-init-size.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-init-size.txt rename to tools/external/wabt/test/parse/module/bad-memory-init-size.txt diff --git a/external/wabt/test/parse/module/bad-memory-max-less-than-init.txt b/tools/external/wabt/test/parse/module/bad-memory-max-less-than-init.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-max-less-than-init.txt rename to tools/external/wabt/test/parse/module/bad-memory-max-less-than-init.txt diff --git a/external/wabt/test/parse/module/bad-memory-max-size-negative.txt b/tools/external/wabt/test/parse/module/bad-memory-max-size-negative.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-max-size-negative.txt rename to tools/external/wabt/test/parse/module/bad-memory-max-size-negative.txt diff --git a/external/wabt/test/parse/module/bad-memory-max-size-too-big.txt b/tools/external/wabt/test/parse/module/bad-memory-max-size-too-big.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-max-size-too-big.txt rename to tools/external/wabt/test/parse/module/bad-memory-max-size-too-big.txt diff --git a/external/wabt/test/parse/module/bad-memory-max-size.txt b/tools/external/wabt/test/parse/module/bad-memory-max-size.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-max-size.txt rename to tools/external/wabt/test/parse/module/bad-memory-max-size.txt diff --git a/external/wabt/test/parse/module/bad-memory-segment-address.txt b/tools/external/wabt/test/parse/module/bad-memory-segment-address.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-segment-address.txt rename to tools/external/wabt/test/parse/module/bad-memory-segment-address.txt diff --git a/external/wabt/test/parse/module/bad-memory-shared-nomax.txt b/tools/external/wabt/test/parse/module/bad-memory-shared-nomax.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-shared-nomax.txt rename to tools/external/wabt/test/parse/module/bad-memory-shared-nomax.txt diff --git a/external/wabt/test/parse/module/bad-memory-too-many.txt b/tools/external/wabt/test/parse/module/bad-memory-too-many.txt similarity index 100% rename from external/wabt/test/parse/module/bad-memory-too-many.txt rename to tools/external/wabt/test/parse/module/bad-memory-too-many.txt diff --git a/external/wabt/test/parse/module/bad-module-multi.txt b/tools/external/wabt/test/parse/module/bad-module-multi.txt similarity index 100% rename from external/wabt/test/parse/module/bad-module-multi.txt rename to tools/external/wabt/test/parse/module/bad-module-multi.txt diff --git a/external/wabt/test/parse/module/bad-module-no-close.txt b/tools/external/wabt/test/parse/module/bad-module-no-close.txt similarity index 100% rename from external/wabt/test/parse/module/bad-module-no-close.txt rename to tools/external/wabt/test/parse/module/bad-module-no-close.txt diff --git a/external/wabt/test/parse/module/bad-module-with-assert.txt b/tools/external/wabt/test/parse/module/bad-module-with-assert.txt similarity index 100% rename from external/wabt/test/parse/module/bad-module-with-assert.txt rename to tools/external/wabt/test/parse/module/bad-module-with-assert.txt diff --git a/external/wabt/test/parse/module/bad-start-not-nullary.txt b/tools/external/wabt/test/parse/module/bad-start-not-nullary.txt similarity index 100% rename from external/wabt/test/parse/module/bad-start-not-nullary.txt rename to tools/external/wabt/test/parse/module/bad-start-not-nullary.txt diff --git a/external/wabt/test/parse/module/bad-start-not-void.txt b/tools/external/wabt/test/parse/module/bad-start-not-void.txt similarity index 100% rename from external/wabt/test/parse/module/bad-start-not-void.txt rename to tools/external/wabt/test/parse/module/bad-start-not-void.txt diff --git a/external/wabt/test/parse/module/bad-start-too-many.txt b/tools/external/wabt/test/parse/module/bad-start-too-many.txt similarity index 100% rename from external/wabt/test/parse/module/bad-start-too-many.txt rename to tools/external/wabt/test/parse/module/bad-start-too-many.txt diff --git a/external/wabt/test/parse/module/bad-table-invalid-function.txt b/tools/external/wabt/test/parse/module/bad-table-invalid-function.txt similarity index 100% rename from external/wabt/test/parse/module/bad-table-invalid-function.txt rename to tools/external/wabt/test/parse/module/bad-table-invalid-function.txt diff --git a/external/wabt/test/parse/module/bad-table-too-many.txt b/tools/external/wabt/test/parse/module/bad-table-too-many.txt similarity index 100% rename from external/wabt/test/parse/module/bad-table-too-many.txt rename to tools/external/wabt/test/parse/module/bad-table-too-many.txt diff --git a/external/wabt/test/parse/module/binary-module.txt b/tools/external/wabt/test/parse/module/binary-module.txt similarity index 100% rename from external/wabt/test/parse/module/binary-module.txt rename to tools/external/wabt/test/parse/module/binary-module.txt diff --git a/external/wabt/test/parse/module/data-offset.txt b/tools/external/wabt/test/parse/module/data-offset.txt similarity index 100% rename from external/wabt/test/parse/module/data-offset.txt rename to tools/external/wabt/test/parse/module/data-offset.txt diff --git a/external/wabt/test/parse/module/elem-offset.txt b/tools/external/wabt/test/parse/module/elem-offset.txt similarity index 100% rename from external/wabt/test/parse/module/elem-offset.txt rename to tools/external/wabt/test/parse/module/elem-offset.txt diff --git a/external/wabt/test/parse/module/except.txt b/tools/external/wabt/test/parse/module/except.txt similarity index 100% rename from external/wabt/test/parse/module/except.txt rename to tools/external/wabt/test/parse/module/except.txt diff --git a/external/wabt/test/parse/module/export-except.txt b/tools/external/wabt/test/parse/module/export-except.txt similarity index 100% rename from external/wabt/test/parse/module/export-except.txt rename to tools/external/wabt/test/parse/module/export-except.txt diff --git a/external/wabt/test/parse/module/export-func-multi.txt b/tools/external/wabt/test/parse/module/export-func-multi.txt similarity index 100% rename from external/wabt/test/parse/module/export-func-multi.txt rename to tools/external/wabt/test/parse/module/export-func-multi.txt diff --git a/external/wabt/test/parse/module/export-func-named.txt b/tools/external/wabt/test/parse/module/export-func-named.txt similarity index 100% rename from external/wabt/test/parse/module/export-func-named.txt rename to tools/external/wabt/test/parse/module/export-func-named.txt diff --git a/external/wabt/test/parse/module/export-func.txt b/tools/external/wabt/test/parse/module/export-func.txt similarity index 100% rename from external/wabt/test/parse/module/export-func.txt rename to tools/external/wabt/test/parse/module/export-func.txt diff --git a/external/wabt/test/parse/module/export-global.txt b/tools/external/wabt/test/parse/module/export-global.txt similarity index 100% rename from external/wabt/test/parse/module/export-global.txt rename to tools/external/wabt/test/parse/module/export-global.txt diff --git a/external/wabt/test/parse/module/export-memory-multi.txt b/tools/external/wabt/test/parse/module/export-memory-multi.txt similarity index 100% rename from external/wabt/test/parse/module/export-memory-multi.txt rename to tools/external/wabt/test/parse/module/export-memory-multi.txt diff --git a/external/wabt/test/parse/module/export-memory.txt b/tools/external/wabt/test/parse/module/export-memory.txt similarity index 100% rename from external/wabt/test/parse/module/export-memory.txt rename to tools/external/wabt/test/parse/module/export-memory.txt diff --git a/external/wabt/test/parse/module/export-table.txt b/tools/external/wabt/test/parse/module/export-table.txt similarity index 100% rename from external/wabt/test/parse/module/export-table.txt rename to tools/external/wabt/test/parse/module/export-table.txt diff --git a/external/wabt/test/parse/module/global.txt b/tools/external/wabt/test/parse/module/global.txt similarity index 100% rename from external/wabt/test/parse/module/global.txt rename to tools/external/wabt/test/parse/module/global.txt diff --git a/external/wabt/test/parse/module/import-except.txt b/tools/external/wabt/test/parse/module/import-except.txt similarity index 100% rename from external/wabt/test/parse/module/import-except.txt rename to tools/external/wabt/test/parse/module/import-except.txt diff --git a/external/wabt/test/parse/module/import-func-no-param.txt b/tools/external/wabt/test/parse/module/import-func-no-param.txt similarity index 100% rename from external/wabt/test/parse/module/import-func-no-param.txt rename to tools/external/wabt/test/parse/module/import-func-no-param.txt diff --git a/external/wabt/test/parse/module/import-func-type.txt b/tools/external/wabt/test/parse/module/import-func-type.txt similarity index 100% rename from external/wabt/test/parse/module/import-func-type.txt rename to tools/external/wabt/test/parse/module/import-func-type.txt diff --git a/external/wabt/test/parse/module/import-func.txt b/tools/external/wabt/test/parse/module/import-func.txt similarity index 100% rename from external/wabt/test/parse/module/import-func.txt rename to tools/external/wabt/test/parse/module/import-func.txt diff --git a/external/wabt/test/parse/module/import-global-getglobal.txt b/tools/external/wabt/test/parse/module/import-global-getglobal.txt similarity index 100% rename from external/wabt/test/parse/module/import-global-getglobal.txt rename to tools/external/wabt/test/parse/module/import-global-getglobal.txt diff --git a/external/wabt/test/parse/module/import-global.txt b/tools/external/wabt/test/parse/module/import-global.txt similarity index 100% rename from external/wabt/test/parse/module/import-global.txt rename to tools/external/wabt/test/parse/module/import-global.txt diff --git a/external/wabt/test/parse/module/import-memory-shared.txt b/tools/external/wabt/test/parse/module/import-memory-shared.txt similarity index 100% rename from external/wabt/test/parse/module/import-memory-shared.txt rename to tools/external/wabt/test/parse/module/import-memory-shared.txt diff --git a/external/wabt/test/parse/module/import-memory.txt b/tools/external/wabt/test/parse/module/import-memory.txt similarity index 100% rename from external/wabt/test/parse/module/import-memory.txt rename to tools/external/wabt/test/parse/module/import-memory.txt diff --git a/external/wabt/test/parse/module/import-mutable-global.txt b/tools/external/wabt/test/parse/module/import-mutable-global.txt similarity index 100% rename from external/wabt/test/parse/module/import-mutable-global.txt rename to tools/external/wabt/test/parse/module/import-mutable-global.txt diff --git a/external/wabt/test/parse/module/import-table.txt b/tools/external/wabt/test/parse/module/import-table.txt similarity index 100% rename from external/wabt/test/parse/module/import-table.txt rename to tools/external/wabt/test/parse/module/import-table.txt diff --git a/external/wabt/test/parse/module/memory-init-max-size.txt b/tools/external/wabt/test/parse/module/memory-init-max-size.txt similarity index 100% rename from external/wabt/test/parse/module/memory-init-max-size.txt rename to tools/external/wabt/test/parse/module/memory-init-max-size.txt diff --git a/external/wabt/test/parse/module/memory-init-size.txt b/tools/external/wabt/test/parse/module/memory-init-size.txt similarity index 100% rename from external/wabt/test/parse/module/memory-init-size.txt rename to tools/external/wabt/test/parse/module/memory-init-size.txt diff --git a/external/wabt/test/parse/module/memory-segment-1.txt b/tools/external/wabt/test/parse/module/memory-segment-1.txt similarity index 100% rename from external/wabt/test/parse/module/memory-segment-1.txt rename to tools/external/wabt/test/parse/module/memory-segment-1.txt diff --git a/external/wabt/test/parse/module/memory-segment-long.txt b/tools/external/wabt/test/parse/module/memory-segment-long.txt similarity index 100% rename from external/wabt/test/parse/module/memory-segment-long.txt rename to tools/external/wabt/test/parse/module/memory-segment-long.txt diff --git a/external/wabt/test/parse/module/memory-segment-many.txt b/tools/external/wabt/test/parse/module/memory-segment-many.txt similarity index 100% rename from external/wabt/test/parse/module/memory-segment-many.txt rename to tools/external/wabt/test/parse/module/memory-segment-many.txt diff --git a/external/wabt/test/parse/module/memory-segment-multi-string.txt b/tools/external/wabt/test/parse/module/memory-segment-multi-string.txt similarity index 100% rename from external/wabt/test/parse/module/memory-segment-multi-string.txt rename to tools/external/wabt/test/parse/module/memory-segment-multi-string.txt diff --git a/external/wabt/test/parse/module/memory-shared.txt b/tools/external/wabt/test/parse/module/memory-shared.txt similarity index 100% rename from external/wabt/test/parse/module/memory-shared.txt rename to tools/external/wabt/test/parse/module/memory-shared.txt diff --git a/external/wabt/test/parse/module/module-empty.txt b/tools/external/wabt/test/parse/module/module-empty.txt similarity index 100% rename from external/wabt/test/parse/module/module-empty.txt rename to tools/external/wabt/test/parse/module/module-empty.txt diff --git a/external/wabt/test/parse/module/start-named.txt b/tools/external/wabt/test/parse/module/start-named.txt similarity index 100% rename from external/wabt/test/parse/module/start-named.txt rename to tools/external/wabt/test/parse/module/start-named.txt diff --git a/external/wabt/test/parse/module/start.txt b/tools/external/wabt/test/parse/module/start.txt similarity index 100% rename from external/wabt/test/parse/module/start.txt rename to tools/external/wabt/test/parse/module/start.txt diff --git a/external/wabt/test/parse/module/table-named.txt b/tools/external/wabt/test/parse/module/table-named.txt similarity index 100% rename from external/wabt/test/parse/module/table-named.txt rename to tools/external/wabt/test/parse/module/table-named.txt diff --git a/external/wabt/test/parse/module/table.txt b/tools/external/wabt/test/parse/module/table.txt similarity index 100% rename from external/wabt/test/parse/module/table.txt rename to tools/external/wabt/test/parse/module/table.txt diff --git a/external/wabt/test/parse/module/type-empty-param.txt b/tools/external/wabt/test/parse/module/type-empty-param.txt similarity index 100% rename from external/wabt/test/parse/module/type-empty-param.txt rename to tools/external/wabt/test/parse/module/type-empty-param.txt diff --git a/external/wabt/test/parse/module/type-empty.txt b/tools/external/wabt/test/parse/module/type-empty.txt similarity index 100% rename from external/wabt/test/parse/module/type-empty.txt rename to tools/external/wabt/test/parse/module/type-empty.txt diff --git a/external/wabt/test/parse/module/type-multi-param.txt b/tools/external/wabt/test/parse/module/type-multi-param.txt similarity index 100% rename from external/wabt/test/parse/module/type-multi-param.txt rename to tools/external/wabt/test/parse/module/type-multi-param.txt diff --git a/external/wabt/test/parse/module/type-no-param.txt b/tools/external/wabt/test/parse/module/type-no-param.txt similarity index 100% rename from external/wabt/test/parse/module/type-no-param.txt rename to tools/external/wabt/test/parse/module/type-no-param.txt diff --git a/external/wabt/test/parse/module/type.txt b/tools/external/wabt/test/parse/module/type.txt similarity index 100% rename from external/wabt/test/parse/module/type.txt rename to tools/external/wabt/test/parse/module/type.txt diff --git a/external/wabt/test/parse/nested-comments.txt b/tools/external/wabt/test/parse/nested-comments.txt similarity index 100% rename from external/wabt/test/parse/nested-comments.txt rename to tools/external/wabt/test/parse/nested-comments.txt diff --git a/external/wabt/test/parse/string-escape.txt b/tools/external/wabt/test/parse/string-escape.txt similarity index 100% rename from external/wabt/test/parse/string-escape.txt rename to tools/external/wabt/test/parse/string-escape.txt diff --git a/external/wabt/test/parse/string-hex.txt b/tools/external/wabt/test/parse/string-hex.txt similarity index 100% rename from external/wabt/test/parse/string-hex.txt rename to tools/external/wabt/test/parse/string-hex.txt diff --git a/external/wabt/test/regress/regress-1.txt b/tools/external/wabt/test/regress/regress-1.txt similarity index 100% rename from external/wabt/test/regress/regress-1.txt rename to tools/external/wabt/test/regress/regress-1.txt diff --git a/external/wabt/test/regress/regress-10.txt b/tools/external/wabt/test/regress/regress-10.txt similarity index 100% rename from external/wabt/test/regress/regress-10.txt rename to tools/external/wabt/test/regress/regress-10.txt diff --git a/external/wabt/test/regress/regress-11.txt b/tools/external/wabt/test/regress/regress-11.txt similarity index 100% rename from external/wabt/test/regress/regress-11.txt rename to tools/external/wabt/test/regress/regress-11.txt diff --git a/external/wabt/test/regress/regress-12.txt b/tools/external/wabt/test/regress/regress-12.txt similarity index 100% rename from external/wabt/test/regress/regress-12.txt rename to tools/external/wabt/test/regress/regress-12.txt diff --git a/external/wabt/test/regress/regress-13.txt b/tools/external/wabt/test/regress/regress-13.txt similarity index 100% rename from external/wabt/test/regress/regress-13.txt rename to tools/external/wabt/test/regress/regress-13.txt diff --git a/external/wabt/test/regress/regress-14.txt b/tools/external/wabt/test/regress/regress-14.txt similarity index 100% rename from external/wabt/test/regress/regress-14.txt rename to tools/external/wabt/test/regress/regress-14.txt diff --git a/external/wabt/test/regress/regress-15.txt b/tools/external/wabt/test/regress/regress-15.txt similarity index 100% rename from external/wabt/test/regress/regress-15.txt rename to tools/external/wabt/test/regress/regress-15.txt diff --git a/external/wabt/test/regress/regress-16.txt b/tools/external/wabt/test/regress/regress-16.txt similarity index 100% rename from external/wabt/test/regress/regress-16.txt rename to tools/external/wabt/test/regress/regress-16.txt diff --git a/external/wabt/test/regress/regress-17.txt b/tools/external/wabt/test/regress/regress-17.txt similarity index 100% rename from external/wabt/test/regress/regress-17.txt rename to tools/external/wabt/test/regress/regress-17.txt diff --git a/external/wabt/test/regress/regress-18.txt b/tools/external/wabt/test/regress/regress-18.txt similarity index 100% rename from external/wabt/test/regress/regress-18.txt rename to tools/external/wabt/test/regress/regress-18.txt diff --git a/external/wabt/test/regress/regress-19.txt b/tools/external/wabt/test/regress/regress-19.txt similarity index 100% rename from external/wabt/test/regress/regress-19.txt rename to tools/external/wabt/test/regress/regress-19.txt diff --git a/external/wabt/test/regress/regress-2.txt b/tools/external/wabt/test/regress/regress-2.txt similarity index 100% rename from external/wabt/test/regress/regress-2.txt rename to tools/external/wabt/test/regress/regress-2.txt diff --git a/external/wabt/test/regress/regress-20.txt b/tools/external/wabt/test/regress/regress-20.txt similarity index 100% rename from external/wabt/test/regress/regress-20.txt rename to tools/external/wabt/test/regress/regress-20.txt diff --git a/external/wabt/test/regress/regress-3.txt b/tools/external/wabt/test/regress/regress-3.txt similarity index 100% rename from external/wabt/test/regress/regress-3.txt rename to tools/external/wabt/test/regress/regress-3.txt diff --git a/external/wabt/test/regress/regress-4.txt b/tools/external/wabt/test/regress/regress-4.txt similarity index 100% rename from external/wabt/test/regress/regress-4.txt rename to tools/external/wabt/test/regress/regress-4.txt diff --git a/external/wabt/test/regress/regress-5.txt b/tools/external/wabt/test/regress/regress-5.txt similarity index 100% rename from external/wabt/test/regress/regress-5.txt rename to tools/external/wabt/test/regress/regress-5.txt diff --git a/external/wabt/test/regress/regress-6.txt b/tools/external/wabt/test/regress/regress-6.txt similarity index 100% rename from external/wabt/test/regress/regress-6.txt rename to tools/external/wabt/test/regress/regress-6.txt diff --git a/external/wabt/test/regress/regress-7.txt b/tools/external/wabt/test/regress/regress-7.txt similarity index 100% rename from external/wabt/test/regress/regress-7.txt rename to tools/external/wabt/test/regress/regress-7.txt diff --git a/external/wabt/test/regress/regress-8.txt b/tools/external/wabt/test/regress/regress-8.txt similarity index 100% rename from external/wabt/test/regress/regress-8.txt rename to tools/external/wabt/test/regress/regress-8.txt diff --git a/external/wabt/test/regress/regress-9.txt b/tools/external/wabt/test/regress/regress-9.txt similarity index 100% rename from external/wabt/test/regress/regress-9.txt rename to tools/external/wabt/test/regress/regress-9.txt diff --git a/external/wabt/test/roundtrip/apply-global-names.txt b/tools/external/wabt/test/roundtrip/apply-global-names.txt similarity index 100% rename from external/wabt/test/roundtrip/apply-global-names.txt rename to tools/external/wabt/test/roundtrip/apply-global-names.txt diff --git a/external/wabt/test/roundtrip/debug-import-names.txt b/tools/external/wabt/test/roundtrip/debug-import-names.txt similarity index 100% rename from external/wabt/test/roundtrip/debug-import-names.txt rename to tools/external/wabt/test/roundtrip/debug-import-names.txt diff --git a/external/wabt/test/roundtrip/debug-names-after-data.txt b/tools/external/wabt/test/roundtrip/debug-names-after-data.txt similarity index 100% rename from external/wabt/test/roundtrip/debug-names-after-data.txt rename to tools/external/wabt/test/roundtrip/debug-names-after-data.txt diff --git a/external/wabt/test/roundtrip/debug-names.txt b/tools/external/wabt/test/roundtrip/debug-names.txt similarity index 100% rename from external/wabt/test/roundtrip/debug-names.txt rename to tools/external/wabt/test/roundtrip/debug-names.txt diff --git a/external/wabt/test/roundtrip/fold-atomic.txt b/tools/external/wabt/test/roundtrip/fold-atomic.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-atomic.txt rename to tools/external/wabt/test/roundtrip/fold-atomic.txt diff --git a/external/wabt/test/roundtrip/fold-basic.txt b/tools/external/wabt/test/roundtrip/fold-basic.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-basic.txt rename to tools/external/wabt/test/roundtrip/fold-basic.txt diff --git a/external/wabt/test/roundtrip/fold-block.txt b/tools/external/wabt/test/roundtrip/fold-block.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-block.txt rename to tools/external/wabt/test/roundtrip/fold-block.txt diff --git a/external/wabt/test/roundtrip/fold-call-import-gen-names.txt b/tools/external/wabt/test/roundtrip/fold-call-import-gen-names.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-call-import-gen-names.txt rename to tools/external/wabt/test/roundtrip/fold-call-import-gen-names.txt diff --git a/external/wabt/test/roundtrip/fold-call.txt b/tools/external/wabt/test/roundtrip/fold-call.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-call.txt rename to tools/external/wabt/test/roundtrip/fold-call.txt diff --git a/external/wabt/test/roundtrip/fold-fac.txt b/tools/external/wabt/test/roundtrip/fold-fac.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-fac.txt rename to tools/external/wabt/test/roundtrip/fold-fac.txt diff --git a/external/wabt/test/roundtrip/fold-getset-global.txt b/tools/external/wabt/test/roundtrip/fold-getset-global.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-getset-global.txt rename to tools/external/wabt/test/roundtrip/fold-getset-global.txt diff --git a/external/wabt/test/roundtrip/fold-getset-local.txt b/tools/external/wabt/test/roundtrip/fold-getset-local.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-getset-local.txt rename to tools/external/wabt/test/roundtrip/fold-getset-local.txt diff --git a/external/wabt/test/roundtrip/fold-if_except.txt b/tools/external/wabt/test/roundtrip/fold-if_except.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-if_except.txt rename to tools/external/wabt/test/roundtrip/fold-if_except.txt diff --git a/external/wabt/test/roundtrip/fold-load-store.txt b/tools/external/wabt/test/roundtrip/fold-load-store.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-load-store.txt rename to tools/external/wabt/test/roundtrip/fold-load-store.txt diff --git a/external/wabt/test/roundtrip/fold-nop.txt b/tools/external/wabt/test/roundtrip/fold-nop.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-nop.txt rename to tools/external/wabt/test/roundtrip/fold-nop.txt diff --git a/external/wabt/test/roundtrip/fold-rethrow.txt b/tools/external/wabt/test/roundtrip/fold-rethrow.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-rethrow.txt rename to tools/external/wabt/test/roundtrip/fold-rethrow.txt diff --git a/external/wabt/test/roundtrip/fold-throw.txt b/tools/external/wabt/test/roundtrip/fold-throw.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-throw.txt rename to tools/external/wabt/test/roundtrip/fold-throw.txt diff --git a/external/wabt/test/roundtrip/fold-try.txt b/tools/external/wabt/test/roundtrip/fold-try.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-try.txt rename to tools/external/wabt/test/roundtrip/fold-try.txt diff --git a/external/wabt/test/roundtrip/fold-unreachable.txt b/tools/external/wabt/test/roundtrip/fold-unreachable.txt similarity index 100% rename from external/wabt/test/roundtrip/fold-unreachable.txt rename to tools/external/wabt/test/roundtrip/fold-unreachable.txt diff --git a/external/wabt/test/roundtrip/func-index.txt b/tools/external/wabt/test/roundtrip/func-index.txt similarity index 100% rename from external/wabt/test/roundtrip/func-index.txt rename to tools/external/wabt/test/roundtrip/func-index.txt diff --git a/external/wabt/test/roundtrip/generate-except-names.txt b/tools/external/wabt/test/roundtrip/generate-except-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-except-names.txt rename to tools/external/wabt/test/roundtrip/generate-except-names.txt diff --git a/external/wabt/test/roundtrip/generate-existing-name.txt b/tools/external/wabt/test/roundtrip/generate-existing-name.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-existing-name.txt rename to tools/external/wabt/test/roundtrip/generate-existing-name.txt diff --git a/external/wabt/test/roundtrip/generate-from-export-name.txt b/tools/external/wabt/test/roundtrip/generate-from-export-name.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-from-export-name.txt rename to tools/external/wabt/test/roundtrip/generate-from-export-name.txt diff --git a/external/wabt/test/roundtrip/generate-from-import-name.txt b/tools/external/wabt/test/roundtrip/generate-from-import-name.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-from-import-name.txt rename to tools/external/wabt/test/roundtrip/generate-from-import-name.txt diff --git a/external/wabt/test/roundtrip/generate-func-names.txt b/tools/external/wabt/test/roundtrip/generate-func-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-func-names.txt rename to tools/external/wabt/test/roundtrip/generate-func-names.txt diff --git a/external/wabt/test/roundtrip/generate-func-type-names.txt b/tools/external/wabt/test/roundtrip/generate-func-type-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-func-type-names.txt rename to tools/external/wabt/test/roundtrip/generate-func-type-names.txt diff --git a/external/wabt/test/roundtrip/generate-global-names.txt b/tools/external/wabt/test/roundtrip/generate-global-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-global-names.txt rename to tools/external/wabt/test/roundtrip/generate-global-names.txt diff --git a/external/wabt/test/roundtrip/generate-if-label-names.txt b/tools/external/wabt/test/roundtrip/generate-if-label-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-if-label-names.txt rename to tools/external/wabt/test/roundtrip/generate-if-label-names.txt diff --git a/external/wabt/test/roundtrip/generate-import-names.txt b/tools/external/wabt/test/roundtrip/generate-import-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-import-names.txt rename to tools/external/wabt/test/roundtrip/generate-import-names.txt diff --git a/external/wabt/test/roundtrip/generate-label-names.txt b/tools/external/wabt/test/roundtrip/generate-label-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-label-names.txt rename to tools/external/wabt/test/roundtrip/generate-label-names.txt diff --git a/external/wabt/test/roundtrip/generate-local-names.txt b/tools/external/wabt/test/roundtrip/generate-local-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-local-names.txt rename to tools/external/wabt/test/roundtrip/generate-local-names.txt diff --git a/external/wabt/test/roundtrip/generate-some-names.txt b/tools/external/wabt/test/roundtrip/generate-some-names.txt similarity index 100% rename from external/wabt/test/roundtrip/generate-some-names.txt rename to tools/external/wabt/test/roundtrip/generate-some-names.txt diff --git a/external/wabt/test/roundtrip/global-index.txt b/tools/external/wabt/test/roundtrip/global-index.txt similarity index 100% rename from external/wabt/test/roundtrip/global-index.txt rename to tools/external/wabt/test/roundtrip/global-index.txt diff --git a/external/wabt/test/roundtrip/inline-export-func-name.txt b/tools/external/wabt/test/roundtrip/inline-export-func-name.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-export-func-name.txt rename to tools/external/wabt/test/roundtrip/inline-export-func-name.txt diff --git a/external/wabt/test/roundtrip/inline-export-func.txt b/tools/external/wabt/test/roundtrip/inline-export-func.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-export-func.txt rename to tools/external/wabt/test/roundtrip/inline-export-func.txt diff --git a/external/wabt/test/roundtrip/inline-export-global.txt b/tools/external/wabt/test/roundtrip/inline-export-global.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-export-global.txt rename to tools/external/wabt/test/roundtrip/inline-export-global.txt diff --git a/external/wabt/test/roundtrip/inline-export-memory.txt b/tools/external/wabt/test/roundtrip/inline-export-memory.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-export-memory.txt rename to tools/external/wabt/test/roundtrip/inline-export-memory.txt diff --git a/external/wabt/test/roundtrip/inline-export-multi.txt b/tools/external/wabt/test/roundtrip/inline-export-multi.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-export-multi.txt rename to tools/external/wabt/test/roundtrip/inline-export-multi.txt diff --git a/external/wabt/test/roundtrip/inline-export-table.txt b/tools/external/wabt/test/roundtrip/inline-export-table.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-export-table.txt rename to tools/external/wabt/test/roundtrip/inline-export-table.txt diff --git a/external/wabt/test/roundtrip/inline-import-export.txt b/tools/external/wabt/test/roundtrip/inline-import-export.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-import-export.txt rename to tools/external/wabt/test/roundtrip/inline-import-export.txt diff --git a/external/wabt/test/roundtrip/inline-import-func.txt b/tools/external/wabt/test/roundtrip/inline-import-func.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-import-func.txt rename to tools/external/wabt/test/roundtrip/inline-import-func.txt diff --git a/external/wabt/test/roundtrip/inline-import-global.txt b/tools/external/wabt/test/roundtrip/inline-import-global.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-import-global.txt rename to tools/external/wabt/test/roundtrip/inline-import-global.txt diff --git a/external/wabt/test/roundtrip/inline-import-memory.txt b/tools/external/wabt/test/roundtrip/inline-import-memory.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-import-memory.txt rename to tools/external/wabt/test/roundtrip/inline-import-memory.txt diff --git a/external/wabt/test/roundtrip/inline-import-table.txt b/tools/external/wabt/test/roundtrip/inline-import-table.txt similarity index 100% rename from external/wabt/test/roundtrip/inline-import-table.txt rename to tools/external/wabt/test/roundtrip/inline-import-table.txt diff --git a/external/wabt/test/roundtrip/invalid-br-var.txt b/tools/external/wabt/test/roundtrip/invalid-br-var.txt similarity index 100% rename from external/wabt/test/roundtrip/invalid-br-var.txt rename to tools/external/wabt/test/roundtrip/invalid-br-var.txt diff --git a/external/wabt/test/roundtrip/invalid-local-index.txt b/tools/external/wabt/test/roundtrip/invalid-local-index.txt similarity index 100% rename from external/wabt/test/roundtrip/invalid-local-index.txt rename to tools/external/wabt/test/roundtrip/invalid-local-index.txt diff --git a/external/wabt/test/roundtrip/label.txt b/tools/external/wabt/test/roundtrip/label.txt similarity index 100% rename from external/wabt/test/roundtrip/label.txt rename to tools/external/wabt/test/roundtrip/label.txt diff --git a/external/wabt/test/roundtrip/memory-index.txt b/tools/external/wabt/test/roundtrip/memory-index.txt similarity index 100% rename from external/wabt/test/roundtrip/memory-index.txt rename to tools/external/wabt/test/roundtrip/memory-index.txt diff --git a/external/wabt/test/roundtrip/table-index.txt b/tools/external/wabt/test/roundtrip/table-index.txt similarity index 100% rename from external/wabt/test/roundtrip/table-index.txt rename to tools/external/wabt/test/roundtrip/table-index.txt diff --git a/external/wabt/test/run-roundtrip.py b/tools/external/wabt/test/run-roundtrip.py similarity index 100% rename from external/wabt/test/run-roundtrip.py rename to tools/external/wabt/test/run-roundtrip.py diff --git a/external/wabt/test/run-spec-wasm2c.py b/tools/external/wabt/test/run-spec-wasm2c.py similarity index 100% rename from external/wabt/test/run-spec-wasm2c.py rename to tools/external/wabt/test/run-spec-wasm2c.py diff --git a/external/wabt/test/run-tests.py b/tools/external/wabt/test/run-tests.py similarity index 100% rename from external/wabt/test/run-tests.py rename to tools/external/wabt/test/run-tests.py diff --git a/external/wabt/test/spec-wasm2c-prefix.c b/tools/external/wabt/test/spec-wasm2c-prefix.c similarity index 100% rename from external/wabt/test/spec-wasm2c-prefix.c rename to tools/external/wabt/test/spec-wasm2c-prefix.c diff --git a/external/wabt/test/spec/address.txt b/tools/external/wabt/test/spec/address.txt similarity index 100% rename from external/wabt/test/spec/address.txt rename to tools/external/wabt/test/spec/address.txt diff --git a/external/wabt/test/spec/align.txt b/tools/external/wabt/test/spec/align.txt similarity index 100% rename from external/wabt/test/spec/align.txt rename to tools/external/wabt/test/spec/align.txt diff --git a/external/wabt/test/spec/binary.txt b/tools/external/wabt/test/spec/binary.txt similarity index 100% rename from external/wabt/test/spec/binary.txt rename to tools/external/wabt/test/spec/binary.txt diff --git a/external/wabt/test/spec/block.txt b/tools/external/wabt/test/spec/block.txt similarity index 100% rename from external/wabt/test/spec/block.txt rename to tools/external/wabt/test/spec/block.txt diff --git a/external/wabt/test/spec/br.txt b/tools/external/wabt/test/spec/br.txt similarity index 100% rename from external/wabt/test/spec/br.txt rename to tools/external/wabt/test/spec/br.txt diff --git a/external/wabt/test/spec/br_if.txt b/tools/external/wabt/test/spec/br_if.txt similarity index 100% rename from external/wabt/test/spec/br_if.txt rename to tools/external/wabt/test/spec/br_if.txt diff --git a/external/wabt/test/spec/br_table.txt b/tools/external/wabt/test/spec/br_table.txt similarity index 100% rename from external/wabt/test/spec/br_table.txt rename to tools/external/wabt/test/spec/br_table.txt diff --git a/external/wabt/test/spec/break-drop.txt b/tools/external/wabt/test/spec/break-drop.txt similarity index 100% rename from external/wabt/test/spec/break-drop.txt rename to tools/external/wabt/test/spec/break-drop.txt diff --git a/external/wabt/test/spec/call.txt b/tools/external/wabt/test/spec/call.txt similarity index 100% rename from external/wabt/test/spec/call.txt rename to tools/external/wabt/test/spec/call.txt diff --git a/external/wabt/test/spec/call_indirect.txt b/tools/external/wabt/test/spec/call_indirect.txt similarity index 100% rename from external/wabt/test/spec/call_indirect.txt rename to tools/external/wabt/test/spec/call_indirect.txt diff --git a/external/wabt/test/spec/comments.txt b/tools/external/wabt/test/spec/comments.txt similarity index 100% rename from external/wabt/test/spec/comments.txt rename to tools/external/wabt/test/spec/comments.txt diff --git a/external/wabt/test/spec/const.txt b/tools/external/wabt/test/spec/const.txt similarity index 100% rename from external/wabt/test/spec/const.txt rename to tools/external/wabt/test/spec/const.txt diff --git a/external/wabt/test/spec/conversions.txt b/tools/external/wabt/test/spec/conversions.txt similarity index 100% rename from external/wabt/test/spec/conversions.txt rename to tools/external/wabt/test/spec/conversions.txt diff --git a/external/wabt/test/spec/custom.txt b/tools/external/wabt/test/spec/custom.txt similarity index 100% rename from external/wabt/test/spec/custom.txt rename to tools/external/wabt/test/spec/custom.txt diff --git a/external/wabt/test/spec/custom_section.txt b/tools/external/wabt/test/spec/custom_section.txt similarity index 100% rename from external/wabt/test/spec/custom_section.txt rename to tools/external/wabt/test/spec/custom_section.txt diff --git a/external/wabt/test/spec/data.txt b/tools/external/wabt/test/spec/data.txt similarity index 100% rename from external/wabt/test/spec/data.txt rename to tools/external/wabt/test/spec/data.txt diff --git a/external/wabt/test/spec/elem.txt b/tools/external/wabt/test/spec/elem.txt similarity index 100% rename from external/wabt/test/spec/elem.txt rename to tools/external/wabt/test/spec/elem.txt diff --git a/external/wabt/test/spec/endianness.txt b/tools/external/wabt/test/spec/endianness.txt similarity index 100% rename from external/wabt/test/spec/endianness.txt rename to tools/external/wabt/test/spec/endianness.txt diff --git a/external/wabt/test/spec/exports.txt b/tools/external/wabt/test/spec/exports.txt similarity index 100% rename from external/wabt/test/spec/exports.txt rename to tools/external/wabt/test/spec/exports.txt diff --git a/external/wabt/test/spec/f32.txt b/tools/external/wabt/test/spec/f32.txt similarity index 100% rename from external/wabt/test/spec/f32.txt rename to tools/external/wabt/test/spec/f32.txt diff --git a/external/wabt/test/spec/f32_bitwise.txt b/tools/external/wabt/test/spec/f32_bitwise.txt similarity index 100% rename from external/wabt/test/spec/f32_bitwise.txt rename to tools/external/wabt/test/spec/f32_bitwise.txt diff --git a/external/wabt/test/spec/f32_cmp.txt b/tools/external/wabt/test/spec/f32_cmp.txt similarity index 100% rename from external/wabt/test/spec/f32_cmp.txt rename to tools/external/wabt/test/spec/f32_cmp.txt diff --git a/external/wabt/test/spec/f64.txt b/tools/external/wabt/test/spec/f64.txt similarity index 100% rename from external/wabt/test/spec/f64.txt rename to tools/external/wabt/test/spec/f64.txt diff --git a/external/wabt/test/spec/f64_bitwise.txt b/tools/external/wabt/test/spec/f64_bitwise.txt similarity index 100% rename from external/wabt/test/spec/f64_bitwise.txt rename to tools/external/wabt/test/spec/f64_bitwise.txt diff --git a/external/wabt/test/spec/f64_cmp.txt b/tools/external/wabt/test/spec/f64_cmp.txt similarity index 100% rename from external/wabt/test/spec/f64_cmp.txt rename to tools/external/wabt/test/spec/f64_cmp.txt diff --git a/external/wabt/test/spec/fac.txt b/tools/external/wabt/test/spec/fac.txt similarity index 100% rename from external/wabt/test/spec/fac.txt rename to tools/external/wabt/test/spec/fac.txt diff --git a/external/wabt/test/spec/float_exprs.txt b/tools/external/wabt/test/spec/float_exprs.txt similarity index 100% rename from external/wabt/test/spec/float_exprs.txt rename to tools/external/wabt/test/spec/float_exprs.txt diff --git a/external/wabt/test/spec/float_literals.txt b/tools/external/wabt/test/spec/float_literals.txt similarity index 100% rename from external/wabt/test/spec/float_literals.txt rename to tools/external/wabt/test/spec/float_literals.txt diff --git a/external/wabt/test/spec/float_memory.txt b/tools/external/wabt/test/spec/float_memory.txt similarity index 100% rename from external/wabt/test/spec/float_memory.txt rename to tools/external/wabt/test/spec/float_memory.txt diff --git a/external/wabt/test/spec/float_misc.txt b/tools/external/wabt/test/spec/float_misc.txt similarity index 100% rename from external/wabt/test/spec/float_misc.txt rename to tools/external/wabt/test/spec/float_misc.txt diff --git a/external/wabt/test/spec/forward.txt b/tools/external/wabt/test/spec/forward.txt similarity index 100% rename from external/wabt/test/spec/forward.txt rename to tools/external/wabt/test/spec/forward.txt diff --git a/external/wabt/test/spec/func.txt b/tools/external/wabt/test/spec/func.txt similarity index 100% rename from external/wabt/test/spec/func.txt rename to tools/external/wabt/test/spec/func.txt diff --git a/external/wabt/test/spec/func_ptrs.txt b/tools/external/wabt/test/spec/func_ptrs.txt similarity index 100% rename from external/wabt/test/spec/func_ptrs.txt rename to tools/external/wabt/test/spec/func_ptrs.txt diff --git a/external/wabt/test/spec/get_local.txt b/tools/external/wabt/test/spec/get_local.txt similarity index 100% rename from external/wabt/test/spec/get_local.txt rename to tools/external/wabt/test/spec/get_local.txt diff --git a/external/wabt/test/spec/globals.txt b/tools/external/wabt/test/spec/globals.txt similarity index 100% rename from external/wabt/test/spec/globals.txt rename to tools/external/wabt/test/spec/globals.txt diff --git a/external/wabt/test/spec/i32.txt b/tools/external/wabt/test/spec/i32.txt similarity index 100% rename from external/wabt/test/spec/i32.txt rename to tools/external/wabt/test/spec/i32.txt diff --git a/external/wabt/test/spec/i64.txt b/tools/external/wabt/test/spec/i64.txt similarity index 100% rename from external/wabt/test/spec/i64.txt rename to tools/external/wabt/test/spec/i64.txt diff --git a/external/wabt/test/spec/if.txt b/tools/external/wabt/test/spec/if.txt similarity index 100% rename from external/wabt/test/spec/if.txt rename to tools/external/wabt/test/spec/if.txt diff --git a/external/wabt/test/spec/imports.txt b/tools/external/wabt/test/spec/imports.txt similarity index 100% rename from external/wabt/test/spec/imports.txt rename to tools/external/wabt/test/spec/imports.txt diff --git a/external/wabt/test/spec/inline-module.txt b/tools/external/wabt/test/spec/inline-module.txt similarity index 100% rename from external/wabt/test/spec/inline-module.txt rename to tools/external/wabt/test/spec/inline-module.txt diff --git a/external/wabt/test/spec/int_exprs.txt b/tools/external/wabt/test/spec/int_exprs.txt similarity index 100% rename from external/wabt/test/spec/int_exprs.txt rename to tools/external/wabt/test/spec/int_exprs.txt diff --git a/external/wabt/test/spec/int_literals.txt b/tools/external/wabt/test/spec/int_literals.txt similarity index 100% rename from external/wabt/test/spec/int_literals.txt rename to tools/external/wabt/test/spec/int_literals.txt diff --git a/external/wabt/test/spec/labels.txt b/tools/external/wabt/test/spec/labels.txt similarity index 100% rename from external/wabt/test/spec/labels.txt rename to tools/external/wabt/test/spec/labels.txt diff --git a/external/wabt/test/spec/left-to-right.txt b/tools/external/wabt/test/spec/left-to-right.txt similarity index 100% rename from external/wabt/test/spec/left-to-right.txt rename to tools/external/wabt/test/spec/left-to-right.txt diff --git a/external/wabt/test/spec/linking.txt b/tools/external/wabt/test/spec/linking.txt similarity index 100% rename from external/wabt/test/spec/linking.txt rename to tools/external/wabt/test/spec/linking.txt diff --git a/external/wabt/test/spec/loop.txt b/tools/external/wabt/test/spec/loop.txt similarity index 100% rename from external/wabt/test/spec/loop.txt rename to tools/external/wabt/test/spec/loop.txt diff --git a/external/wabt/test/spec/memory.txt b/tools/external/wabt/test/spec/memory.txt similarity index 100% rename from external/wabt/test/spec/memory.txt rename to tools/external/wabt/test/spec/memory.txt diff --git a/external/wabt/test/spec/memory_redundancy.txt b/tools/external/wabt/test/spec/memory_redundancy.txt similarity index 100% rename from external/wabt/test/spec/memory_redundancy.txt rename to tools/external/wabt/test/spec/memory_redundancy.txt diff --git a/external/wabt/test/spec/memory_trap.txt b/tools/external/wabt/test/spec/memory_trap.txt similarity index 100% rename from external/wabt/test/spec/memory_trap.txt rename to tools/external/wabt/test/spec/memory_trap.txt diff --git a/external/wabt/test/spec/names.txt b/tools/external/wabt/test/spec/names.txt similarity index 100% rename from external/wabt/test/spec/names.txt rename to tools/external/wabt/test/spec/names.txt diff --git a/external/wabt/test/spec/nop.txt b/tools/external/wabt/test/spec/nop.txt similarity index 100% rename from external/wabt/test/spec/nop.txt rename to tools/external/wabt/test/spec/nop.txt diff --git a/external/wabt/test/spec/resizing.txt b/tools/external/wabt/test/spec/resizing.txt similarity index 100% rename from external/wabt/test/spec/resizing.txt rename to tools/external/wabt/test/spec/resizing.txt diff --git a/external/wabt/test/spec/return.txt b/tools/external/wabt/test/spec/return.txt similarity index 100% rename from external/wabt/test/spec/return.txt rename to tools/external/wabt/test/spec/return.txt diff --git a/external/wabt/test/spec/select.txt b/tools/external/wabt/test/spec/select.txt similarity index 100% rename from external/wabt/test/spec/select.txt rename to tools/external/wabt/test/spec/select.txt diff --git a/external/wabt/test/spec/set_local.txt b/tools/external/wabt/test/spec/set_local.txt similarity index 100% rename from external/wabt/test/spec/set_local.txt rename to tools/external/wabt/test/spec/set_local.txt diff --git a/external/wabt/test/spec/skip-stack-guard-page.txt b/tools/external/wabt/test/spec/skip-stack-guard-page.txt similarity index 100% rename from external/wabt/test/spec/skip-stack-guard-page.txt rename to tools/external/wabt/test/spec/skip-stack-guard-page.txt diff --git a/external/wabt/test/spec/stack.txt b/tools/external/wabt/test/spec/stack.txt similarity index 100% rename from external/wabt/test/spec/stack.txt rename to tools/external/wabt/test/spec/stack.txt diff --git a/external/wabt/test/spec/start.txt b/tools/external/wabt/test/spec/start.txt similarity index 100% rename from external/wabt/test/spec/start.txt rename to tools/external/wabt/test/spec/start.txt diff --git a/external/wabt/test/spec/store_retval.txt b/tools/external/wabt/test/spec/store_retval.txt similarity index 100% rename from external/wabt/test/spec/store_retval.txt rename to tools/external/wabt/test/spec/store_retval.txt diff --git a/external/wabt/test/spec/switch.txt b/tools/external/wabt/test/spec/switch.txt similarity index 100% rename from external/wabt/test/spec/switch.txt rename to tools/external/wabt/test/spec/switch.txt diff --git a/external/wabt/test/spec/tee_local.txt b/tools/external/wabt/test/spec/tee_local.txt similarity index 100% rename from external/wabt/test/spec/tee_local.txt rename to tools/external/wabt/test/spec/tee_local.txt diff --git a/external/wabt/test/spec/token.txt b/tools/external/wabt/test/spec/token.txt similarity index 100% rename from external/wabt/test/spec/token.txt rename to tools/external/wabt/test/spec/token.txt diff --git a/external/wabt/test/spec/traps.txt b/tools/external/wabt/test/spec/traps.txt similarity index 100% rename from external/wabt/test/spec/traps.txt rename to tools/external/wabt/test/spec/traps.txt diff --git a/external/wabt/test/spec/type.txt b/tools/external/wabt/test/spec/type.txt similarity index 100% rename from external/wabt/test/spec/type.txt rename to tools/external/wabt/test/spec/type.txt diff --git a/external/wabt/test/spec/typecheck.txt b/tools/external/wabt/test/spec/typecheck.txt similarity index 100% rename from external/wabt/test/spec/typecheck.txt rename to tools/external/wabt/test/spec/typecheck.txt diff --git a/external/wabt/test/spec/unreachable.txt b/tools/external/wabt/test/spec/unreachable.txt similarity index 100% rename from external/wabt/test/spec/unreachable.txt rename to tools/external/wabt/test/spec/unreachable.txt diff --git a/external/wabt/test/spec/unreached-invalid.txt b/tools/external/wabt/test/spec/unreached-invalid.txt similarity index 100% rename from external/wabt/test/spec/unreached-invalid.txt rename to tools/external/wabt/test/spec/unreached-invalid.txt diff --git a/external/wabt/test/spec/unwind.txt b/tools/external/wabt/test/spec/unwind.txt similarity index 100% rename from external/wabt/test/spec/unwind.txt rename to tools/external/wabt/test/spec/unwind.txt diff --git a/external/wabt/test/spec/utf8-custom-section-id.txt b/tools/external/wabt/test/spec/utf8-custom-section-id.txt similarity index 100% rename from external/wabt/test/spec/utf8-custom-section-id.txt rename to tools/external/wabt/test/spec/utf8-custom-section-id.txt diff --git a/external/wabt/test/spec/utf8-import-field.txt b/tools/external/wabt/test/spec/utf8-import-field.txt similarity index 100% rename from external/wabt/test/spec/utf8-import-field.txt rename to tools/external/wabt/test/spec/utf8-import-field.txt diff --git a/external/wabt/test/spec/utf8-import-module.txt b/tools/external/wabt/test/spec/utf8-import-module.txt similarity index 100% rename from external/wabt/test/spec/utf8-import-module.txt rename to tools/external/wabt/test/spec/utf8-import-module.txt diff --git a/external/wabt/test/spec/utf8-invalid-encoding.txt b/tools/external/wabt/test/spec/utf8-invalid-encoding.txt similarity index 100% rename from external/wabt/test/spec/utf8-invalid-encoding.txt rename to tools/external/wabt/test/spec/utf8-invalid-encoding.txt diff --git a/external/wabt/test/too-many-arguments.txt b/tools/external/wabt/test/too-many-arguments.txt similarity index 100% rename from external/wabt/test/too-many-arguments.txt rename to tools/external/wabt/test/too-many-arguments.txt diff --git a/external/wabt/test/two-commands.txt b/tools/external/wabt/test/two-commands.txt similarity index 100% rename from external/wabt/test/two-commands.txt rename to tools/external/wabt/test/two-commands.txt diff --git a/external/wabt/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-assertreturn-invoke-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-assertreturn-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-assertreturn-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-assertreturn-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-assertreturn-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-atomic-no-shared-memory.txt b/tools/external/wabt/test/typecheck/bad-atomic-no-shared-memory.txt similarity index 100% rename from external/wabt/test/typecheck/bad-atomic-no-shared-memory.txt rename to tools/external/wabt/test/typecheck/bad-atomic-no-shared-memory.txt diff --git a/external/wabt/test/typecheck/bad-atomic-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-atomic-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-atomic-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-atomic-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-binary-type-mismatch-1.txt b/tools/external/wabt/test/typecheck/bad-binary-type-mismatch-1.txt similarity index 100% rename from external/wabt/test/typecheck/bad-binary-type-mismatch-1.txt rename to tools/external/wabt/test/typecheck/bad-binary-type-mismatch-1.txt diff --git a/external/wabt/test/typecheck/bad-binary-type-mismatch-2.txt b/tools/external/wabt/test/typecheck/bad-binary-type-mismatch-2.txt similarity index 100% rename from external/wabt/test/typecheck/bad-binary-type-mismatch-2.txt rename to tools/external/wabt/test/typecheck/bad-binary-type-mismatch-2.txt diff --git a/external/wabt/test/typecheck/bad-block-multi-mismatch.txt b/tools/external/wabt/test/typecheck/bad-block-multi-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-block-multi-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-block-multi-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-brtable-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-brtable-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-brtable-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-brtable-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-call-result-mismatch.txt b/tools/external/wabt/test/typecheck/bad-call-result-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-call-result-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-call-result-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-call-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-call-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-call-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-call-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-callimport-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-callimport-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-callimport-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-callimport-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-callindirect-func-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-callindirect-func-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-callindirect-func-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-callindirect-func-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-callindirect-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-callindirect-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-callindirect-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-callindirect-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-cast-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-cast-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-cast-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-cast-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-compare-type-mismatch-1.txt b/tools/external/wabt/test/typecheck/bad-compare-type-mismatch-1.txt similarity index 100% rename from external/wabt/test/typecheck/bad-compare-type-mismatch-1.txt rename to tools/external/wabt/test/typecheck/bad-compare-type-mismatch-1.txt diff --git a/external/wabt/test/typecheck/bad-compare-type-mismatch-2.txt b/tools/external/wabt/test/typecheck/bad-compare-type-mismatch-2.txt similarity index 100% rename from external/wabt/test/typecheck/bad-compare-type-mismatch-2.txt rename to tools/external/wabt/test/typecheck/bad-compare-type-mismatch-2.txt diff --git a/external/wabt/test/typecheck/bad-convert-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-convert-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-convert-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-convert-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-expr-if.txt b/tools/external/wabt/test/typecheck/bad-expr-if.txt similarity index 100% rename from external/wabt/test/typecheck/bad-expr-if.txt rename to tools/external/wabt/test/typecheck/bad-expr-if.txt diff --git a/external/wabt/test/typecheck/bad-function-result-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-function-result-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-function-result-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-function-result-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-global-getglobal-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-global-getglobal-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-global-getglobal-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-global-getglobal-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-global-no-init-expr.txt b/tools/external/wabt/test/typecheck/bad-global-no-init-expr.txt similarity index 100% rename from external/wabt/test/typecheck/bad-global-no-init-expr.txt rename to tools/external/wabt/test/typecheck/bad-global-no-init-expr.txt diff --git a/external/wabt/test/typecheck/bad-global-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-global-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-global-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-global-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-grow-memory-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-grow-memory-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-grow-memory-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-grow-memory-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-if-condition-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-if-condition-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-if-condition-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-if-condition-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-if-multi-mismatch.txt b/tools/external/wabt/test/typecheck/bad-if-multi-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-if-multi-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-if-multi-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-if-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-if-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-if-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-if-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-if-value-void.txt b/tools/external/wabt/test/typecheck/bad-if-value-void.txt similarity index 100% rename from external/wabt/test/typecheck/bad-if-value-void.txt rename to tools/external/wabt/test/typecheck/bad-if-value-void.txt diff --git a/external/wabt/test/typecheck/bad-invoke-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-invoke-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-invoke-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-invoke-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-load-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-load-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-load-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-load-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-loop-multi-mismatch.txt b/tools/external/wabt/test/typecheck/bad-loop-multi-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-loop-multi-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-loop-multi-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-nested-br.txt b/tools/external/wabt/test/typecheck/bad-nested-br.txt similarity index 100% rename from external/wabt/test/typecheck/bad-nested-br.txt rename to tools/external/wabt/test/typecheck/bad-nested-br.txt diff --git a/external/wabt/test/typecheck/bad-no-shared-memory.txt b/tools/external/wabt/test/typecheck/bad-no-shared-memory.txt similarity index 100% rename from external/wabt/test/typecheck/bad-no-shared-memory.txt rename to tools/external/wabt/test/typecheck/bad-no-shared-memory.txt diff --git a/external/wabt/test/typecheck/bad-return-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-return-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-return-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-return-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-select-cond.txt b/tools/external/wabt/test/typecheck/bad-select-cond.txt similarity index 100% rename from external/wabt/test/typecheck/bad-select-cond.txt rename to tools/external/wabt/test/typecheck/bad-select-cond.txt diff --git a/external/wabt/test/typecheck/bad-select-value0.txt b/tools/external/wabt/test/typecheck/bad-select-value0.txt similarity index 100% rename from external/wabt/test/typecheck/bad-select-value0.txt rename to tools/external/wabt/test/typecheck/bad-select-value0.txt diff --git a/external/wabt/test/typecheck/bad-select-value1.txt b/tools/external/wabt/test/typecheck/bad-select-value1.txt similarity index 100% rename from external/wabt/test/typecheck/bad-select-value1.txt rename to tools/external/wabt/test/typecheck/bad-select-value1.txt diff --git a/external/wabt/test/typecheck/bad-setlocal-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-setlocal-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-setlocal-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-setlocal-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-simd-lane.txt b/tools/external/wabt/test/typecheck/bad-simd-lane.txt similarity index 100% rename from external/wabt/test/typecheck/bad-simd-lane.txt rename to tools/external/wabt/test/typecheck/bad-simd-lane.txt diff --git a/external/wabt/test/typecheck/bad-store-index-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-store-index-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-store-index-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-store-index-type-mismatch.txt diff --git a/external/wabt/test/typecheck/bad-unary-type-mismatch.txt b/tools/external/wabt/test/typecheck/bad-unary-type-mismatch.txt similarity index 100% rename from external/wabt/test/typecheck/bad-unary-type-mismatch.txt rename to tools/external/wabt/test/typecheck/bad-unary-type-mismatch.txt diff --git a/external/wabt/test/typecheck/br-multi.txt b/tools/external/wabt/test/typecheck/br-multi.txt similarity index 100% rename from external/wabt/test/typecheck/br-multi.txt rename to tools/external/wabt/test/typecheck/br-multi.txt diff --git a/external/wabt/test/typecheck/br-table-loop.txt b/tools/external/wabt/test/typecheck/br-table-loop.txt similarity index 100% rename from external/wabt/test/typecheck/br-table-loop.txt rename to tools/external/wabt/test/typecheck/br-table-loop.txt diff --git a/external/wabt/test/typecheck/brif-multi.txt b/tools/external/wabt/test/typecheck/brif-multi.txt similarity index 100% rename from external/wabt/test/typecheck/brif-multi.txt rename to tools/external/wabt/test/typecheck/brif-multi.txt diff --git a/external/wabt/test/typecheck/brtable-multi.txt b/tools/external/wabt/test/typecheck/brtable-multi.txt similarity index 100% rename from external/wabt/test/typecheck/brtable-multi.txt rename to tools/external/wabt/test/typecheck/brtable-multi.txt diff --git a/external/wabt/test/typecheck/if-then-br.txt b/tools/external/wabt/test/typecheck/if-then-br.txt similarity index 100% rename from external/wabt/test/typecheck/if-then-br.txt rename to tools/external/wabt/test/typecheck/if-then-br.txt diff --git a/external/wabt/test/typecheck/if-value.txt b/tools/external/wabt/test/typecheck/if-value.txt similarity index 100% rename from external/wabt/test/typecheck/if-value.txt rename to tools/external/wabt/test/typecheck/if-value.txt diff --git a/external/wabt/test/typecheck/label-redefinition.txt b/tools/external/wabt/test/typecheck/label-redefinition.txt similarity index 100% rename from external/wabt/test/typecheck/label-redefinition.txt rename to tools/external/wabt/test/typecheck/label-redefinition.txt diff --git a/external/wabt/test/typecheck/nested-br.txt b/tools/external/wabt/test/typecheck/nested-br.txt similarity index 100% rename from external/wabt/test/typecheck/nested-br.txt rename to tools/external/wabt/test/typecheck/nested-br.txt diff --git a/external/wabt/test/typecheck/nocheck.txt b/tools/external/wabt/test/typecheck/nocheck.txt similarity index 100% rename from external/wabt/test/typecheck/nocheck.txt rename to tools/external/wabt/test/typecheck/nocheck.txt diff --git a/external/wabt/test/typecheck/return-drop-value-2.txt b/tools/external/wabt/test/typecheck/return-drop-value-2.txt similarity index 100% rename from external/wabt/test/typecheck/return-drop-value-2.txt rename to tools/external/wabt/test/typecheck/return-drop-value-2.txt diff --git a/external/wabt/test/typecheck/return-drop-value.txt b/tools/external/wabt/test/typecheck/return-drop-value.txt similarity index 100% rename from external/wabt/test/typecheck/return-drop-value.txt rename to tools/external/wabt/test/typecheck/return-drop-value.txt diff --git a/external/wabt/test/typecheck/return-value.txt b/tools/external/wabt/test/typecheck/return-value.txt similarity index 100% rename from external/wabt/test/typecheck/return-value.txt rename to tools/external/wabt/test/typecheck/return-value.txt diff --git a/external/wabt/test/update-spec-tests.py b/tools/external/wabt/test/update-spec-tests.py similarity index 100% rename from external/wabt/test/update-spec-tests.py rename to tools/external/wabt/test/update-spec-tests.py diff --git a/external/wabt/test/utils.py b/tools/external/wabt/test/utils.py similarity index 100% rename from external/wabt/test/utils.py rename to tools/external/wabt/test/utils.py diff --git a/external/wabt/test/wasm2c/bad-enable-feature.txt b/tools/external/wabt/test/wasm2c/bad-enable-feature.txt similarity index 100% rename from external/wabt/test/wasm2c/bad-enable-feature.txt rename to tools/external/wabt/test/wasm2c/bad-enable-feature.txt diff --git a/external/wabt/test/wasm2c/spec/address.txt b/tools/external/wabt/test/wasm2c/spec/address.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/address.txt rename to tools/external/wabt/test/wasm2c/spec/address.txt diff --git a/external/wabt/test/wasm2c/spec/align.txt b/tools/external/wabt/test/wasm2c/spec/align.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/align.txt rename to tools/external/wabt/test/wasm2c/spec/align.txt diff --git a/external/wabt/test/wasm2c/spec/binary.txt b/tools/external/wabt/test/wasm2c/spec/binary.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/binary.txt rename to tools/external/wabt/test/wasm2c/spec/binary.txt diff --git a/external/wabt/test/wasm2c/spec/block.txt b/tools/external/wabt/test/wasm2c/spec/block.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/block.txt rename to tools/external/wabt/test/wasm2c/spec/block.txt diff --git a/external/wabt/test/wasm2c/spec/br.txt b/tools/external/wabt/test/wasm2c/spec/br.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/br.txt rename to tools/external/wabt/test/wasm2c/spec/br.txt diff --git a/external/wabt/test/wasm2c/spec/br_if.txt b/tools/external/wabt/test/wasm2c/spec/br_if.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/br_if.txt rename to tools/external/wabt/test/wasm2c/spec/br_if.txt diff --git a/external/wabt/test/wasm2c/spec/br_table.txt b/tools/external/wabt/test/wasm2c/spec/br_table.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/br_table.txt rename to tools/external/wabt/test/wasm2c/spec/br_table.txt diff --git a/external/wabt/test/wasm2c/spec/break-drop.txt b/tools/external/wabt/test/wasm2c/spec/break-drop.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/break-drop.txt rename to tools/external/wabt/test/wasm2c/spec/break-drop.txt diff --git a/external/wabt/test/wasm2c/spec/call.txt b/tools/external/wabt/test/wasm2c/spec/call.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/call.txt rename to tools/external/wabt/test/wasm2c/spec/call.txt diff --git a/external/wabt/test/wasm2c/spec/call_indirect.txt b/tools/external/wabt/test/wasm2c/spec/call_indirect.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/call_indirect.txt rename to tools/external/wabt/test/wasm2c/spec/call_indirect.txt diff --git a/external/wabt/test/wasm2c/spec/comments.txt b/tools/external/wabt/test/wasm2c/spec/comments.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/comments.txt rename to tools/external/wabt/test/wasm2c/spec/comments.txt diff --git a/external/wabt/test/wasm2c/spec/const.txt b/tools/external/wabt/test/wasm2c/spec/const.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/const.txt rename to tools/external/wabt/test/wasm2c/spec/const.txt diff --git a/external/wabt/test/wasm2c/spec/conversions.txt b/tools/external/wabt/test/wasm2c/spec/conversions.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/conversions.txt rename to tools/external/wabt/test/wasm2c/spec/conversions.txt diff --git a/external/wabt/test/wasm2c/spec/custom_section.txt b/tools/external/wabt/test/wasm2c/spec/custom_section.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/custom_section.txt rename to tools/external/wabt/test/wasm2c/spec/custom_section.txt diff --git a/external/wabt/test/wasm2c/spec/endianness.txt b/tools/external/wabt/test/wasm2c/spec/endianness.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/endianness.txt rename to tools/external/wabt/test/wasm2c/spec/endianness.txt diff --git a/external/wabt/test/wasm2c/spec/exports.txt b/tools/external/wabt/test/wasm2c/spec/exports.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/exports.txt rename to tools/external/wabt/test/wasm2c/spec/exports.txt diff --git a/external/wabt/test/wasm2c/spec/f32.txt b/tools/external/wabt/test/wasm2c/spec/f32.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/f32.txt rename to tools/external/wabt/test/wasm2c/spec/f32.txt diff --git a/external/wabt/test/wasm2c/spec/f32_bitwise.txt b/tools/external/wabt/test/wasm2c/spec/f32_bitwise.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/f32_bitwise.txt rename to tools/external/wabt/test/wasm2c/spec/f32_bitwise.txt diff --git a/external/wabt/test/wasm2c/spec/f32_cmp.txt b/tools/external/wabt/test/wasm2c/spec/f32_cmp.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/f32_cmp.txt rename to tools/external/wabt/test/wasm2c/spec/f32_cmp.txt diff --git a/external/wabt/test/wasm2c/spec/f64.txt b/tools/external/wabt/test/wasm2c/spec/f64.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/f64.txt rename to tools/external/wabt/test/wasm2c/spec/f64.txt diff --git a/external/wabt/test/wasm2c/spec/f64_bitwise.txt b/tools/external/wabt/test/wasm2c/spec/f64_bitwise.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/f64_bitwise.txt rename to tools/external/wabt/test/wasm2c/spec/f64_bitwise.txt diff --git a/external/wabt/test/wasm2c/spec/f64_cmp.txt b/tools/external/wabt/test/wasm2c/spec/f64_cmp.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/f64_cmp.txt rename to tools/external/wabt/test/wasm2c/spec/f64_cmp.txt diff --git a/external/wabt/test/wasm2c/spec/fac.txt b/tools/external/wabt/test/wasm2c/spec/fac.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/fac.txt rename to tools/external/wabt/test/wasm2c/spec/fac.txt diff --git a/external/wabt/test/wasm2c/spec/float_exprs.txt b/tools/external/wabt/test/wasm2c/spec/float_exprs.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/float_exprs.txt rename to tools/external/wabt/test/wasm2c/spec/float_exprs.txt diff --git a/external/wabt/test/wasm2c/spec/float_literals.txt b/tools/external/wabt/test/wasm2c/spec/float_literals.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/float_literals.txt rename to tools/external/wabt/test/wasm2c/spec/float_literals.txt diff --git a/external/wabt/test/wasm2c/spec/float_memory.txt b/tools/external/wabt/test/wasm2c/spec/float_memory.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/float_memory.txt rename to tools/external/wabt/test/wasm2c/spec/float_memory.txt diff --git a/external/wabt/test/wasm2c/spec/float_misc.txt b/tools/external/wabt/test/wasm2c/spec/float_misc.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/float_misc.txt rename to tools/external/wabt/test/wasm2c/spec/float_misc.txt diff --git a/external/wabt/test/wasm2c/spec/forward.txt b/tools/external/wabt/test/wasm2c/spec/forward.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/forward.txt rename to tools/external/wabt/test/wasm2c/spec/forward.txt diff --git a/external/wabt/test/wasm2c/spec/func.txt b/tools/external/wabt/test/wasm2c/spec/func.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/func.txt rename to tools/external/wabt/test/wasm2c/spec/func.txt diff --git a/external/wabt/test/wasm2c/spec/func_ptrs.txt b/tools/external/wabt/test/wasm2c/spec/func_ptrs.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/func_ptrs.txt rename to tools/external/wabt/test/wasm2c/spec/func_ptrs.txt diff --git a/external/wabt/test/wasm2c/spec/get_local.txt b/tools/external/wabt/test/wasm2c/spec/get_local.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/get_local.txt rename to tools/external/wabt/test/wasm2c/spec/get_local.txt diff --git a/external/wabt/test/wasm2c/spec/globals.txt b/tools/external/wabt/test/wasm2c/spec/globals.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/globals.txt rename to tools/external/wabt/test/wasm2c/spec/globals.txt diff --git a/external/wabt/test/wasm2c/spec/i32.txt b/tools/external/wabt/test/wasm2c/spec/i32.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/i32.txt rename to tools/external/wabt/test/wasm2c/spec/i32.txt diff --git a/external/wabt/test/wasm2c/spec/i64.txt b/tools/external/wabt/test/wasm2c/spec/i64.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/i64.txt rename to tools/external/wabt/test/wasm2c/spec/i64.txt diff --git a/external/wabt/test/wasm2c/spec/if.txt b/tools/external/wabt/test/wasm2c/spec/if.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/if.txt rename to tools/external/wabt/test/wasm2c/spec/if.txt diff --git a/external/wabt/test/wasm2c/spec/imports.txt b/tools/external/wabt/test/wasm2c/spec/imports.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/imports.txt rename to tools/external/wabt/test/wasm2c/spec/imports.txt diff --git a/external/wabt/test/wasm2c/spec/inline-module.txt b/tools/external/wabt/test/wasm2c/spec/inline-module.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/inline-module.txt rename to tools/external/wabt/test/wasm2c/spec/inline-module.txt diff --git a/external/wabt/test/wasm2c/spec/int_exprs.txt b/tools/external/wabt/test/wasm2c/spec/int_exprs.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/int_exprs.txt rename to tools/external/wabt/test/wasm2c/spec/int_exprs.txt diff --git a/external/wabt/test/wasm2c/spec/int_literals.txt b/tools/external/wabt/test/wasm2c/spec/int_literals.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/int_literals.txt rename to tools/external/wabt/test/wasm2c/spec/int_literals.txt diff --git a/external/wabt/test/wasm2c/spec/labels.txt b/tools/external/wabt/test/wasm2c/spec/labels.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/labels.txt rename to tools/external/wabt/test/wasm2c/spec/labels.txt diff --git a/external/wabt/test/wasm2c/spec/left-to-right.txt b/tools/external/wabt/test/wasm2c/spec/left-to-right.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/left-to-right.txt rename to tools/external/wabt/test/wasm2c/spec/left-to-right.txt diff --git a/external/wabt/test/wasm2c/spec/linking.txt b/tools/external/wabt/test/wasm2c/spec/linking.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/linking.txt rename to tools/external/wabt/test/wasm2c/spec/linking.txt diff --git a/external/wabt/test/wasm2c/spec/loop.txt b/tools/external/wabt/test/wasm2c/spec/loop.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/loop.txt rename to tools/external/wabt/test/wasm2c/spec/loop.txt diff --git a/external/wabt/test/wasm2c/spec/memory.txt b/tools/external/wabt/test/wasm2c/spec/memory.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/memory.txt rename to tools/external/wabt/test/wasm2c/spec/memory.txt diff --git a/external/wabt/test/wasm2c/spec/memory_redundancy.txt b/tools/external/wabt/test/wasm2c/spec/memory_redundancy.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/memory_redundancy.txt rename to tools/external/wabt/test/wasm2c/spec/memory_redundancy.txt diff --git a/external/wabt/test/wasm2c/spec/memory_trap.txt b/tools/external/wabt/test/wasm2c/spec/memory_trap.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/memory_trap.txt rename to tools/external/wabt/test/wasm2c/spec/memory_trap.txt diff --git a/external/wabt/test/wasm2c/spec/names.txt b/tools/external/wabt/test/wasm2c/spec/names.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/names.txt rename to tools/external/wabt/test/wasm2c/spec/names.txt diff --git a/external/wabt/test/wasm2c/spec/nop.txt b/tools/external/wabt/test/wasm2c/spec/nop.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/nop.txt rename to tools/external/wabt/test/wasm2c/spec/nop.txt diff --git a/external/wabt/test/wasm2c/spec/resizing.txt b/tools/external/wabt/test/wasm2c/spec/resizing.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/resizing.txt rename to tools/external/wabt/test/wasm2c/spec/resizing.txt diff --git a/external/wabt/test/wasm2c/spec/return.txt b/tools/external/wabt/test/wasm2c/spec/return.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/return.txt rename to tools/external/wabt/test/wasm2c/spec/return.txt diff --git a/external/wabt/test/wasm2c/spec/select.txt b/tools/external/wabt/test/wasm2c/spec/select.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/select.txt rename to tools/external/wabt/test/wasm2c/spec/select.txt diff --git a/external/wabt/test/wasm2c/spec/set_local.txt b/tools/external/wabt/test/wasm2c/spec/set_local.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/set_local.txt rename to tools/external/wabt/test/wasm2c/spec/set_local.txt diff --git a/external/wabt/test/wasm2c/spec/skip-stack-guard-page.txt b/tools/external/wabt/test/wasm2c/spec/skip-stack-guard-page.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/skip-stack-guard-page.txt rename to tools/external/wabt/test/wasm2c/spec/skip-stack-guard-page.txt diff --git a/external/wabt/test/wasm2c/spec/stack.txt b/tools/external/wabt/test/wasm2c/spec/stack.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/stack.txt rename to tools/external/wabt/test/wasm2c/spec/stack.txt diff --git a/external/wabt/test/wasm2c/spec/start.txt b/tools/external/wabt/test/wasm2c/spec/start.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/start.txt rename to tools/external/wabt/test/wasm2c/spec/start.txt diff --git a/external/wabt/test/wasm2c/spec/store_retval.txt b/tools/external/wabt/test/wasm2c/spec/store_retval.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/store_retval.txt rename to tools/external/wabt/test/wasm2c/spec/store_retval.txt diff --git a/external/wabt/test/wasm2c/spec/switch.txt b/tools/external/wabt/test/wasm2c/spec/switch.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/switch.txt rename to tools/external/wabt/test/wasm2c/spec/switch.txt diff --git a/external/wabt/test/wasm2c/spec/tee_local.txt b/tools/external/wabt/test/wasm2c/spec/tee_local.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/tee_local.txt rename to tools/external/wabt/test/wasm2c/spec/tee_local.txt diff --git a/external/wabt/test/wasm2c/spec/token.txt b/tools/external/wabt/test/wasm2c/spec/token.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/token.txt rename to tools/external/wabt/test/wasm2c/spec/token.txt diff --git a/external/wabt/test/wasm2c/spec/traps.txt b/tools/external/wabt/test/wasm2c/spec/traps.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/traps.txt rename to tools/external/wabt/test/wasm2c/spec/traps.txt diff --git a/external/wabt/test/wasm2c/spec/type.txt b/tools/external/wabt/test/wasm2c/spec/type.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/type.txt rename to tools/external/wabt/test/wasm2c/spec/type.txt diff --git a/external/wabt/test/wasm2c/spec/typecheck.txt b/tools/external/wabt/test/wasm2c/spec/typecheck.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/typecheck.txt rename to tools/external/wabt/test/wasm2c/spec/typecheck.txt diff --git a/external/wabt/test/wasm2c/spec/unreachable.txt b/tools/external/wabt/test/wasm2c/spec/unreachable.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/unreachable.txt rename to tools/external/wabt/test/wasm2c/spec/unreachable.txt diff --git a/external/wabt/test/wasm2c/spec/unreached-invalid.txt b/tools/external/wabt/test/wasm2c/spec/unreached-invalid.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/unreached-invalid.txt rename to tools/external/wabt/test/wasm2c/spec/unreached-invalid.txt diff --git a/external/wabt/test/wasm2c/spec/unwind.txt b/tools/external/wabt/test/wasm2c/spec/unwind.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/unwind.txt rename to tools/external/wabt/test/wasm2c/spec/unwind.txt diff --git a/external/wabt/test/wasm2c/spec/utf8-custom-section-id.txt b/tools/external/wabt/test/wasm2c/spec/utf8-custom-section-id.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/utf8-custom-section-id.txt rename to tools/external/wabt/test/wasm2c/spec/utf8-custom-section-id.txt diff --git a/external/wabt/test/wasm2c/spec/utf8-import-field.txt b/tools/external/wabt/test/wasm2c/spec/utf8-import-field.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/utf8-import-field.txt rename to tools/external/wabt/test/wasm2c/spec/utf8-import-field.txt diff --git a/external/wabt/test/wasm2c/spec/utf8-import-module.txt b/tools/external/wabt/test/wasm2c/spec/utf8-import-module.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/utf8-import-module.txt rename to tools/external/wabt/test/wasm2c/spec/utf8-import-module.txt diff --git a/external/wabt/test/wasm2c/spec/utf8-invalid-encoding.txt b/tools/external/wabt/test/wasm2c/spec/utf8-invalid-encoding.txt similarity index 100% rename from external/wabt/test/wasm2c/spec/utf8-invalid-encoding.txt rename to tools/external/wabt/test/wasm2c/spec/utf8-invalid-encoding.txt diff --git a/external/wabt/ubsan.blacklist b/tools/external/wabt/ubsan.blacklist similarity index 100% rename from external/wabt/ubsan.blacklist rename to tools/external/wabt/ubsan.blacklist diff --git a/external/wabt/wasm2c/README.md b/tools/external/wabt/wasm2c/README.md similarity index 100% rename from external/wabt/wasm2c/README.md rename to tools/external/wabt/wasm2c/README.md diff --git a/external/wabt/wasm2c/examples/fac/fac.c b/tools/external/wabt/wasm2c/examples/fac/fac.c similarity index 100% rename from external/wabt/wasm2c/examples/fac/fac.c rename to tools/external/wabt/wasm2c/examples/fac/fac.c diff --git a/external/wabt/wasm2c/examples/fac/fac.h b/tools/external/wabt/wasm2c/examples/fac/fac.h similarity index 100% rename from external/wabt/wasm2c/examples/fac/fac.h rename to tools/external/wabt/wasm2c/examples/fac/fac.h diff --git a/external/wabt/wasm2c/examples/fac/fac.wasm b/tools/external/wabt/wasm2c/examples/fac/fac.wasm similarity index 100% rename from external/wabt/wasm2c/examples/fac/fac.wasm rename to tools/external/wabt/wasm2c/examples/fac/fac.wasm diff --git a/external/wabt/wasm2c/examples/fac/fac.wat b/tools/external/wabt/wasm2c/examples/fac/fac.wat similarity index 100% rename from external/wabt/wasm2c/examples/fac/fac.wat rename to tools/external/wabt/wasm2c/examples/fac/fac.wat diff --git a/external/wabt/wasm2c/examples/fac/main.c b/tools/external/wabt/wasm2c/examples/fac/main.c similarity index 100% rename from external/wabt/wasm2c/examples/fac/main.c rename to tools/external/wabt/wasm2c/examples/fac/main.c diff --git a/external/wabt/wasm2c/wasm-rt-impl.c b/tools/external/wabt/wasm2c/wasm-rt-impl.c similarity index 100% rename from external/wabt/wasm2c/wasm-rt-impl.c rename to tools/external/wabt/wasm2c/wasm-rt-impl.c diff --git a/external/wabt/wasm2c/wasm-rt-impl.h b/tools/external/wabt/wasm2c/wasm-rt-impl.h similarity index 100% rename from external/wabt/wasm2c/wasm-rt-impl.h rename to tools/external/wabt/wasm2c/wasm-rt-impl.h diff --git a/external/wabt/wasm2c/wasm-rt.h b/tools/external/wabt/wasm2c/wasm-rt.h similarity index 100% rename from external/wabt/wasm2c/wasm-rt.h rename to tools/external/wabt/wasm2c/wasm-rt.h diff --git a/tools/include/compiler_options.hpp.in b/tools/include/compiler_options.hpp.in index d4168cb06a..d159228779 100644 --- a/tools/include/compiler_options.hpp.in +++ b/tools/include/compiler_options.hpp.in @@ -69,6 +69,20 @@ static cl::list input_filename_opt( cl::desc(" ..."), cl::cat(LD_CAT), cl::OneOrMore); +static cl::opt fasm_opt( + "fasm", + cl::desc("Assemble file for x86-64"), + cl::ZeroOrMore, + cl::cat(LD_CAT)); +static cl::opt fnative_opt( + "fnative", + cl::desc("Compile and link for x86-64"), + cl::ZeroOrMore, + cl::cat(LD_CAT)); +static cl::opt fuse_main_opt( + "fuse-main", + cl::desc("Use main as entry"), + cl::cat(LD_CAT)); /// End of ld options #ifndef ONLY_LD @@ -299,44 +313,86 @@ struct Options { std::vector ld_options; std::vector abigen_options; std::vector abigen_resources; + bool native; }; static void GetCompDefaults(std::vector& copts) { const char* eosio_apply_suff = "${CMAKE_SHARED_LIBRARY_SUFFIX}"; std::string apply_lib; - copts.emplace_back("--target=wasm32"); - copts.emplace_back("-nostdlib"); - copts.emplace_back("-ffreestanding"); - copts.emplace_back("-fno-builtin"); - copts.emplace_back("-fno-threadsafe-statics"); -#ifdef CPP_COMP - copts.emplace_back("-fno-rtti"); - copts.emplace_back("-fno-exceptions"); + if (!fnative_opt) { + copts.emplace_back("--target=wasm32"); + copts.emplace_back("-ffreestanding"); + } else { + copts.emplace_back("-msoft-float"); + copts.emplace_back("-mno-implicit-float"); +#ifdef __APPLE__ + copts.emplace_back("--target=x86_64-unknown-darwin-macho"); + copts.emplace_back("-mmacosx-version-min=10.13"); + copts.emplace_back("-fno-stack-protector"); + copts.emplace_back("-m64"); +#else + copts.emplace_back("--target=x86_64-unknown-linux-gnu"); + copts.emplace_back("-m64"); #endif - copts.emplace_back("-DBOOST_DISABLE_ASSERTS"); - copts.emplace_back("-DBOOST_EXCEPTION_DISABLE"); - copts.emplace_back("-Xclang"); - copts.emplace_back("-load"); - copts.emplace_back("-Xclang"); - if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/LLVMEosioApply"+eosio_apply_suff)) - copts.emplace_back(eosio::cdt::whereami::where()+"/LLVMEosioApply"+eosio_apply_suff); - else if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/../lib/LLVMEosioApply"+eosio_apply_suff)) - copts.emplace_back(eosio::cdt::whereami::where()+"/../lib/LLVMEosioApply"+eosio_apply_suff); + if (!fasm_opt) { + copts.emplace_back("-DEOSIO_NATIVE"); + copts.emplace_back("-DLP64"); + } + } + //copts.emplace_back("-nostdlib"); - if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/eosio_plugin"+eosio_apply_suff)) - copts.emplace_back("-fplugin="+eosio::cdt::whereami::where()+"/eosio_plugin"+eosio_apply_suff); - else if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/../lib/eosio_plugin"+eosio_apply_suff)) - copts.emplace_back("-fplugin="+eosio::cdt::whereami::where()+"/../lib/eosio_plugin"+eosio_apply_suff); + if (!fasm_opt) { + copts.emplace_back("-fno-threadsafe-statics"); +#ifdef CPP_COMP + copts.emplace_back("-fno-rtti"); + copts.emplace_back("-fno-exceptions"); + copts.emplace_back("-fmodules-ts"); +#endif + copts.emplace_back("-DBOOST_DISABLE_ASSERTS"); + copts.emplace_back("-DBOOST_EXCEPTION_DISABLE"); + if (!fnative_opt) { + copts.emplace_back("-Xclang"); + copts.emplace_back("-load"); + copts.emplace_back("-Xclang"); + if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/LLVMEosioApply"+eosio_apply_suff)) + copts.emplace_back(eosio::cdt::whereami::where()+"/LLVMEosioApply"+eosio_apply_suff); + else if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/../lib/LLVMEosioApply"+eosio_apply_suff)) + copts.emplace_back(eosio::cdt::whereami::where()+"/../lib/LLVMEosioApply"+eosio_apply_suff); + } + if (false && fnative_opt) { + copts.emplace_back("-Xclang"); + copts.emplace_back("-load"); + copts.emplace_back("-Xclang"); + if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/LLVMEosioSoftfloat"+eosio_apply_suff)) + copts.emplace_back(eosio::cdt::whereami::where()+"/LLVMEosioSoftfloat"+eosio_apply_suff); + else if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/../lib/LLVMEosioSoftfloat"+eosio_apply_suff)) + copts.emplace_back(eosio::cdt::whereami::where()+"/../lib/LLVMEosioSoftfloat"+eosio_apply_suff); + } + if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/eosio_plugin"+eosio_apply_suff)) + copts.emplace_back("-fplugin="+eosio::cdt::whereami::where()+"/eosio_plugin"+eosio_apply_suff); + else if (llvm::sys::fs::exists(eosio::cdt::whereami::where()+"/../lib/eosio_plugin"+eosio_apply_suff)) + copts.emplace_back("-fplugin="+eosio::cdt::whereami::where()+"/../lib/eosio_plugin"+eosio_apply_suff); + } } #ifdef ONLY_LD static void GetLdDefaults(std::vector& ldopts) { - ldopts.emplace_back("-e apply"); - ldopts.emplace_back("--gc-sections"); - ldopts.emplace_back("--strip-all"); - ldopts.emplace_back("-zstack-size="+std::string("${EOSIO_STACK_SIZE}")); - ldopts.emplace_back("--merge-data-segments"); + if (!fnative_opt) { + if (fuse_main_opt) + ldopts.emplace_back("-e main"); + else + ldopts.emplace_back("-e apply"); + ldopts.emplace_back("--gc-sections"); + ldopts.emplace_back("--strip-all"); + ldopts.emplace_back("-zstack-size="+std::string("${EOSIO_STACK_SIZE}")); + ldopts.emplace_back("--merge-data-segments"); + } else { +#ifdef __APPLE__ + ldopts.emplace_back("-arch x86_64 -macosx_version_min 10.13"); +#endif + ldopts.emplace_back("-static"); + } } #endif @@ -397,7 +453,9 @@ static Options CreateOptions(bool add_defaults=true) { #ifdef ONLY_LD ldopts.emplace_back("-L"+eosio::cdt::whereami::where()+"/../lib"); +#ifndef __APPLE__ ldopts.emplace_back("-L"+eosio::cdt::whereami::where()+"/../lib64"); +#endif #endif #ifndef ONLY_LD if (!sysroot_opt.empty()) { @@ -408,7 +466,9 @@ static Options CreateOptions(bool add_defaults=true) { agopts.emplace_back("-I"+sysroot_opt+"/include/libcxx"); agopts.emplace_back("-I"+sysroot_opt+"/include/libc"); ldopts.emplace_back("-L"+sysroot_opt+"/lib"); +#ifndef __APPLE__ ldopts.emplace_back("-L"+sysroot_opt+"/lib64"); +#endif } else { copts.emplace_back("-I"+eosio::cdt::whereami::where()+"/../include/libcxx"); @@ -420,7 +480,9 @@ static Options CreateOptions(bool add_defaults=true) { agopts.emplace_back("-I"+eosio::cdt::whereami::where()+"/../include"); agopts.emplace_back("--sysroot="+eosio::cdt::whereami::where()+"/../"); ldopts.emplace_back("-L"+eosio::cdt::whereami::where()+"/../lib"); +#ifndef __APPLE__ ldopts.emplace_back("-L"+eosio::cdt::whereami::where()+"/../lib64"); +#endif } if (!isystem_opt.empty()) { @@ -460,6 +522,8 @@ static Options CreateOptions(bool add_defaults=true) { link = false; copts.emplace_back("-E"); } + if(g_opt) + copts.emplace_back("-g"); if (color_diag_opt) { copts.emplace_back("-fcolor-diagnostics"); } @@ -507,10 +571,10 @@ static Options CreateOptions(bool add_defaults=true) { copts.emplace_back("-I"+inc_dir); agopts.emplace_back("-I"+inc_dir); } - if (O_opt.empty()) { + if (O_opt.empty() && !g_opt) { copts.emplace_back("-O3"); } - else { + else if (!O_opt.empty() && !g_opt) { copts.emplace_back("-O"+O_opt); } if (S_opt) { @@ -528,32 +592,34 @@ static Options CreateOptions(bool add_defaults=true) { } #endif + if (!fnative_opt) { #ifdef ONLY_LD - if (!fno_stack_first_opt) { - ldopts.emplace_back("-stack-first"); - } - if (fno_lto_opt) { - ldopts.emplace_back("--lto-O0"); - if (!lto_opt_opt.empty()) - std::cerr << "Warning : lto disabled but lto optimization level given\n"; - } - else if (!lto_opt_opt.empty()) { - ldopts.emplace_back("--lto-"+lto_opt_opt); - } - else { - ldopts.emplace_back("--lto-O3"); - } + if (!fno_stack_first_opt) { + ldopts.emplace_back("-stack-first"); + } + if (fno_lto_opt) { + ldopts.emplace_back("--lto-O0"); + if (!lto_opt_opt.empty()) + std::cerr << "Warning : lto disabled but lto optimization level given\n"; + } + else if (!lto_opt_opt.empty()) { + ldopts.emplace_back("--lto-"+lto_opt_opt); + } + else { + ldopts.emplace_back("--lto-O3"); + } #else - if (fno_stack_first_opt) { - ldopts.emplace_back("-fno-stack-first"); - } - if (fno_lto_opt) { - ldopts.emplace_back("-fno-lto-opt"); - } - else if (!lto_opt_opt.empty()) { - ldopts.emplace_back("-lto-opt="+lto_opt_opt); - } + if (fno_stack_first_opt) { + ldopts.emplace_back("-fno-stack-first"); + } + if (fno_lto_opt) { + ldopts.emplace_back("-fno-lto-opt"); + } + else if (!lto_opt_opt.empty()) { + ldopts.emplace_back("-lto-opt="+lto_opt_opt); + } #endif + } for ( auto lib_dir : L_opt ) { ldopts.emplace_back("-L"+lib_dir); @@ -578,19 +644,21 @@ static Options CreateOptions(bool add_defaults=true) { ldopts.emplace_back("-o "+o_opt); output_fn = o_opt; } - + + if (!fnative_opt) { #ifndef ONLY_LD - if (!eosio_imports_opt.empty()) { - ldopts.emplace_back("-eosio-imports="+eosio_imports_opt); - } + if (!eosio_imports_opt.empty()) { + ldopts.emplace_back("-eosio-imports="+eosio_imports_opt); + } #else - if (!eosio_imports_opt.empty()) { - ldopts.emplace_back("--allow-undefined-file="+eosio_imports_opt); - } - else { - ldopts.emplace_back("--allow-undefined-file="+eosio::cdt::whereami::where()+"/../eosio.imports"); - } + if (!eosio_imports_opt.empty()) { + ldopts.emplace_back("--allow-undefined-file="+eosio_imports_opt); + } + else { + ldopts.emplace_back("--allow-undefined-file="+eosio::cdt::whereami::where()+"/../eosio.imports"); + } #endif + } #ifndef ONLY_LD #ifdef CPP_COMP @@ -628,9 +696,15 @@ static Options CreateOptions(bool add_defaults=true) { for ( auto resource : resources ) { agresources.emplace_back(std::string("-R")+resource); } - + if (fnative_opt) + ldopts.emplace_back("-fnative"); + if (fuse_main_opt) + ldopts.emplace_back("-fuse-main"); #else - ldopts.emplace_back("-lc++ -lc -leosio"); + if (fnative_opt) + ldopts.emplace_back("-lnative_c++ -lnative_c -lnative_eosio -lnative"); + else + ldopts.emplace_back("-lc++ -lc -leosio"); #endif - return {output_fn, abigen_inputs.str(), inputs, link, abigen, pp_dir, abigen_output, abigen_contract, copts, ldopts, agopts, agresources}; + return {output_fn, abigen_inputs.str(), inputs, link, abigen, pp_dir, abigen_output, abigen_contract, copts, ldopts, agopts, agresources, fnative_opt}; } diff --git a/tools/include/eosio/gen.hpp b/tools/include/eosio/gen.hpp index bb7cd63a2c..166d90a8ea 100644 --- a/tools/include/eosio/gen.hpp +++ b/tools/include/eosio/gen.hpp @@ -451,25 +451,25 @@ struct generation_utils { inline std::string translate_type( const clang::QualType& type ) { if ( is_template_specialization( type, {"ignore"} ) ) - return _translate_type(get_template_argument( type ).getAsType() ); + return translate_type(get_template_argument( type ).getAsType() ); else if ( is_template_specialization( type, {"binary_extension"} ) ) { - auto t = _translate_type(get_template_argument( type ).getAsType()); + auto t = translate_type(get_template_argument( type ).getAsType()); return t+"$"; } - else if ( is_template_specialization( type, {"vector", "set"} ) ) { - auto t =_translate_type(get_template_argument( type ).getAsType()); + else if ( is_template_specialization( type, {"vector", "set", "deque", "list"} ) ) { + auto t =translate_type(get_template_argument( type ).getAsType()); return t=="int8" ? "bytes" : t+"[]"; } else if ( is_template_specialization( type, {"optional"} ) ) - return _translate_type(get_template_argument( type ).getAsType())+"?"; + return translate_type(get_template_argument( type ).getAsType())+"?"; else if ( is_template_specialization( type, {"map"} )) { - auto t0 = _translate_type(get_template_argument( type ).getAsType()); - auto t1 = _translate_type(get_template_argument( type, 1).getAsType()); + auto t0 = translate_type(get_template_argument( type ).getAsType()); + auto t1 = translate_type(get_template_argument( type, 1).getAsType()); return replace_in_name("pair_" + t0 + "_" + t1 + "[]"); } else if ( is_template_specialization( type, {"pair"} )) { - auto t0 = _translate_type(get_template_argument( type ).getAsType()); - auto t1 = _translate_type(get_template_argument( type, 1).getAsType()); + auto t0 = translate_type(get_template_argument( type ).getAsType()); + auto t1 = translate_type(get_template_argument( type, 1).getAsType()); return replace_in_name("pair_" + t0 + "_" + t1); } else if ( is_template_specialization( type, {"tuple"} )) { @@ -499,7 +499,7 @@ struct generation_utils { } } else { - ret += _translate_type(get_template_argument( type, i ).getAsType()); + ret += translate_type(get_template_argument( type, i ).getAsType()); if ( i < tst->getNumArgs()-1 ) ret += "_"; } diff --git a/tools/include/eosio/utils.hpp b/tools/include/eosio/utils.hpp index 48a34a07cc..27924caf19 100644 --- a/tools/include/eosio/utils.hpp +++ b/tools/include/eosio/utils.hpp @@ -133,11 +133,14 @@ struct environment { } return env_table; } - static bool exec_subprogram(const std::string prog, std::vector options) { + static bool exec_subprogram(const std::string prog, std::vector options, bool root=false) { std::stringstream args; for (auto s : options) args << s << " "; - if ( auto path = llvm::sys::findProgramByName(prog.c_str(), {eosio::cdt::whereami::where()}) ) + std::string find_path = eosio::cdt::whereami::where(); + if (root) + find_path = "/usr/bin"; + if ( auto path = llvm::sys::findProgramByName(prog.c_str(), {find_path}) ) std::system((*path+" "+args.str()).c_str()); else return false; diff --git a/tools/init/CMakeLists.txt b/tools/init/CMakeLists.txt new file mode 100644 index 0000000000..722734af52 --- /dev/null +++ b/tools/init/CMakeLists.txt @@ -0,0 +1,3 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosio-init.cpp ${CMAKE_BINARY_DIR}/eosio-init.cpp @ONLY) + +add_tool(eosio-init) diff --git a/tools/init/eosio-init.cpp b/tools/init/eosio-init.cpp new file mode 100644 index 0000000000..a36a72b5d0 --- /dev/null +++ b/tools/init/eosio-init.cpp @@ -0,0 +1,234 @@ +// Declares clang::SyntaxOnlyAction. +#include "clang/Frontend/FrontendActions.h" +#include "clang/Tooling/CommonOptionsParser.h" +#include "clang/Tooling/Tooling.h" +#include "clang/ASTMatchers/ASTMatchers.h" +#include "clang/ASTMatchers/ASTMatchFinder.h" +#include "clang/AST/DeclCXX.h" +#include "clang/AST/DeclTemplate.h" +#include "clang/AST/Expr.h" +#include "clang/Basic/Builtins.h" +#include "llvm/Support/FileSystem.h" +#include "eosio/utils.hpp" +#include "eosio/gen.hpp" +#include "eosio/whereami/whereami.hpp" +#include "eosio/abi.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "llvm/Support/CommandLine.h" +using namespace clang::tooling; +using namespace clang::ast_matchers; +using namespace llvm; +using namespace eosio; +using namespace eosio::cdt; + +struct project { + std::string project_name; + std::string path; + bool bare; + + project( const std::string& pn, const std::string& p, bool b ) : project_name(pn), path(p), bare(b) { + llvm::sys::fs::create_directory(path); + if (!bare) { + llvm::sys::fs::create_directory(path+"/src"); + llvm::sys::fs::create_directory(path+"/include"); + llvm::sys::fs::create_directory(path+"/ricardian"); + llvm::sys::fs::create_directory(path+"/build"); + } + } + + std::string cdt_root = "/usr/local"; + const std::string cpp = "#include <@.hpp>\n" + "ACTION @::hi( name nm ) {\n" + " /* fill in action body */\n" + " print_f(\"Name : %\\n\",nm);\n" + "}\n\n" + "EOSIO_DISPATCH( @, (hi) )"; + + const std::string hpp = "#include \n" + "using namespace eosio;\n\n" + "CONTRACT @ : public contract {\n" + " public:\n" + " using contract::contract;\n\n" + " ACTION hi( name nm );\n\n" + " using hi_action = action_wrapper<\"hi\"_n, &@::hi>;\n" + "};"; + + const std::string ricardian = "

hi

\n\n" + "Stub for hi action's ricardian contract"; + + const std::string cmake = "project(@)\n\n" + "set(EOSIO_WASM_OLD_BEHAVIOR \"Off\")\n" + "find_package(eosio.cdt)\n\n" + "add_contract( @ @ @.cpp )\n" + "target_include_directories( @ PUBLIC ${CMAKE_SOURCE_DIR}/../include )\n" + "target_ricardian_directory( @ ${CMAKE_SOURCE_DIR}/../ricardian )"; + + const std::string cmake_extern = "include(ExternalProject)\n" + "# if no cdt root is given use default path\n" + "if(EOSIO_CDT_ROOT STREQUAL \"\" OR NOT EOSIO_CDT_ROOT)\n" + " find_package(eosio.cdt)\n" + "endif()\n\n" + "ExternalProject_Add(\n" + " @_project\n" + " SOURCE_DIR ${CMAKE_SOURCE_DIR}/src\n" + " BINARY_DIR ${CMAKE_BINARY_DIR}/@\n" + " CMAKE_ARGS -DCMAKE_TOOLCHAIN_FILE=${EOSIO_CDT_ROOT}/lib/cmake/eosio.cdt/EosioWasmToolchain.cmake\n" + " UPDATE_COMMAND \"\"\n" + " PATCH_COMMAND \"\"\n" + " TEST_COMMAND \"\"\n" + " INSTALL_COMMAND \"\"\n" + " BUILD_ALWAYS 1\n" + ")"; + + const std::string readme_cmake = "--- @ Project ---\n\n" + " - How to Build -\n" + " - cd to 'build' directory\n" + " - run the command 'cmake ..'\n" + " - run the command 'make'\n\n" + " - After build -\n" + " - The built smart contract is under the '@' directory in the 'build' directory\n" + " - You can then do a 'set contract' action with 'cleos' and point in to the './build/@' directory\n\n" + " - Additions to CMake should be done to the CMakeLists.txt in the './src' directory and not in the top level CMakeLists.txt"; + + const std::string readme_bare = " --- @ Project ---\n\n" + " - How to Build -\n" + " - run the command 'eosio-cpp -abigen -o @.wasm @.cpp'\n"; + + std::string replace_name( const std::string& in ) { + std::stringstream ss; + for ( char c : in ) { + if (c == '@') + ss << project_name; + else + ss << c; + } + return ss.str(); + } + + std::string replace_cdt_root( const std::string& in ) { + std::stringstream ss; + for ( char c : in ) { + if (c == '%') + ss << cdt_root; + else + ss << c; + } + return ss.str(); + } + std::string replace_include_type( const std::string& in ) { + std::stringstream ss; + for ( char c : in ) { + if ((c == '<' || c == '>') && bare) + ss << '"'; + else + ss << c; + } + return ss.str(); + } + + void write_cpp() { + std::ofstream cpp_out; + if (bare) + cpp_out.open(path+"/"+project_name+".cpp"); + else + cpp_out.open(path+"/src/"+project_name+".cpp"); + cpp_out << replace_include_type(replace_name(cpp)); + } + void write_hpp() { + std::ofstream hpp_out; + if (bare) + hpp_out.open(path+"/"+project_name+".hpp"); + else + hpp_out.open(path+"/include/"+project_name+".hpp"); + hpp_out << replace_name(hpp); + } + void write_cmake() { + if (!bare) { + std::ofstream cmake_out(path+"/src/CMakeLists.txt"); + cmake_out << replace_name(replace_cdt_root(cmake)); + } + } + void write_cmake_extern() { + if (!bare) { + std::ofstream cmake_out(path+"/CMakeLists.txt"); + cmake_out << replace_name(replace_cdt_root(cmake_extern)); + } + } + void write_ricardian() { + std::ofstream rc_out; + if (bare) + rc_out.open(path+"/"+project_name+".contracts.md"); + else + rc_out.open(path+"/ricardian/"+project_name+".contracts.md"); + rc_out << ricardian; + } + void write_readme() { + std::ofstream readme_out(path+"/README.txt"); + if (bare) { + readme_out << replace_name(readme_bare); + } else { + readme_out << replace_name(readme_cmake); + } + } + +}; + +int main(int argc, const char **argv) { + + cl::SetVersionPrinter([](llvm::raw_ostream& os) { + os << "eosio-init version " << "@VERSION_FULL@" << "\n"; + }); + cl::OptionCategory cat("eosio-init", "generates an eosio smart contract project"); + + cl::opt bare_opt( + "bare", + cl::desc("produces only a skeleton smart contract without CMake support"), + cl::cat(cat)); + cl::opt project_name( + "project", + cl::desc("output project name"), + cl::Required, + cl::cat(cat)); + cl::opt output_dir( + "path", + cl::desc("directory to place the project"), + cl::cat(cat)); + + cl::ParseCommandLineOptions(argc, argv, std::string("eosio-proj")); + try { + llvm::SmallString<128> rp; + std::string path = output_dir; + if (path.empty()) + path = "."; + llvm::sys::fs::real_path(path, rp, false); + path = rp.str(); + if (path.empty()) { + llvm::outs() << output_dir+" path not found\n"; + return -1; + } + path += "/"+project_name; + + project proj(project_name, path, bare_opt); + proj.write_hpp(); + proj.write_cpp(); + proj.write_cmake(); + proj.write_cmake_extern(); + proj.write_ricardian(); + proj.write_readme(); + } catch ( std::exception& e ) { + std::cout << e.what() << "\n"; + return -1; + } + + return 0; +} diff --git a/tools/ld/CMakeLists.txt b/tools/ld/CMakeLists.txt index b08303b7a9..e2c41b4b3a 100644 --- a/tools/ld/CMakeLists.txt +++ b/tools/ld/CMakeLists.txt @@ -1 +1,3 @@ +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/eosio-ld.cpp.in ${CMAKE_BINARY_DIR}/eosio-ld.cpp) + add_tool(eosio-ld) diff --git a/tools/ld/eosio-ld.cpp.in b/tools/ld/eosio-ld.cpp.in index 4342d16990..290be5981c 100644 --- a/tools/ld/eosio-ld.cpp.in +++ b/tools/ld/eosio-ld.cpp.in @@ -16,21 +16,29 @@ using namespace llvm; int main(int argc, const char **argv) { cl::SetVersionPrinter([](llvm::raw_ostream& os) { - os << "eosio-ld version " << ${VERSION_MAJOR} << "." << ${VERSION_MINOR} << "." << ${VERSION_PATCH} << "\n"; + os << "eosio-ld version " << "${VERSION_FULL}" << "\n"; }); cl::ParseCommandLineOptions(argc, argv, "eosio-ld (WebAssembly linker)"); Options opts = CreateOptions(); std::string line; - if (!eosio::cdt::environment::exec_subprogram("wasm-ld", opts.ld_options)) - return -1; - + if (opts.native) { +#ifdef __APPLE__ + if (!eosio::cdt::environment::exec_subprogram("ld", opts.ld_options, true)) +#else + if (!eosio::cdt::environment::exec_subprogram("ld.lld", opts.ld_options)) +#endif + return -1; + } else { + if (!eosio::cdt::environment::exec_subprogram("wasm-ld", opts.ld_options)) + return -1; + } if ( !llvm::sys::fs::exists( opts.output_fn ) ) { return -1; } // finally any post processing - if (!fno_post_pass_opt) { + if (!fno_post_pass_opt && !opts.native) { if ( !llvm::sys::fs::exists( opts.eosio_pp_dir+"/eosio-pp" ) ) { std::cout << "Error: eosio.pp not found! (Try reinstalling eosio.wasmsdk)" << std::endl; return -1; From 33d36572215af4e437e6187a7c9233e20fad7bdc Mon Sep 17 00:00:00 2001 From: thaipanda <45444502+Thaipanda@users.noreply.github.com> Date: Thu, 28 Feb 2019 19:30:50 +0800 Subject: [PATCH 4/7] correct version v2.0.2 (#16) --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index ac30f61887..0fd906abea 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # BOSCore.CDT (Contract Development Toolkit) -## BOSCore.CDT Version: v2.0.1 + +## BOSCore.CDT Version: v2.0.2 ## Basic EOSIO.CDT Version: 1.5.0 ## Use BOSCore CDT docker image to build smart conrtacts From 317537b263be058fb92d9a7f83f9b452eec1df96 Mon Sep 17 00:00:00 2001 From: oldcold Date: Mon, 6 May 2019 18:27:11 +0800 Subject: [PATCH 5/7] add upgrade related interface. (#25) * merge v2.0.1 (#3) * prepare new version * adjust the Dockerfile * fix error: expected namespace name * merge v2.0.2 into master (#13) * merget EOSIO.CDT 1.5.0 * add boscore/cdt Docker image * correct version v2.0.2 (#15) correct version v2.0.2 * upgraded version of cdt used for dpos-pbft (bos) * add native modifications. --- imports/eosio.imports.in | 1 + libraries/eosiolib/eosiolib.cpp | 7 +++++++ libraries/eosiolib/privileged.h | 2 ++ libraries/eosiolib/privileged.hpp | 10 ++++++++++ libraries/native/intrinsics.cpp | 3 +++ libraries/native/intrinsics_def.hpp | 1 + 6 files changed, 24 insertions(+) diff --git a/imports/eosio.imports.in b/imports/eosio.imports.in index 2947e511af..21c209a3ce 100644 --- a/imports/eosio.imports.in +++ b/imports/eosio.imports.in @@ -50,6 +50,7 @@ get_blockchain_parameters_packed set_blockchain_parameters_packed set_name_list_packed set_guaranteed_minimum_resources +set_upgrade_parameters_packed is_privileged set_privileged get_active_producers diff --git a/libraries/eosiolib/eosiolib.cpp b/libraries/eosiolib/eosiolib.cpp index 0b8e74fd0b..88bb46aaba 100644 --- a/libraries/eosiolib/eosiolib.cpp +++ b/libraries/eosiolib/eosiolib.cpp @@ -62,6 +62,13 @@ namespace eosio { ds >> params; } + void set_upgrade_parameters(const eosio::upgrade_parameters& params) { + char buf[sizeof(eosio::upgrade_parameters)]; + eosio::datastream ds( buf, sizeof(buf) ); + ds << params; + set_upgrade_parameters_packed( buf, ds.tellp() ); + } + using ::memset; using ::memcpy; diff --git a/libraries/eosiolib/privileged.h b/libraries/eosiolib/privileged.h index 99be139761..1e26799ae2 100644 --- a/libraries/eosiolib/privileged.h +++ b/libraries/eosiolib/privileged.h @@ -97,6 +97,8 @@ extern "C" { */ void set_name_list_packed(int64_t list, int64_t action, char* data, uint32_t datalen); + void set_upgrade_parameters_packed( char* data, uint32_t datalen ); + /** * @brief Set the guaranteed minimum resources object * Set the guaranteed minimum resources object diff --git a/libraries/eosiolib/privileged.hpp b/libraries/eosiolib/privileged.hpp index 4eb8bb97d7..e41b913b9e 100644 --- a/libraries/eosiolib/privileged.hpp +++ b/libraries/eosiolib/privileged.hpp @@ -133,6 +133,14 @@ namespace eosio { ) }; + struct upgrade_parameters { + uint32_t target_block_num; + + EOSLIB_SERIALIZE(upgrade_parameters, + (target_block_num) + ) + }; + /** * @brief Set the blockchain parameters * Set the blockchain parameters @@ -147,6 +155,8 @@ namespace eosio { */ void get_blockchain_parameters(eosio::blockchain_parameters& params); + void set_upgrade_parameters(const eosio::upgrade_parameters& params); + ///@} /** diff --git a/libraries/native/intrinsics.cpp b/libraries/native/intrinsics.cpp index 18b11e45c6..ab1ed99c2a 100644 --- a/libraries/native/intrinsics.cpp +++ b/libraries/native/intrinsics.cpp @@ -31,6 +31,9 @@ extern "C" { void set_blockchain_parameters_packed( char* data, uint32_t datalen ) { return intrinsics::get().call(data, datalen); } + void set_upgrade_parameters_packed( char* data, uint32_t datalen ) { + return intrinsics::get().call(data, datalen); + } bool is_privileged( capi_name account ) { return intrinsics::get().call(account); } diff --git a/libraries/native/intrinsics_def.hpp b/libraries/native/intrinsics_def.hpp index 73d406ab4d..946f6bd597 100644 --- a/libraries/native/intrinsics_def.hpp +++ b/libraries/native/intrinsics_def.hpp @@ -45,6 +45,7 @@ intrinsic_macro(set_resource_limits) \ intrinsic_macro(set_proposed_producers) \ intrinsic_macro(get_blockchain_parameters_packed) \ intrinsic_macro(set_blockchain_parameters_packed) \ +intrinsic_macro(set_upgrade_parameters_packed) \ intrinsic_macro(is_privileged) \ intrinsic_macro(set_privileged) \ intrinsic_macro(get_active_producers) \ From 0469c69cbd202d23b72bc5a2193683e2c95ba55e Mon Sep 17 00:00:00 2001 From: thaipandada Date: Mon, 6 May 2019 23:22:33 +0800 Subject: [PATCH 6/7] prepare for v3.0.x --- CMakeLists.txt | 4 ++-- README.md | 54 +---------------------------------------------- docker/Dockerfile | 3 ++- 3 files changed, 5 insertions(+), 56 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2371806e4..ecfba75c01 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,9 +16,9 @@ else() endif() -set(VERSION_MAJOR 2) +set(VERSION_MAJOR 3) set(VERSION_MINOR 0) -set(VERSION_PATCH 2) +set(VERSION_PATCH 0) #set(VERSION_SUFFIX ) if (VERSION_SUFFIX) diff --git a/README.md b/README.md index 0fd906abea..6d2111f9fd 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # BOSCore.CDT (Contract Development Toolkit) -## BOSCore.CDT Version: v2.0.2 +## BOSCore.CDT Version: v3.0.0 ## Basic EOSIO.CDT Version: 1.5.0 ## Use BOSCore CDT docker image to build smart conrtacts @@ -8,58 +8,6 @@ **In order to speed up the progress of contracts development, BOSCore supply complied docker image.** **By CDT docker image, you can start build you contracts without build BOSCore.CDT firstly. Please check [README](docker/README.md).** - -EOSIO.CDT is a toolchain for WebAssembly (WASM) and set of tools to facilitate contract writing for the EOSIO platform. In addition to being a general purpose WebAssembly toolchain, [EOSIO](https://github.com/eosio/eos) specific optimizations are available to support building EOSIO smart contracts. This new toolchain is built around [Clang 7](https://github.com/eosio/llvm), which means that EOSIO.CDT has the most currently available optimizations and analyses from LLVM, but as the WASM target is still considered experimental, some optimizations are not available or incomplete. - -## Important! -EOSIO.CDT Version 1.3.x introduced quite a few breaking changes. To have binary releases we needed to remove the concept of a core symbol from EOSIO.CDT. This meant drastic changes to symbol, asset and other types/functions that were connected to them. Since these changes would be disruptive, we decided to add as many disruptive changes needed for future contract writing, so that disruption should only occur once. Please read the **_Differences between Version 1.2.x and Version 1.3.x_** section of this readme. - -### Binary Releases -EOSIO.CDT currently supports Mac OS X brew, Linux x86_64 Debian packages, and Linux x86_64 RPM packages. - -**If you have previously installed EOSIO.CDT, please run the `uninstall` script (it is in the directory where you cloned EOSIO.CDT) before downloading and using the binary releases.** - -#### Mac OS X Brew Install -```sh -$ brew tap eosio/eosio.cdt -$ brew install eosio.cdt -``` -#### Mac OS X Brew Uninstall -```sh -$ brew remove eosio.cdt -``` -#### Debian Package Install -```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1_amd64.deb -$ sudo apt install ./eosio.cdt-1.5.0-1_amd64.deb -``` -#### Debian Package Uninstall -```sh -$ sudo apt remove eosio.cdt -``` - -#### Fedora RPM Package Install -```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1.fc27.x86_64.rpm -$ sudo yum install ./eosio.cdt-1.5.0-1.fc27.x86_64.rpm -``` - -#### Fedora RPM Package Uninstall -```sh -$ sudo yum remove eosio.cdt -``` - -#### Centos RPM Package Install -```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.5.0/eosio.cdt-1.5.0-1.el7.x86_64.rpm -$ sudo yum install ./eosio.cdt-1.5.0-1.el7.x86_64.rpm -``` - -#### Centos RPM Package Uninstall -```sh -$ sudo yum remove eosio.cdt -``` - ### Guided Installation (Building from Scratch) ```sh $ git clone --recursive https://github.com/boscore/bos.cdt diff --git a/docker/Dockerfile b/docker/Dockerfile index ff356bd992..acf3fd5df6 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,12 +1,13 @@ FROM boscore/builder as builder ARG branch=master +ARG bosbranch=master ENV OPENSSL_ROOT_DIR /usr/include/openssl RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl ca-certificates curl wget git cmake python3 g++ vim net-tools lsof wget curl supervisor -RUN cd / && git clone --depth 1 -b master https://github.com/boscore/bos.git --recursive \ +RUN cd / && git clone --depth 1 -b $bosbranch https://github.com/boscore/bos.git --recursive \ && cd /bos \ && ./eosio_build.sh -s BOS \ && ./eosio_install.sh \ From dbdeef9695ac88da9d6989170fe91cfc9ca75ed0 Mon Sep 17 00:00:00 2001 From: thaipandada Date: Tue, 7 May 2019 14:05:56 +0800 Subject: [PATCH 7/7] update Docker build guide --- docker/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/README.md b/docker/README.md index ec4ed9d2b5..ebe84355cf 100644 --- a/docker/README.md +++ b/docker/README.md @@ -12,7 +12,7 @@ ## DIY: How to build self BOSCore CDT Docker image - modify the [Dockerfile](./Dockerfile) and add yourself commands -- call `docker build -t XXXX/boscdt:vx.x.x --build-arg branch=release/v2.0.x --build-arg symbol=BOS --no-cache .` +- call `docker build -t XXXX/boscdt:vx.x.x --build-arg branch=vx.x.x --build-arg symbol=BOS --no-cache .` - maybe you should push your docker image by call `docker push XXXX/boscdt:vx.x.x` - change [docker-compose.yml](./docker-compose.yml) `image` into `XXXX/boscdt:vx.x.x` - follow `Usage: How to use BOSCore CDT Docker image to build contracts` to use yourself docker image \ No newline at end of file