diff --git a/CompilerStack.cpp b/CompilerStack.cpp index 69dbced00..10504a245 100644 --- a/CompilerStack.cpp +++ b/CompilerStack.cpp @@ -155,6 +155,16 @@ bytes const& CompilerStack::compile(string const& _sourceCode, bool _optimize) return getBytecode(); } +eth::AssemblyItems const& CompilerStack::getAssemblyItems(string const& _contractName) const +{ + return getContract(_contractName).compiler->getAssemblyItems(); +} + +eth::AssemblyItems const& CompilerStack::getRuntimeAssemblyItems(string const& _contractName) const +{ + return getContract(_contractName).compiler->getRuntimeAssemblyItems(); +} + bytes const& CompilerStack::getBytecode(string const& _contractName) const { return getContract(_contractName).bytecode; diff --git a/CompilerStack.h b/CompilerStack.h index 812f41863..74617836e 100644 --- a/CompilerStack.h +++ b/CompilerStack.h @@ -26,11 +26,18 @@ #include #include #include +#include #include #include #include namespace dev { + +namespace eth { + class AssemblyItem; + using AssemblyItems = std::vector; +} + namespace solidity { // forward declarations @@ -85,6 +92,10 @@ public: bytes const& getBytecode(std::string const& _contractName = "") const; /// @returns the runtime bytecode for the contract, i.e. the code that is returned by the constructor. bytes const& getRuntimeBytecode(std::string const& _contractName = "") const; + /// @returns normal contract assembly items + eth::AssemblyItems const& getAssemblyItems(std::string const& _contractName = "") const; + /// @returns runtime contract assembly items + eth::AssemblyItems const& getRuntimeAssemblyItems(std::string const& _contractName = "") const; /// @returns hash of the runtime bytecode for the contract, i.e. the code that is returned by the constructor. dev::h256 getContractCodeHash(std::string const& _contractName = "") const;