diff --git a/CMakeLists.txt b/CMakeLists.txt index cd49cac7cf..23cbcb2ded 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ project(cdt) set(VERSION_MAJOR 4) set(VERSION_MINOR 2) set(VERSION_PATCH 0) -set(VERSION_SUFFIX "dev") +set(VERSION_SUFFIX "dev") if (VERSION_SUFFIX) set(VERSION_FULL "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${VERSION_SUFFIX}") diff --git a/docs/03_command-reference/cdt-cc.md b/docs/03_command-reference/cdt-cc.md index 913e940067..49bcbfe22e 100644 --- a/docs/03_command-reference/cdt-cc.md +++ b/docs/03_command-reference/cdt-cc.md @@ -47,7 +47,7 @@ compiler options: -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 + -fcfl-aa - Enable CFL Alias Analysis -fno-elide-constructors - Disable C++ copy constructor elision -fno-lto - Disable LTO -fno-post-pass - Don't run post processing pass diff --git a/docs/03_command-reference/cdt-cpp.md b/docs/03_command-reference/cdt-cpp.md index 382f4f4857..3942513cd1 100644 --- a/docs/03_command-reference/cdt-cpp.md +++ b/docs/03_command-reference/cdt-cpp.md @@ -49,7 +49,7 @@ compiler options: -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 + -cfl-aa - Enable CFL Alias Analysis -fno-elide-constructors - Disable C++ copy constructor elision -fno-lto - Disable LTO -fno-post-pass - Don't run post processing pass diff --git a/docs/03_command-reference/cdt-ld.md b/docs/03_command-reference/cdt-ld.md index f4339e91d2..8e3b2daa98 100644 --- a/docs/03_command-reference/cdt-ld.md +++ b/docs/03_command-reference/cdt-ld.md @@ -21,7 +21,7 @@ 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 + -fcfl-aa - Enable 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 diff --git a/docs/man/cdt-cc.1.md b/docs/man/cdt-cc.1.md index 96d4b21563..e9c670a906 100644 --- a/docs/man/cdt-cc.1.md +++ b/docs/man/cdt-cc.1.md @@ -167,9 +167,9 @@ execution in Antelope block chain virtual machines. Compile and link for x86-64 -**`--fno-cfl-aa`** +**`--fcfl-aa`** - Disable CFL Alias Analysis + Enable CFL Alias Analysis **`--fno-elide-constructors`** diff --git a/docs/man/cdt-cpp.1.md b/docs/man/cdt-cpp.1.md index 95587afd0a..8a2a07f396 100644 --- a/docs/man/cdt-cpp.1.md +++ b/docs/man/cdt-cpp.1.md @@ -187,9 +187,9 @@ execution in Antelope block chain virtual machines. Compile and link for x86-64 -**`--fno-cfl-aa`** +**`--fcfl-aa`** - Disable CFL Alias Analysis + Enable CFL Alias Analysis **`--fno-elide-constructors`** diff --git a/docs/man/cdt-ld.1.md b/docs/man/cdt-ld.1.md index 7063e871bc..ad5ec25ca9 100644 --- a/docs/man/cdt-ld.1.md +++ b/docs/man/cdt-ld.1.md @@ -39,9 +39,9 @@ execution in Antelope block chain virtual machines. Compile and link for x86-64 -**`--fno-cfl-aa`** +**`--fcfl-aa`** - Disable CFL Alias Analysis + Enable CFL Alias Analysis **`--fno-lto`** diff --git a/libraries/eosiolib/capi/eosio/security_group.h b/libraries/eosiolib/capi/eosio/security_group.h deleted file mode 100644 index 9e362c63e6..0000000000 --- a/libraries/eosiolib/capi/eosio/security_group.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once -#include "types.h" -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Propose new participants to the security group. - * - * @param data - the buffer containing the packed participants. - * @param datalen - size of the packed participants - * @pre `data` is a valid pointer to a range of memory at least `datalen` bytes long that contains packed participants data - * - * @return -1 if proposing a new security group was unsuccessful, otherwise returns 0. -*/ -__attribute__((eosio_wasm_import)) -int64_t add_security_group_participants(const char* data, uint32_t datalen); - -/** - * Propose to remove participants from the security group. - * - * @param data - the buffer containing the packed participants. - * @param datalen - size of the packed participants - * @pre `data` is a valid pointer to a range of memory at least `datalen` bytes long that contains packed participants data - * - * @return -1 if proposing a new security group was unsuccessful, otherwise returns 0. -*/ -__attribute__((eosio_wasm_import)) -int64_t remove_security_group_participants(const char* data, uint32_t datalen); - -/** - * Check if the specified accounts are all in the active security group. - * - * @param data - the buffer containing the packed participants. - * @param datalen - size of the packed participants - * - * @return Returns true if the specified accounts are all in the active security group. -*/ -__attribute__((eosio_wasm_import)) -bool in_active_security_group(const char* data, uint32_t datalen); - -/** - * Gets the active security group - * - * @param[out] data - the output buffer containing the packed security group. - * @param datalen - size of the `data` buffer - * - * @return Returns the size required in the buffer (if the buffer is too small, nothing is written). - * -*/ -__attribute__((eosio_wasm_import)) -uint32_t get_active_security_group(char* data, uint32_t datalen); - -#ifdef __cplusplus -} -#endif diff --git a/libraries/eosiolib/contracts/eosio/security_group.hpp b/libraries/eosiolib/contracts/eosio/security_group.hpp deleted file mode 100644 index b5575b8835..0000000000 --- a/libraries/eosiolib/contracts/eosio/security_group.hpp +++ /dev/null @@ -1,86 +0,0 @@ -#pragma once -#include -#include "../../core/eosio/name.hpp" -#include "../../core/eosio/serialize.hpp" - -namespace eosio { - -namespace internal_use_do_not_use { -extern "C" { -__attribute__((eosio_wasm_import)) int64_t add_security_group_participants(const char* data, uint32_t datalen); - -__attribute__((eosio_wasm_import)) int64_t remove_security_group_participants(const char* data, uint32_t datalen); - -__attribute__((eosio_wasm_import)) bool in_active_security_group(const char* data, uint32_t datalen); - -__attribute__((eosio_wasm_import)) uint32_t get_active_security_group(char* data, uint32_t datalen); -} -} // namespace internal_use_do_not_use - -/** - * @defgroup security_group Security Group - * @ingroup contracts - * @brief Defines C++ security group API - */ - -struct security_group { - uint32_t version; - std::set participants; - CDT_REFLECT(version, participants); -}; - -/** - * Propose new participants to the security group. - * - * @ingroup security_group - * @param participants - the participants. - * - * @return -1 if proposing a new security group was unsuccessful, otherwise returns 0. - */ -inline int64_t add_security_group_participants(const std::set& participants) { - auto packed_participants = eosio::pack( participants ); - return internal_use_do_not_use::add_security_group_participants( packed_participants.data(), packed_participants.size() ); -} - -/** - * Propose to remove participants from the security group. - *å - * @ingroup security_group - * @param participants - the participants. - *å - * @return -1 if proposing a new security group was unsuccessful, otherwise returns 0. - */ -inline int64_t remove_security_group_participants(const std::set& participants){ - auto packed_participants = eosio::pack( participants ); - return internal_use_do_not_use::remove_security_group_participants( packed_participants.data(), packed_participants.size() ); -} - -/** - * Check if the specified accounts are all in the active security group. - * - * @ingroup security_group - * @param participants - the participants. - * - * @return Returns true if the specified accounts are all in the active security group. - */ -inline bool in_active_security_group(const std::set& participants){ - auto packed_participants = eosio::pack( participants ); - return internal_use_do_not_use::in_active_security_group( packed_participants.data(), packed_participants.size() ); -} - -/** - * Gets the active security group - * - * @ingroup security_group - * @param[out] packed_security_group - the buffer containing the packed security_group. - * - * @return Returns the size required in the buffer (if the buffer is too small, nothing is written). - * - */ -inline security_group get_active_security_group() { - size_t buffer_size = internal_use_do_not_use::get_active_security_group(0, 0); - std::vector buffer(buffer_size); - internal_use_do_not_use::get_active_security_group(buffer.data(), buffer_size); - return eosio::unpack(buffer); -} -} // namespace eosio \ No newline at end of file diff --git a/libraries/eosiolib/contracts/eosio/singleton.hpp b/libraries/eosiolib/contracts/eosio/singleton.hpp index 17f70aa08c..a9625b43ef 100644 --- a/libraries/eosiolib/contracts/eosio/singleton.hpp +++ b/libraries/eosiolib/contracts/eosio/singleton.hpp @@ -62,7 +62,7 @@ namespace eosio { * @return true - if exists * @return false - otherwise */ - bool exists() { + bool exists() const { return _t.find( pk_value ) != _t.end(); } @@ -72,7 +72,7 @@ namespace eosio { * @brief Get the value stored inside the singleton table * @return T - The value stored */ - T get() { + T get() const { auto itr = _t.find( pk_value ); eosio::check( itr != _t.end(), "singleton does not exist" ); return itr->value; @@ -84,7 +84,7 @@ namespace eosio { * @param def - The default value to be returned in case the data doesn't exist * @return T - The value stored */ - T get_or_default( const T& def = T() ) { + T get_or_default( const T& def = T() ) const { auto itr = _t.find( pk_value ); return itr != _t.end() ? itr->value : def; } diff --git a/libraries/native/intrinsics.cpp b/libraries/native/intrinsics.cpp index 3f9ed470ea..c28f7c574f 100644 --- a/libraries/native/intrinsics.cpp +++ b/libraries/native/intrinsics.cpp @@ -890,22 +890,6 @@ extern "C" { } #pragma clang diagnostic pop - int64_t add_security_group_participants(const char* data, uint32_t datalen) { - return intrinsics::get().call(data, datalen); - } - - int64_t remove_security_group_participants(const char* data, uint32_t datalen){ - return intrinsics::get().call(data, datalen); - } - - bool in_active_security_group(const char* data, uint32_t datalen){ - return intrinsics::get().call(data, datalen); - } - - uint32_t get_active_security_group(char* data, uint32_t datalen){ - return intrinsics::get().call(data, datalen); - } - void set_finalizers(uint64_t packed_finalizer_format, const char* data, uint32_t len) { intrinsics::get().call(packed_finalizer_format, data, len); } diff --git a/libraries/native/native/eosio/intrinsics_def.hpp b/libraries/native/native/eosio/intrinsics_def.hpp index 5121017dda..27b0aa3300 100644 --- a/libraries/native/native/eosio/intrinsics_def.hpp +++ b/libraries/native/native/eosio/intrinsics_def.hpp @@ -13,7 +13,6 @@ #include #include #include -#include #include #include @@ -164,10 +163,6 @@ intrinsic_macro(cancel_deferred) \ intrinsic_macro(get_context_free_data) \ intrinsic_macro(get_sender) \ intrinsic_macro(set_action_return_value) \ -intrinsic_macro(add_security_group_participants) \ -intrinsic_macro(remove_security_group_participants) \ -intrinsic_macro(in_active_security_group) \ -intrinsic_macro(get_active_security_group) \ intrinsic_macro(blake2_f) \ intrinsic_macro(sha3) \ intrinsic_macro(k1_recover) \ diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 4407c51898..450c3ed4d0 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -5,7 +5,6 @@ include( CDTMacros ) macro(add_cdt_unit_test TEST_NAME) add_native_executable(${TEST_NAME} ${TEST_NAME}.cpp) - target_compile_options(${TEST_NAME} PRIVATE -fno-cfl-aa) if(CMAKE_BUILD_TYPE STREQUAL "Release") target_compile_options(${TEST_NAME} PRIVATE -O2) elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") diff --git a/tools/include/compiler_options.hpp.in b/tools/include/compiler_options.hpp.in index 0547701ce1..fa6772c93c 100644 --- a/tools/include/compiler_options.hpp.in +++ b/tools/include/compiler_options.hpp.in @@ -80,9 +80,9 @@ static cl::opt fno_lto_opt( "fno-lto", cl::desc("Disable LTO"), cl::cat(LD_CAT)); -static cl::opt fno_cfl_aa_opt( - "fno-cfl-aa", - cl::desc("Disable CFL Alias Analysis"), +static cl::opt fcfl_aa_opt( + "fcfl-aa", + cl::desc("Enable CFL Alias Analysis"), cl::cat(LD_CAT)); static cl::opt fno_stack_first_opt( "fno-stack-first", @@ -617,7 +617,7 @@ static Options CreateOptions(bool add_defaults=true) { else pp_dir = eosio::cdt::whereami::where(); - if (!fno_cfl_aa_opt) { + if (fcfl_aa_opt) { copts.emplace_back("-mllvm"); copts.emplace_back("-use-cfl-aa-in-codegen=both"); agopts.emplace_back("-mllvm");