diff options
author | Christian <c@ethdev.com> | 2014-12-11 00:24:23 +0800 |
---|---|---|
committer | Christian <c@ethdev.com> | 2014-12-11 00:24:23 +0800 |
commit | 8b54d1afb2b3ad897330258367b2ce67c8a56940 (patch) | |
tree | afa0085f16b7a46cdf2681626d3fa898830ef2a3 /CompilerStack.cpp | |
parent | 373f0da2675f298984f265672d7414a58c061512 (diff) | |
parent | 3c377f77bbe75e65159e79a61696ba906ac22bda (diff) | |
download | dexon-solidity-8b54d1afb2b3ad897330258367b2ce67c8a56940.tar.gz dexon-solidity-8b54d1afb2b3ad897330258367b2ce67c8a56940.tar.zst dexon-solidity-8b54d1afb2b3ad897330258367b2ce67c8a56940.zip |
Merge remote-tracking branch 'ethereum/develop' into sol_strings
Conflicts:
libsolidity/Types.cpp
Diffstat (limited to 'CompilerStack.cpp')
-rw-r--r-- | CompilerStack.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/CompilerStack.cpp b/CompilerStack.cpp index 41ae5603..d4675485 100644 --- a/CompilerStack.cpp +++ b/CompilerStack.cpp @@ -82,7 +82,7 @@ void CompilerStack::parse(string const& _sourceCode) parse(); } -vector<string> CompilerStack::getContractNames() +vector<string> CompilerStack::getContractNames() const { if (!m_parseSuccessful) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); @@ -116,29 +116,29 @@ bytes const& CompilerStack::compile(string const& _sourceCode, bool _optimize) return getBytecode(); } -bytes const& CompilerStack::getBytecode(string const& _contractName) +bytes const& CompilerStack::getBytecode(string const& _contractName) const { return getContract(_contractName).bytecode; } -void CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName) +void CompilerStack::streamAssembly(ostream& _outStream, string const& _contractName) const { getContract(_contractName).compiler->streamAssembly(_outStream); } -string const& CompilerStack::getInterface(std::string const& _contractName) +string const& CompilerStack::getInterface(string const& _contractName) const { return getJsonDocumentation(_contractName, DocumentationType::ABI_INTERFACE); } -std::string const& CompilerStack::getJsonDocumentation(std::string const& _contractName, DocumentationType _type) +string const& CompilerStack::getJsonDocumentation(string const& _contractName, DocumentationType _type) const { if (!m_parseSuccessful) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("Parsing was not successful.")); - Contract& contract = getContract(_contractName); + Contract const& contract = getContract(_contractName); - std::unique_ptr<string>* doc; + std::unique_ptr<string const>* doc; switch (_type) { case DocumentationType::NATSPEC_USER: @@ -158,12 +158,12 @@ std::string const& CompilerStack::getJsonDocumentation(std::string const& _contr return *(*doc); } -Scanner const& CompilerStack::getScanner(string const& _sourceName) +Scanner const& CompilerStack::getScanner(string const& _sourceName) const { return *getSource(_sourceName).scanner; } -SourceUnit& CompilerStack::getAST(string const& _sourceName) +SourceUnit const& CompilerStack::getAST(string const& _sourceName) const { return *getSource(_sourceName).ast; } @@ -217,7 +217,7 @@ void CompilerStack::resolveImports() swap(m_sourceOrder, sourceOrder); } -CompilerStack::Contract& CompilerStack::getContract(string const& _contractName) +CompilerStack::Contract const& CompilerStack::getContract(string const& _contractName) const { if (m_contracts.empty()) BOOST_THROW_EXCEPTION(CompilerError() << errinfo_comment("No compiled contracts found.")); @@ -229,7 +229,7 @@ CompilerStack::Contract& CompilerStack::getContract(string const& _contractName) return it->second; } -CompilerStack::Source& CompilerStack::getSource(string const& _sourceName) +CompilerStack::Source const& CompilerStack::getSource(string const& _sourceName) const { auto it = m_sources.find(_sourceName); if (it == m_sources.end()) |