mirror of
https://github.com/ethereum/solidity
synced 2023-10-03 13:03:40 +00:00
C++ namespace cleanup (except tests).
This commit is contained in:
committed by
Daniel Kirchner
parent
8385256bdc
commit
6b23412fae
@@ -57,20 +57,20 @@ namespace
|
||||
return input;
|
||||
}
|
||||
|
||||
eth::KnownState createInitialState(AssemblyItems const& _input)
|
||||
evmasm::KnownState createInitialState(AssemblyItems const& _input)
|
||||
{
|
||||
eth::KnownState state;
|
||||
evmasm::KnownState state;
|
||||
for (auto const& item: addDummyLocations(_input))
|
||||
state.feedItem(item, true);
|
||||
return state;
|
||||
}
|
||||
|
||||
AssemblyItems CSE(AssemblyItems const& _input, eth::KnownState const& _state = eth::KnownState())
|
||||
AssemblyItems CSE(AssemblyItems const& _input, evmasm::KnownState const& _state = evmasm::KnownState())
|
||||
{
|
||||
AssemblyItems input = addDummyLocations(_input);
|
||||
|
||||
bool usesMsize = (find(_input.begin(), _input.end(), AssemblyItem{Instruction::MSIZE}) != _input.end());
|
||||
eth::CommonSubexpressionEliminator cse(_state);
|
||||
evmasm::CommonSubexpressionEliminator cse(_state);
|
||||
BOOST_REQUIRE(cse.feedItems(input.begin(), input.end(), usesMsize) == input.end());
|
||||
AssemblyItems output = cse.getOptimizedItems();
|
||||
|
||||
@@ -84,7 +84,7 @@ namespace
|
||||
void checkCSE(
|
||||
AssemblyItems const& _input,
|
||||
AssemblyItems const& _expectation,
|
||||
KnownState const& _state = eth::KnownState()
|
||||
KnownState const& _state = evmasm::KnownState()
|
||||
)
|
||||
{
|
||||
AssemblyItems output = CSE(_input, _state);
|
||||
@@ -118,8 +118,8 @@ BOOST_AUTO_TEST_SUITE(Optimiser)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cse_intermediate_swap)
|
||||
{
|
||||
eth::KnownState state;
|
||||
eth::CommonSubexpressionEliminator cse(state);
|
||||
evmasm::KnownState state;
|
||||
evmasm::CommonSubexpressionEliminator cse(state);
|
||||
AssemblyItems input{
|
||||
Instruction::SWAP1, Instruction::POP, Instruction::ADD, u256(0), Instruction::SWAP1,
|
||||
Instruction::SLOAD, Instruction::SWAP1, u256(100), Instruction::EXP, Instruction::SWAP1,
|
||||
@@ -651,7 +651,7 @@ BOOST_AUTO_TEST_CASE(cse_keccak256_twice_same_content_noninterfering_store_in_be
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cse_with_initially_known_stack)
|
||||
{
|
||||
eth::KnownState state = createInitialState(AssemblyItems{
|
||||
evmasm::KnownState state = createInitialState(AssemblyItems{
|
||||
u256(0x12),
|
||||
u256(0x20),
|
||||
Instruction::ADD
|
||||
@@ -664,7 +664,7 @@ BOOST_AUTO_TEST_CASE(cse_with_initially_known_stack)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(cse_equality_on_initially_known_stack)
|
||||
{
|
||||
eth::KnownState state = createInitialState(AssemblyItems{Instruction::DUP1});
|
||||
evmasm::KnownState state = createInitialState(AssemblyItems{Instruction::DUP1});
|
||||
AssemblyItems input{
|
||||
Instruction::EQ
|
||||
};
|
||||
@@ -677,7 +677,7 @@ BOOST_AUTO_TEST_CASE(cse_access_previous_sequence)
|
||||
{
|
||||
// Tests that the code generator detects whether it tries to access SLOAD instructions
|
||||
// from a sequenced expression which is not in its scope.
|
||||
eth::KnownState state = createInitialState(AssemblyItems{
|
||||
evmasm::KnownState state = createInitialState(AssemblyItems{
|
||||
u256(0),
|
||||
Instruction::SLOAD,
|
||||
u256(1),
|
||||
|
||||
Reference in New Issue
Block a user