Commandline interface for the linker.

This commit is contained in:
chriseth
2015-09-11 19:35:01 +02:00
parent 147830d1a3
commit 70c0ed4129
4 changed files with 143 additions and 4 deletions
+10
View File
@@ -181,6 +181,16 @@ eth::LinkerObject const& CompilerStack::compile(string const& _sourceCode, bool
return object();
}
void CompilerStack::link(const std::map<string, h160>& _libraries)
{
for (auto& contract: m_contracts)
{
contract.second.object.link(_libraries);
contract.second.runtimeObject.link(_libraries);
contract.second.cloneObject.link(_libraries);
}
}
eth::AssemblyItems const* CompilerStack::assemblyItems(string const& _contractName) const
{
Contract const& currentContract = contract(_contractName);
+5 -2
View File
@@ -96,9 +96,12 @@ public:
/// @returns the compiled linker object
eth::LinkerObject const& compile(std::string const& _sourceCode, bool _optimize = false);
/// @returns the assembled bytecode for a contract (empty if it has to be linked or lacks implementation).
/// Inserts the given addresses into the linker objects of all compiled contracts.
void link(std::map<std::string, h160> const& _libraries);
/// @returns the assembled object for a contract.
eth::LinkerObject const& object(std::string const& _contractName = "") const;
/// @returns the runtime bytecode for the contract (empty if it has to be linked or lacks implementation).
/// @returns the runtime object for the contract.
eth::LinkerObject const& runtimeObject(std::string const& _contractName = "") const;
/// @returns the bytecode of a contract that uses an already deployed contract via CALLCODE.
/// The returned bytes will contain a sequence of 20 bytes of the format "XXX...XXX" which have to