aboutsummaryrefslogtreecommitdiffstats
path: root/CompilerStack.cpp
diff options
context:
space:
mode:
authorChristian <c@ethdev.com>2014-12-12 23:49:26 +0800
committerChristian <c@ethdev.com>2014-12-15 20:05:18 +0800
commit2f64c56ef3a49f7551a708f63c4ed836efce7b73 (patch)
tree6dd2a10b9ef7b0a67206991416dd0a74639f66ea /CompilerStack.cpp
parentc8586996059c3d2ae3c7025c2d4247073468ed73 (diff)
downloaddexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.gz
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.bz2
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.lz
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.xz
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.tar.zst
dexon-solidity-2f64c56ef3a49f7551a708f63c4ed836efce7b73.zip
Create contracts.
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r--CompilerStack.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp
index 7aaa79b1..23f5fd68 100644
--- a/CompilerStack.cpp
+++ b/CompilerStack.cpp
@@ -96,16 +96,20 @@ void CompilerStack::compile(bool _optimize)
{
if (!m_parseSuccessful)
parse();
+
+ map<ContractDefinition const*, bytes const*> contractBytecode;
for (Source const* source: m_sourceOrder)
for (ASTPointer<ASTNode> const& node: source->ast->getNodes())
if (ContractDefinition* contract = dynamic_cast<ContractDefinition*>(node.get()))
{
m_globalContext->setCurrentContract(*contract);
shared_ptr<Compiler> compiler = make_shared<Compiler>(_optimize);
- compiler->compileContract(*contract, m_globalContext->getMagicVariables());
+ compiler->compileContract(*contract, m_globalContext->getMagicVariables(),
+ contractBytecode);
Contract& compiledContract = m_contracts[contract->getName()];
compiledContract.bytecode = compiler->getAssembledBytecode();
compiledContract.compiler = move(compiler);
+ contractBytecode[compiledContract.contract] = &compiledContract.bytecode;
}
}