Add AssemblyStack.assembleEVM which returns both deploy and runtime assemblies

This commit is contained in:
Alex Beregszaszi
2021-06-17 15:35:59 +02:00
committed by chriseth
parent 05e3e723f5
commit 6ae09ee0cc
2 changed files with 54 additions and 23 deletions
+17 -1
View File
@@ -35,6 +35,11 @@
#include <memory>
#include <string>
namespace solidity::evmasm
{
class Assembly;
}
namespace solidity::langutil
{
class Scanner;
@@ -93,7 +98,18 @@ public:
/// In addition to the value returned by @a assemble, returns
/// a second object that is the runtime code.
/// Only available for EVM.
std::pair<MachineAssemblyObject, MachineAssemblyObject> assembleWithDeployed(std::optional<std::string_view> _deployeName = {}) const;
std::pair<MachineAssemblyObject, MachineAssemblyObject>
assembleWithDeployed(
std::optional<std::string_view> _deployName = {}
) const;
/// Run the assembly step (should only be called after parseAndAnalyze).
/// Similar to @a assemblyWithDeployed, but returns EVM assembly objects.
/// Only available for EVM.
std::pair<std::shared_ptr<evmasm::Assembly>, std::shared_ptr<evmasm::Assembly>>
assembleEVMWithDeployed(
std::optional<std::string_view> _deployName = {}
) const;
/// @returns the errors generated during parsing, analysis (and potentially assembly).
langutil::ErrorList const& errors() const { return m_errors; }