Skip to content

Commit 2420966

Browse files
author
Leo
authored
Merge pull request #13428 from ethereum/qualify-move
Add std:: qualifier to move() calls
2 parents 4f65240 + f7cc29b commit 2420966

File tree

111 files changed

+362
-362
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

111 files changed

+362
-362
lines changed

libevmasm/Assembly.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ AssemblyItem const& Assembly::append(AssemblyItem _i)
5252
{
5353
assertThrow(m_deposit >= 0, AssemblyException, "Stack underflow.");
5454
m_deposit += static_cast<int>(_i.deposit());
55-
m_items.emplace_back(move(_i));
55+
m_items.emplace_back(std::move(_i));
5656
if (!m_items.back().location().isValid() && m_currentSourceLocation.isValid())
5757
m_items.back().setLocation(m_currentSourceLocation);
5858
m_items.back().m_modifierDepth = m_currentModifierDepth;
@@ -254,7 +254,7 @@ Json::Value Assembly::assemblyJSON(map<string, unsigned> const& _sourceIndices,
254254
if (!data.empty())
255255
jsonItem["value"] = data;
256256
jsonItem["source"] = sourceIndex;
257-
code.append(move(jsonItem));
257+
code.append(std::move(jsonItem));
258258

259259
if (item.type() == AssemblyItemType::Tag)
260260
{
@@ -265,7 +265,7 @@ Json::Value Assembly::assemblyJSON(map<string, unsigned> const& _sourceIndices,
265265
jumpdest["source"] = sourceIndex;
266266
if (item.m_modifierDepth != 0)
267267
jumpdest["modifierDepth"] = static_cast<int>(item.m_modifierDepth);
268-
code.append(move(jumpdest));
268+
code.append(std::move(jumpdest));
269269
}
270270
}
271271
if (_includeSourceList)
@@ -464,7 +464,7 @@ map<u256, u256> const& Assembly::optimiseInternal(
464464
}
465465
if (optimisedItems.size() < m_items.size())
466466
{
467-
m_items = move(optimisedItems);
467+
m_items = std::move(optimisedItems);
468468
count++;
469469
}
470470
}
@@ -478,7 +478,7 @@ map<u256, u256> const& Assembly::optimiseInternal(
478478
*this
479479
);
480480

481-
m_tagReplacements = move(tagReplacements);
481+
m_tagReplacements = std::move(tagReplacements);
482482
return *m_tagReplacements;
483483
}
484484

libevmasm/CommonSubexpressionEliminator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ vector<AssemblyItem> CommonSubexpressionEliminator::getOptimizedItems()
4848
{
4949
m_breakingItem = nullptr;
5050
m_storeOperations.clear();
51-
m_initialState = move(nextInitialState);
52-
m_state = move(nextState);
51+
m_initialState = std::move(nextInitialState);
52+
m_state = std::move(nextState);
5353
});
5454

5555
map<int, Id> initialStackContents;

libevmasm/ConstantOptimiser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value)
244244
bigint newGas = gasNeeded(newRoutine);
245245
if (newGas < bestGas)
246246
{
247-
bestGas = move(newGas);
248-
routine = move(newRoutine);
247+
bestGas = std::move(newGas);
248+
routine = std::move(newRoutine);
249249
}
250250
}
251251
return routine;

libevmasm/ControlFlowGraph.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,12 +236,12 @@ void ControlFlowGraph::gatherKnowledge()
236236
item.state = _state->copy();
237237
item.blocksSeen = _currentItem.blocksSeen;
238238
item.blocksSeen.insert(_currentItem.blockId);
239-
workQueue.push_back(move(item));
239+
workQueue.push_back(std::move(item));
240240
};
241241

242242
while (!workQueue.empty())
243243
{
244-
WorkQueueItem item = move(workQueue.back());
244+
WorkQueueItem item = std::move(workQueue.back());
245245
workQueue.pop_back();
246246
//@todo we might have to do something like incrementing the sequence number for each JUMPDEST
247247
assertThrow(!!item.blockId, OptimizerException, "");

libevmasm/Inliner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ void Inliner::optimise()
257257
if (auto exitItem = shouldInline(*tag, nextItem, *inlinableBlock))
258258
{
259259
newItems += inlinableBlock->items | ranges::views::drop_last(1);
260-
newItems.emplace_back(move(*exitItem));
260+
newItems.emplace_back(std::move(*exitItem));
261261

262262
// We are removing one push tag to the block we inline.
263263
--inlinableBlock->pushTagCount;
@@ -277,5 +277,5 @@ void Inliner::optimise()
277277
newItems.emplace_back(item);
278278
}
279279

280-
m_items = move(newItems);
280+
m_items = std::move(newItems);
281281
}

libevmasm/KnownState.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ void KnownState::reduceToCommonKnowledge(KnownState const& _other, bool _combine
252252
map<int, Id> shiftedStack;
253253
for (auto const& stackElement: m_stackElements)
254254
shiftedStack[stackElement.first - stackDiff] = stackElement.second;
255-
m_stackElements = move(shiftedStack);
255+
m_stackElements = std::move(shiftedStack);
256256
m_stackHeight = _other.m_stackHeight;
257257
}
258258

