diff --git a/CMakeLists.txt b/CMakeLists.txt index 85d1a62613..5346831d17 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ endif() set(VERSION_MAJOR 1) set(VERSION_MINOR 6) -set(VERSION_PATCH 0) +set(VERSION_PATCH 1) #set(VERSION_SUFFIX rc2) if (VERSION_SUFFIX) diff --git a/README.md b/README.md index cd83ee8e78..c0cd29d277 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # EOSIO.CDT (Contract Development Toolkit) -## Version : 1.6.0 +## Version : 1.6.1 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. @@ -22,8 +22,8 @@ $ brew remove eosio.cdt ``` #### Debian Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.0/eosio.cdt_1.6.0-1_amd64.deb -$ sudo apt install ./eosio.cdt_1.6.0-1_amd64.deb +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.1/eosio.cdt_1.6.1-1_amd64.deb +$ sudo apt install ./eosio.cdt_1.6.1-1_amd64.deb ``` #### Debian Package Uninstall ```sh @@ -32,8 +32,8 @@ $ sudo apt remove eosio.cdt #### Fedora RPM Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.0/eosio.cdt-1.6.0-1.fedora-x86_64.rpm -$ sudo yum install ./eosio.cdt-1.6.0-1.fedora-x86_64.rpm +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.1/eosio.cdt-1.6.1-1.fedora-x86_64.rpm +$ sudo yum install ./eosio.cdt-1.6.1-1.fedora-x86_64.rpm ``` #### Fedora RPM Package Uninstall @@ -43,8 +43,8 @@ $ sudo yum remove eosio.cdt #### Centos RPM Package Install ```sh -$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.0/eosio.cdt-1.6.0-1.centos-x86_64.rpm -$ sudo yum install ./eosio.cdt-1.6.0-1.centos-x86_64.rpm +$ wget https://github.com/eosio/eosio.cdt/releases/download/v1.6.1/eosio.cdt-1.6.1-1.centos-x86_64.rpm +$ sudo yum install ./eosio.cdt-1.6.1-1.centos-x86_64.rpm ``` #### Centos RPM Package Uninstall diff --git a/eosio_llvm b/eosio_llvm index 9a9ff09d43..a41b8e7653 160000 --- a/eosio_llvm +++ b/eosio_llvm @@ -1 +1 @@ -Subproject commit 9a9ff09d4302331d3289fdf58a64213506b4aefb +Subproject commit a41b8e7653258a4f1a5911ef28c95672efce051e diff --git a/tools/include/compiler_options.hpp.in b/tools/include/compiler_options.hpp.in index a3e15d9143..c26558f8a6 100644 --- a/tools/include/compiler_options.hpp.in +++ b/tools/include/compiler_options.hpp.in @@ -356,6 +356,8 @@ static void GetCompDefaults(std::vector& copts) { if (!fnative_opt) { copts.emplace_back("--target=wasm32"); copts.emplace_back("-ffreestanding"); + copts.emplace_back("-nostdlib"); + copts.emplace_back("-fno-builtin"); } else { copts.emplace_back("-Wunused-command-line-argument"); #ifdef __APPLE__ @@ -377,8 +379,8 @@ static void GetCompDefaults(std::vector& copts) { 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("-fno-rtti"); copts.emplace_back("-fmodules-ts"); #endif copts.emplace_back("-DBOOST_DISABLE_ASSERTS"); diff --git a/tools/include/eosio/codegen.hpp b/tools/include/eosio/codegen.hpp index 2ffefe8925..28388eecd0 100644 --- a/tools/include/eosio/codegen.hpp +++ b/tools/include/eosio/codegen.hpp @@ -149,8 +149,12 @@ namespace eosio { namespace cdt { StringRef main_name; Rewriter rewriter; CompilerInstance* ci; + bool apply_was_found = false; public: + std::vector action_decls; + std::vector notify_decls; + explicit eosio_codegen_visitor(CompilerInstance *CI) : generation_utils([&](){throw cg.codegen_ex;}), ci(CI) { cg.ast_context = &(CI->getASTContext()); @@ -351,6 +355,15 @@ namespace eosio { namespace cdt { //cg.cxx_methods.emplace(name, decl); return true; } + + virtual bool VisitDecl(clang::Decl* decl) { + if (auto* fd = dyn_cast(decl)) { + if (fd->getNameInfo().getAsString() == "apply") + apply_was_found = true; + } + return true; + } + /* virtual bool VisitRecordDecl(RecordDecl* decl) { static std::set _action_set; //used for validations @@ -401,6 +414,12 @@ namespace eosio { namespace cdt { visitor->set_main_fid(fid); visitor->set_main_name(main_fe->getName()); visitor->TraverseDecl(Context.getTranslationUnitDecl()); + for (auto ad : visitor->action_decls) + visitor->create_action_dispatch(ad); + + for (auto nd : visitor->notify_decls) + visitor->create_notify_dispatch(nd); + int fd; llvm::SmallString<128> fn; try {