From 12aa9e54cb2e8363372393f49420873a79127a58 Mon Sep 17 00:00:00 2001 From: Alex Beregszaszi Date: Mon, 27 Jun 2022 00:51:14 +0200 Subject: [PATCH] Rename to solstdlib --- CMakeLists.txt | 2 +- libsolidity/interface/CompilerStack.cpp | 4 ++-- {stdlib => solstdlib}/CMakeLists.txt | 10 +++++----- stdlib/stdlib.h.in => solstdlib/solstdlib.h.in | 6 +++--- solstdlib/solstdlib.src.h.in | 13 +++++++++++++ {stdlib => solstdlib}/src/precompiles.sol | 0 stdlib/stdlib.src.h.in | 13 ------------- 7 files changed, 24 insertions(+), 24 deletions(-) rename {stdlib => solstdlib}/CMakeLists.txt (65%) rename stdlib/stdlib.h.in => solstdlib/solstdlib.h.in (60%) create mode 100644 solstdlib/solstdlib.src.h.in rename {stdlib => solstdlib}/src/precompiles.sol (100%) delete mode 100644 stdlib/stdlib.src.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 140eb48f8..d44ae9bf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -140,7 +140,7 @@ add_subdirectory(libevmasm) add_subdirectory(libyul) add_subdirectory(libsolidity) add_subdirectory(libsolc) -add_subdirectory(stdlib) +add_subdirectory(solstdlib) add_subdirectory(tools) if (NOT EMSCRIPTEN) diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index f48d02e2e..ff8fedba2 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -77,7 +77,7 @@ #include #include -#include "stdlib.h" +#include "solstdlib.h" #include @@ -352,7 +352,7 @@ bool CompilerStack::parse() Parser parser{m_errorReporter, m_evmVersion, m_parserErrorRecovery}; - for (auto [name, content]: solidity::stdlib::sources) + for (auto [name, content]: solidity::solstdlib::sources) m_sources[name].charStream = make_unique(content, name); vector sourcesToParse; diff --git a/stdlib/CMakeLists.txt b/solstdlib/CMakeLists.txt similarity index 65% rename from stdlib/CMakeLists.txt rename to solstdlib/CMakeLists.txt index 742755f85..c3bcd9cfa 100644 --- a/stdlib/CMakeLists.txt +++ b/solstdlib/CMakeLists.txt @@ -1,20 +1,20 @@ # This will re-generate the headers if any file within src was modified. -set_directory_properties(PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/stdlib/src/) +set_directory_properties(PROPERTY CMAKE_CONFIGURE_DEPENDS ${CMAKE_SOURCE_DIR}/solstdlib/src/) set(STDLIB precompiles) set(GENERATED_STDLIB_HEADERS) foreach(src IN LISTS STDLIB) - set(STDLIB_FILE ${CMAKE_SOURCE_DIR}/stdlib/src/${src}.sol) + set(STDLIB_FILE ${CMAKE_SOURCE_DIR}/solstdlib/src/${src}.sol) file(READ ${STDLIB_FILE} STDLIB_FILE_CONTENT HEX) string(REGEX MATCHALL ".." STDLIB_FILE_CONTENT "${STDLIB_FILE_CONTENT}") string(REGEX REPLACE ";" ",\n\t0x" STDLIB_FILE_CONTENT "${STDLIB_FILE_CONTENT}") set(STDLIB_FILE_CONTENT "0x${STDLIB_FILE_CONTENT}") set(STDLIB_FILE_NAME ${src}) - configure_file("${CMAKE_SOURCE_DIR}/stdlib/stdlib.src.h.in" ${CMAKE_BINARY_DIR}/include/stdlib/${src}.h @ONLY) - list(APPEND GENERATED_STDLIB_HEADERS ${CMAKE_BINARY_DIR}/include/stdlib/${src}.h) + configure_file("${CMAKE_SOURCE_DIR}/solstdlib/solstdlib.src.h.in" ${CMAKE_BINARY_DIR}/include/solstdlib/${src}.h @ONLY) + list(APPEND GENERATED_STDLIB_HEADERS ${CMAKE_BINARY_DIR}/include/solstdlib/${src}.h) endforeach() -configure_file("${CMAKE_SOURCE_DIR}/stdlib/stdlib.h.in" ${CMAKE_BINARY_DIR}/include/stdlib.h @ONLY) +configure_file("${CMAKE_SOURCE_DIR}/solstdlib/solstdlib.h.in" ${CMAKE_BINARY_DIR}/include/solstdlib.h @ONLY) #add_library(stdlib # ${GENERATED_STDLIB_HEADERS} diff --git a/stdlib/stdlib.h.in b/solstdlib/solstdlib.h.in similarity index 60% rename from stdlib/stdlib.h.in rename to solstdlib/solstdlib.h.in index b1d243270..aee015681 100644 --- a/stdlib/stdlib.h.in +++ b/solstdlib/solstdlib.h.in @@ -3,13 +3,13 @@ #include #include -#include "stdlib/precompiles.h" +#include "solstdlib/precompiles.h" -namespace solidity::stdlib +namespace solidity::solstdlib { static std::map sources = { { "std/precompiles.sol", precompiles }, }; -} // namespace solidity::stdlib +} // namespace solidity::solstdlib diff --git a/solstdlib/solstdlib.src.h.in b/solstdlib/solstdlib.src.h.in new file mode 100644 index 000000000..5e5c48fbf --- /dev/null +++ b/solstdlib/solstdlib.src.h.in @@ -0,0 +1,13 @@ +// The generation of this file is defined in solstdlib/CMakeLists.txt. +// This file was generated by using the content of solstdlib/src/@STDLIB_FILE_NAME@.sol. + +#pragma once + +namespace solidity::solstdlib +{ + +static char const @STDLIB_FILE_NAME@[] = { + @STDLIB_FILE_CONTENT@, 0 +}; + +} // namespace solidity::solstdlib diff --git a/stdlib/src/precompiles.sol b/solstdlib/src/precompiles.sol similarity index 100% rename from stdlib/src/precompiles.sol rename to solstdlib/src/precompiles.sol diff --git a/stdlib/stdlib.src.h.in b/stdlib/stdlib.src.h.in deleted file mode 100644 index 0407663d6..000000000 --- a/stdlib/stdlib.src.h.in +++ /dev/null @@ -1,13 +0,0 @@ -// The generation of this file is defined in stdlib/CMakeLists.txt. -// This file was generated by using the content of stdlib/src/@STDLIB_FILE_NAME@.sol. - -#pragma once - -namespace solidity::stdlib -{ - -static char const @STDLIB_FILE_NAME@[] = { - @STDLIB_FILE_CONTENT@, 0 -}; - -} // namespace solidity::stdlib