@@ -333,7 +333,7 @@ KnownState::StoreOperation KnownState::storeInStorage(
333333
for (auto const& storageItem: m_storageContent)
334334
if (m_expressionClasses->knownToBeDifferent(storageItem.first, _slot) || storageItem.second == _value)
335335
storageContents.insert(storageItem);
336-
m_storageContent = move(storageContents);
336+
m_storageContent = std::move(storageContents);
337337

338338
AssemblyItem item(Instruction::SSTORE, _location);
339339
Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber);
@@ -365,7 +365,7 @@ KnownState::StoreOperation KnownState::storeInMemory(Id _slot, Id _value, Source
365365
for (auto const& memoryItem: m_memoryContent)
366366
if (m_expressionClasses->knownToBeDifferentBy32(memoryItem.first, _slot))
367367
memoryContents.insert(memoryItem);
368-
m_memoryContent = move(memoryContents);
368+
m_memoryContent = std::move(memoryContents);
369369

370370
AssemblyItem item(Instruction::MSTORE, _location);
371371
Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber);

libevmasm/PathGasMeter.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ GasMeter::GasConsumption PathGasMeter::estimateMax(
4444
auto path = make_unique<GasPath>();
4545
path->index = _startIndex;
4646
path->state = _state->copy();
47-
queue(move(path));
47+
queue(std::move(path));
4848

4949
GasMeter::GasConsumption gas;
5050
while (!m_queue.empty() && !gas.isInfinite)
@@ -60,14 +60,14 @@ void PathGasMeter::queue(std::unique_ptr<GasPath>&& _newPath)
6060
)
6161
return;
6262
m_highestGasUsagePerJumpdest[_newPath->index] = _newPath->gas;
63-
m_queue[_newPath->index] = move(_newPath);
63+
m_queue[_newPath->index] = std::move(_newPath);
6464
}
6565

6666
GasMeter::GasConsumption PathGasMeter::handleQueueItem()
6767
{
6868
assertThrow(!m_queue.empty(), OptimizerException, "");
6969

70-
unique_ptr<GasPath> path = move(m_queue.rbegin()->second);
70+
unique_ptr<GasPath> path = std::move(m_queue.rbegin()->second);
7171
m_queue.erase(--m_queue.end());
7272

7373
shared_ptr<KnownState> state = path->state;
@@ -129,7 +129,7 @@ GasMeter::GasConsumption PathGasMeter::handleQueueItem()
129129
newPath->largestMemoryAccess = meter.largestMemoryAccess();
130130
newPath->state = state->copy();
131131
newPath->visitedJumpdests = path->visitedJumpdests;
132-
queue(move(newPath));
132+
queue(std::move(newPath));
133133
}
134134

135135
if (branchStops)

libsmtutil/CHCSmtLib2Interface.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ CHCSmtLib2Interface::CHCSmtLib2Interface(
4444
):
4545
CHCSolverInterface(_queryTimeout),
4646
m_smtlib2(make_unique<SMTLib2Interface>(_queryResponses, _smtCallback, m_queryTimeout)),
47-
m_queryResponses(move(_queryResponses)),
47+
m_queryResponses(std::move(_queryResponses)),
4848
m_smtCallback(_smtCallback)
4949
{
5050
reset();
@@ -195,7 +195,7 @@ void CHCSmtLib2Interface::declareFunction(string const& _name, SortPointer const
195195

196196
void CHCSmtLib2Interface::write(string _data)
197197
{
198-
m_accumulatedOutput += move(_data) + "\n";
198+
m_accumulatedOutput += std::move(_data) + "\n";
199199
}
200200

201201
string CHCSmtLib2Interface::querySolver(string const& _input)

libsmtutil/SMTLib2Interface.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ SMTLib2Interface::SMTLib2Interface(
4545
optional<unsigned> _queryTimeout
4646
):
4747
SolverInterface(_queryTimeout),
48-
m_queryResponses(move(_queryResponses)),
49-
m_smtCallback(move(_smtCallback))
48+
m_queryResponses(std::move(_queryResponses)),
49+
m_smtCallback(std::move(_smtCallback))
5050
{
5151
reset();
5252
}
@@ -264,7 +264,7 @@ string SMTLib2Interface::toSmtLibSort(vector<SortPointer> const& _sorts)
264264
void SMTLib2Interface::write(string _data)
265265
{
266266
smtAssert(!m_accumulatedOutput.empty(), "");
267-
m_accumulatedOutput.back() += move(_data) + "\n";
267+
m_accumulatedOutput.back() += std::move(_data) + "\n";
268268
}
269269

270270
string SMTLib2Interface::checkSatAndGetValuesCommand(vector<Expression> const& _expressionsToEvaluate)

libsmtutil/SMTPortfolio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ SMTPortfolio::SMTPortfolio(
4141
SolverInterface(_queryTimeout)
4242
{
4343
if (_enabledSolvers.smtlib2)
44-
m_solvers.emplace_back(make_unique<SMTLib2Interface>(move(_smtlib2Responses), move(_smtCallback), m_queryTimeout));
44+
m_solvers.emplace_back(make_unique<SMTLib2Interface>(std::move(_smtlib2Responses), std::move(_smtCallback), m_queryTimeout));
4545
#ifdef HAVE_Z3
4646
if (_enabledSolvers.z3 && Z3Interface::available())
4747
m_solvers.emplace_back(make_unique<Z3Interface>(m_queryTimeout));

0 commit comments

Comments
 (0)