mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
Simplify Compiler/CompilerContext by removing extra layers of indirection
This commit is contained in:
@@ -91,7 +91,7 @@ evmasm::AssemblyItems compileContract(std::shared_ptr<CharStream> _sourceCode)
|
||||
);
|
||||
compiler.compileContract(*contract, map<ContractDefinition const*, shared_ptr<Compiler const>>{}, bytes());
|
||||
|
||||
return compiler.runtimeAssemblyItems();
|
||||
return compiler.runtimeAssembly().items();
|
||||
}
|
||||
BOOST_FAIL("No contract found in source.");
|
||||
return AssemblyItems();
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
#include <libsolidity/ast/TypeProvider.h>
|
||||
#include <libsolidity/analysis/TypeChecker.h>
|
||||
#include <liblangutil/ErrorReporter.h>
|
||||
#include <libevmasm/LinkerObject.h>
|
||||
#include <test/Common.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
@@ -160,7 +161,10 @@ bytes compileFirstExpression(
|
||||
context << context.functionEntryLabel(dynamic_cast<FunctionDefinition const&>(
|
||||
resolveDeclaration(*sourceUnit, function, resolver)
|
||||
));
|
||||
bytes instructions = context.assembledObject().bytecode;
|
||||
BOOST_REQUIRE(context.assemblyPtr());
|
||||
LinkerObject const& object = context.assemblyPtr()->assemble();
|
||||
BOOST_REQUIRE(object.immutableReferences.empty());
|
||||
bytes instructions = object.bytecode;
|
||||
// debug
|
||||
// cout << evmasm::disassemble(instructions) << endl;
|
||||
return instructions;
|
||||
|
||||
Reference in New Issue
Block a user