aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/inlineasm
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2017-06-06 21:37:43 +0800
committerchriseth <chris@ethereum.org>2017-06-08 21:52:45 +0800
commitef3d5874fefa6a86a30d4afdcfd269d599edda5d (patch)
treeb97381cf9e39d55cd42c585255f7903c7687bcdc /libsolidity/inlineasm
parent19f707aeaa23b55a4a5940977a9d6351d1f06938 (diff)
downloaddexon-solidity-ef3d5874fefa6a86a30d4afdcfd269d599edda5d.tar.gz
dexon-solidity-ef3d5874fefa6a86a30d4afdcfd269d599edda5d.tar.zst
dexon-solidity-ef3d5874fefa6a86a30d4afdcfd269d599edda5d.zip
Remove error reporter from code generation phase.
Diffstat (limited to 'libsolidity/inlineasm')
-rw-r--r--libsolidity/inlineasm/AsmCodeGen.cpp4
-rw-r--r--libsolidity/inlineasm/AsmCodeGen.h10
-rw-r--r--libsolidity/inlineasm/AsmStack.cpp6
3 files changed, 7 insertions, 13 deletions
diff --git a/libsolidity/inlineasm/AsmCodeGen.cpp b/libsolidity/inlineasm/AsmCodeGen.cpp
index dd91673b..217c6885 100644
--- a/libsolidity/inlineasm/AsmCodeGen.cpp
+++ b/libsolidity/inlineasm/AsmCodeGen.cpp
@@ -140,7 +140,7 @@ eth::Assembly assembly::CodeGenerator::assemble(
{
eth::Assembly assembly;
EthAssemblyAdapter assemblyAdapter(assembly);
- julia::CodeTransform(m_errorReporter, assemblyAdapter, _analysisInfo, false, _identifierAccess).run(_parsedData);
+ julia::CodeTransform(assemblyAdapter, _analysisInfo, false, _identifierAccess).run(_parsedData);
return assembly;
}
@@ -152,5 +152,5 @@ void assembly::CodeGenerator::assemble(
)
{
EthAssemblyAdapter assemblyAdapter(_assembly);
- julia::CodeTransform(m_errorReporter, assemblyAdapter, _analysisInfo, false, _identifierAccess).run(_parsedData);
+ julia::CodeTransform(assemblyAdapter, _analysisInfo, false, _identifierAccess).run(_parsedData);
}
diff --git a/libsolidity/inlineasm/AsmCodeGen.h b/libsolidity/inlineasm/AsmCodeGen.h
index f075fa93..7a149d74 100644
--- a/libsolidity/inlineasm/AsmCodeGen.h
+++ b/libsolidity/inlineasm/AsmCodeGen.h
@@ -34,7 +34,6 @@ class Assembly;
}
namespace solidity
{
-class ErrorReporter;
namespace assembly
{
struct Block;
@@ -42,24 +41,19 @@ struct Block;
class CodeGenerator
{
public:
- CodeGenerator(ErrorReporter& _errorReporter):
- m_errorReporter(_errorReporter) {}
/// Performs code generation and @returns the result.
- eth::Assembly assemble(
+ static eth::Assembly assemble(
Block const& _parsedData,
AsmAnalysisInfo& _analysisInfo,
julia::ExternalIdentifierAccess const& _identifierAccess = julia::ExternalIdentifierAccess()
);
/// Performs code generation and appends generated to to _assembly.
- void assemble(
+ static void assemble(
Block const& _parsedData,
AsmAnalysisInfo& _analysisInfo,
eth::Assembly& _assembly,
julia::ExternalIdentifierAccess const& _identifierAccess = julia::ExternalIdentifierAccess()
);
-
-private:
- ErrorReporter& m_errorReporter;
};
}
diff --git a/libsolidity/inlineasm/AsmStack.cpp b/libsolidity/inlineasm/AsmStack.cpp
index 73b1604d..92eb8a7a 100644
--- a/libsolidity/inlineasm/AsmStack.cpp
+++ b/libsolidity/inlineasm/AsmStack.cpp
@@ -66,8 +66,7 @@ eth::Assembly InlineAssemblyStack::assemble()
AsmAnalysisInfo analysisInfo;
AsmAnalyzer analyzer(analysisInfo, m_errorReporter);
solAssert(analyzer.analyze(*m_parserResult), "");
- CodeGenerator codeGen(m_errorReporter);
- return codeGen.assemble(*m_parserResult, analysisInfo);
+ return CodeGenerator::assemble(*m_parserResult, analysisInfo);
}
bool InlineAssemblyStack::parseAndAssemble(
@@ -87,7 +86,8 @@ bool InlineAssemblyStack::parseAndAssemble(
AsmAnalysisInfo analysisInfo;
AsmAnalyzer analyzer(analysisInfo, errorReporter, false, _identifierAccess.resolve);
solAssert(analyzer.analyze(*parserResult), "");
- CodeGenerator(errorReporter).assemble(*parserResult, analysisInfo, _assembly, _identifierAccess);
+ solAssert(errorReporter.errors().empty(), "");
+ CodeGenerator::assemble(*parserResult, analysisInfo, _assembly, _identifierAccess);
// At this point, the assembly might be messed up, but we should throw an
// internal compiler error anyway.