diff options
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r-- | CompilerStack.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp index f056bb9b..a85738eb 100644 --- a/CompilerStack.cpp +++ b/CompilerStack.cpp @@ -166,7 +166,13 @@ void CompilerStack::compile(bool _optimize, unsigned _runs) compiledContract.bytecode = compiler->getAssembledBytecode(); compiledContract.runtimeBytecode = compiler->getRuntimeBytecode(); compiledContract.compiler = move(compiler); + compiler = make_shared<Compiler>(_optimize, _runs); + compiler->compileContract(*contract, contractBytecode); contractBytecode[compiledContract.contract] = &compiledContract.bytecode; + + Compiler cloneCompiler(_optimize, _runs); + cloneCompiler.compileClone(*contract, contractBytecode); + compiledContract.cloneBytecode = cloneCompiler.getAssembledBytecode(); } } @@ -199,6 +205,11 @@ bytes const& CompilerStack::getRuntimeBytecode(string const& _contractName) cons return getContract(_contractName).runtimeBytecode; } +bytes const& CompilerStack::getCloneBytecode(string const& _contractName) const +{ + return getContract(_contractName).cloneBytecode; +} + dev::h256 CompilerStack::getContractCodeHash(string const& _contractName) const { return dev::sha3(getRuntimeBytecode(_contractName)); |