From f7cc29bec181e50d2942e600a7e077c27c2f77ef Mon Sep 17 00:00:00 2001 From: Marenz Date: Tue, 23 Aug 2022 19:28:45 +0200 Subject: [PATCH] Add std:: qualifier to move() calls --- libevmasm/Assembly.cpp | 10 ++--- libevmasm/CommonSubexpressionEliminator.cpp | 4 +- libevmasm/ConstantOptimiser.cpp | 4 +- libevmasm/ControlFlowGraph.cpp | 4 +- libevmasm/Inliner.cpp | 4 +- libevmasm/KnownState.cpp | 6 +-- libevmasm/PathGasMeter.cpp | 8 ++-- libsmtutil/CHCSmtLib2Interface.cpp | 4 +- libsmtutil/SMTLib2Interface.cpp | 6 +-- libsmtutil/SMTPortfolio.cpp | 2 +- libsmtutil/Z3CHCInterface.cpp | 2 +- libsolc/libsolc.cpp | 4 +- libsolidity/analysis/DeclarationContainer.cpp | 2 +- libsolidity/analysis/FunctionCallGraph.cpp | 4 +- libsolidity/analysis/NameAndTypeResolver.cpp | 4 +- libsolidity/analysis/ReferencesResolver.cpp | 2 +- libsolidity/analysis/TypeChecker.cpp | 8 ++-- libsolidity/ast/AST.cpp | 2 +- libsolidity/ast/AST.h | 4 +- libsolidity/ast/ASTJsonExporter.cpp | 12 +++--- libsolidity/ast/ASTJsonImporter.cpp | 6 +-- libsolidity/ast/TypeProvider.cpp | 2 +- libsolidity/ast/Types.cpp | 6 +-- libsolidity/codegen/CompilerContext.cpp | 2 +- libsolidity/codegen/ContractCompiler.cpp | 2 +- libsolidity/codegen/ExpressionCompiler.cpp | 8 ++-- libsolidity/codegen/ExpressionCompiler.h | 2 +- libsolidity/codegen/LValue.cpp | 2 +- .../codegen/MultiUseYulFunctionCollector.cpp | 4 +- .../codegen/ir/IRGenerationContext.cpp | 6 +-- libsolidity/codegen/ir/IRGenerator.cpp | 14 +++---- .../codegen/ir/IRGeneratorForStatements.cpp | 14 +++---- libsolidity/formal/ArraySlicePredicate.cpp | 2 +- libsolidity/formal/BMC.cpp | 8 ++-- libsolidity/formal/CHC.cpp | 6 +-- libsolidity/formal/EncodingContext.cpp | 2 +- libsolidity/formal/EncodingContext.h | 2 +- libsolidity/formal/Invariants.cpp | 4 +- libsolidity/formal/ModelChecker.cpp | 2 +- libsolidity/formal/Predicate.cpp | 6 +-- libsolidity/formal/SMTEncoder.cpp | 4 +- libsolidity/formal/SymbolicState.cpp | 16 ++++---- libsolidity/formal/SymbolicVariables.cpp | 30 +++++++-------- libsolidity/interface/ABI.cpp | 2 +- libsolidity/interface/CompilerStack.cpp | 6 +-- libsolidity/interface/ImportRemapper.cpp | 2 +- libsolidity/interface/Natspec.cpp | 8 ++-- libsolidity/interface/StandardCompiler.cpp | 8 ++-- libsolidity/interface/StorageLayout.cpp | 6 +-- libsolidity/lsp/FileRepository.cpp | 6 +-- libsolidity/lsp/GotoDefinition.cpp | 4 +- libsolidity/lsp/LanguageServer.cpp | 18 ++++----- libsolidity/lsp/Transport.cpp | 24 ++++++------ libsolidity/parsing/DocStringParser.cpp | 2 +- libsolidity/parsing/Parser.cpp | 24 ++++++------ libsolutil/Whiskers.cpp | 8 ++-- libyul/AsmParser.cpp | 18 ++++----- libyul/AsmPrinter.cpp | 2 +- libyul/ControlFlowSideEffectsCollector.cpp | 2 +- libyul/ObjectParser.cpp | 8 ++-- libyul/backends/evm/ConstantOptimiser.cpp | 6 +-- libyul/backends/evm/ControlFlowGraph.h | 2 +- .../backends/evm/ControlFlowGraphBuilder.cpp | 8 ++-- libyul/backends/evm/EVMCodeTransform.cpp | 10 ++--- libyul/backends/evm/EVMDialect.cpp | 2 +- libyul/backends/evm/EthAssemblyAdapter.cpp | 2 +- .../evm/OptimizedEVMCodeTransform.cpp | 4 +- libyul/backends/evm/StackLayoutGenerator.cpp | 12 +++--- libyul/backends/wasm/BinaryTransform.cpp | 36 +++++++++--------- libyul/backends/wasm/EVMToEwasmTranslator.cpp | 2 +- libyul/backends/wasm/TextTransform.cpp | 8 ++-- libyul/backends/wasm/WasmCodeTransform.cpp | 22 +++++------ libyul/backends/wasm/WasmDialect.cpp | 2 +- libyul/optimiser/ConditionalSimplifier.h | 2 +- libyul/optimiser/DeadCodeEliminator.h | 2 +- libyul/optimiser/ForLoopInitRewriter.cpp | 2 +- libyul/optimiser/FunctionSpecializer.cpp | 12 +++--- libyul/optimiser/KnowledgeBase.cpp | 2 +- libyul/optimiser/NameDispenser.cpp | 2 +- libyul/optimiser/NameSimplifier.cpp | 2 +- libyul/optimiser/ReasoningBasedSimplifier.cpp | 4 +- libyul/optimiser/StackCompressor.cpp | 2 +- libyul/optimiser/StackToMemoryMover.cpp | 32 ++++++++-------- .../UnusedFunctionParameterPruner.cpp | 2 +- libyul/optimiser/UnusedStoreBase.cpp | 28 +++++++------- libyul/optimiser/UnusedStoreEliminator.cpp | 2 +- test/CommonSyntaxTest.cpp | 8 ++-- test/EVMHost.cpp | 2 +- test/Metadata.cpp | 2 +- test/TestCaseReader.cpp | 2 +- test/libevmasm/Optimiser.cpp | 2 +- test/liblangutil/Scanner.cpp | 4 +- test/libsolidity/GasTest.cpp | 2 +- test/libsolidity/SMTCheckerTest.cpp | 2 +- test/libsolidity/SemanticTest.cpp | 6 +-- .../SolidityExecutionFramework.cpp | 2 +- test/libsolidity/util/TestFileParser.cpp | 2 +- test/libyul/ObjectParser.cpp | 2 +- test/libyul/Parser.cpp | 2 +- test/solc/Common.cpp | 2 +- test/yulPhaser/FitnessMetrics.cpp | 2 +- test/yulPhaser/ProgramCache.cpp | 2 +- test/yulPhaser/TestHelpers.cpp | 2 +- tools/yulPhaser/Chromosome.cpp | 2 +- tools/yulPhaser/GeneticAlgorithms.cpp | 2 +- tools/yulPhaser/Mutations.cpp | 8 ++-- tools/yulPhaser/PairSelections.h | 2 +- tools/yulPhaser/Phaser.cpp | 38 +++++++++---------- tools/yulPhaser/Population.cpp | 14 +++---- tools/yulPhaser/Program.cpp | 6 +-- tools/yulPhaser/Selections.h | 2 +- 111 files changed, 362 insertions(+), 362 deletions(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 43e06ef9b..8e06da8ae 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -52,7 +52,7 @@ AssemblyItem const& Assembly::append(AssemblyItem _i) { assertThrow(m_deposit >= 0, AssemblyException, "Stack underflow."); m_deposit += static_cast(_i.deposit()); - m_items.emplace_back(move(_i)); + m_items.emplace_back(std::move(_i)); if (!m_items.back().location().isValid() && m_currentSourceLocation.isValid()) m_items.back().setLocation(m_currentSourceLocation); m_items.back().m_modifierDepth = m_currentModifierDepth; @@ -254,7 +254,7 @@ Json::Value Assembly::assemblyJSON(map const& _sourceIndices, if (!data.empty()) jsonItem["value"] = data; jsonItem["source"] = sourceIndex; - code.append(move(jsonItem)); + code.append(std::move(jsonItem)); if (item.type() == AssemblyItemType::Tag) { @@ -265,7 +265,7 @@ Json::Value Assembly::assemblyJSON(map const& _sourceIndices, jumpdest["source"] = sourceIndex; if (item.m_modifierDepth != 0) jumpdest["modifierDepth"] = static_cast(item.m_modifierDepth); - code.append(move(jumpdest)); + code.append(std::move(jumpdest)); } } if (_includeSourceList) @@ -464,7 +464,7 @@ map const& Assembly::optimiseInternal( } if (optimisedItems.size() < m_items.size()) { - m_items = move(optimisedItems); + m_items = std::move(optimisedItems); count++; } } @@ -478,7 +478,7 @@ map const& Assembly::optimiseInternal( *this ); - m_tagReplacements = move(tagReplacements); + m_tagReplacements = std::move(tagReplacements); return *m_tagReplacements; } diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp index abae23a83..19b275cb6 100644 --- a/libevmasm/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -48,8 +48,8 @@ vector CommonSubexpressionEliminator::getOptimizedItems() { m_breakingItem = nullptr; m_storeOperations.clear(); - m_initialState = move(nextInitialState); - m_state = move(nextState); + m_initialState = std::move(nextInitialState); + m_state = std::move(nextState); }); map initialStackContents; diff --git a/libevmasm/ConstantOptimiser.cpp b/libevmasm/ConstantOptimiser.cpp index a639bc6fc..37ac4c18b 100644 --- a/libevmasm/ConstantOptimiser.cpp +++ b/libevmasm/ConstantOptimiser.cpp @@ -244,8 +244,8 @@ AssemblyItems ComputeMethod::findRepresentation(u256 const& _value) bigint newGas = gasNeeded(newRoutine); if (newGas < bestGas) { - bestGas = move(newGas); - routine = move(newRoutine); + bestGas = std::move(newGas); + routine = std::move(newRoutine); } } return routine; diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index d6d8adf4a..cb648f90f 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -236,12 +236,12 @@ void ControlFlowGraph::gatherKnowledge() item.state = _state->copy(); item.blocksSeen = _currentItem.blocksSeen; item.blocksSeen.insert(_currentItem.blockId); - workQueue.push_back(move(item)); + workQueue.push_back(std::move(item)); }; while (!workQueue.empty()) { - WorkQueueItem item = move(workQueue.back()); + WorkQueueItem item = std::move(workQueue.back()); workQueue.pop_back(); //@todo we might have to do something like incrementing the sequence number for each JUMPDEST assertThrow(!!item.blockId, OptimizerException, ""); diff --git a/libevmasm/Inliner.cpp b/libevmasm/Inliner.cpp index 527e6ae38..d365e312a 100644 --- a/libevmasm/Inliner.cpp +++ b/libevmasm/Inliner.cpp @@ -257,7 +257,7 @@ void Inliner::optimise() if (auto exitItem = shouldInline(*tag, nextItem, *inlinableBlock)) { newItems += inlinableBlock->items | ranges::views::drop_last(1); - newItems.emplace_back(move(*exitItem)); + newItems.emplace_back(std::move(*exitItem)); // We are removing one push tag to the block we inline. --inlinableBlock->pushTagCount; @@ -277,5 +277,5 @@ void Inliner::optimise() newItems.emplace_back(item); } - m_items = move(newItems); + m_items = std::move(newItems); } diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index 841affab0..1e886f7ab 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -252,7 +252,7 @@ void KnownState::reduceToCommonKnowledge(KnownState const& _other, bool _combine map shiftedStack; for (auto const& stackElement: m_stackElements) shiftedStack[stackElement.first - stackDiff] = stackElement.second; - m_stackElements = move(shiftedStack); + m_stackElements = std::move(shiftedStack); m_stackHeight = _other.m_stackHeight; } @@ -333,7 +333,7 @@ KnownState::StoreOperation KnownState::storeInStorage( for (auto const& storageItem: m_storageContent) if (m_expressionClasses->knownToBeDifferent(storageItem.first, _slot) || storageItem.second == _value) storageContents.insert(storageItem); - m_storageContent = move(storageContents); + m_storageContent = std::move(storageContents); AssemblyItem item(Instruction::SSTORE, _location); Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber); @@ -365,7 +365,7 @@ KnownState::StoreOperation KnownState::storeInMemory(Id _slot, Id _value, Source for (auto const& memoryItem: m_memoryContent) if (m_expressionClasses->knownToBeDifferentBy32(memoryItem.first, _slot)) memoryContents.insert(memoryItem); - m_memoryContent = move(memoryContents); + m_memoryContent = std::move(memoryContents); AssemblyItem item(Instruction::MSTORE, _location); Id id = m_expressionClasses->find(item, {_slot, _value}, true, m_sequenceNumber); diff --git a/libevmasm/PathGasMeter.cpp b/libevmasm/PathGasMeter.cpp index b7c985f1b..c165985cf 100644 --- a/libevmasm/PathGasMeter.cpp +++ b/libevmasm/PathGasMeter.cpp @@ -44,7 +44,7 @@ GasMeter::GasConsumption PathGasMeter::estimateMax( auto path = make_unique(); path->index = _startIndex; path->state = _state->copy(); - queue(move(path)); + queue(std::move(path)); GasMeter::GasConsumption gas; while (!m_queue.empty() && !gas.isInfinite) @@ -60,14 +60,14 @@ void PathGasMeter::queue(std::unique_ptr&& _newPath) ) return; m_highestGasUsagePerJumpdest[_newPath->index] = _newPath->gas; - m_queue[_newPath->index] = move(_newPath); + m_queue[_newPath->index] = std::move(_newPath); } GasMeter::GasConsumption PathGasMeter::handleQueueItem() { assertThrow(!m_queue.empty(), OptimizerException, ""); - unique_ptr path = move(m_queue.rbegin()->second); + unique_ptr path = std::move(m_queue.rbegin()->second); m_queue.erase(--m_queue.end()); shared_ptr state = path->state; @@ -129,7 +129,7 @@ GasMeter::GasConsumption PathGasMeter::handleQueueItem() newPath->largestMemoryAccess = meter.largestMemoryAccess(); newPath->state = state->copy(); newPath->visitedJumpdests = path->visitedJumpdests; - queue(move(newPath)); + queue(std::move(newPath)); } if (branchStops) diff --git a/libsmtutil/CHCSmtLib2Interface.cpp b/libsmtutil/CHCSmtLib2Interface.cpp index 630eb0619..c9b5f6053 100644 --- a/libsmtutil/CHCSmtLib2Interface.cpp +++ b/libsmtutil/CHCSmtLib2Interface.cpp @@ -44,7 +44,7 @@ CHCSmtLib2Interface::CHCSmtLib2Interface( ): CHCSolverInterface(_queryTimeout), m_smtlib2(make_unique(_queryResponses, _smtCallback, m_queryTimeout)), - m_queryResponses(move(_queryResponses)), + m_queryResponses(std::move(_queryResponses)), m_smtCallback(_smtCallback) { reset(); @@ -195,7 +195,7 @@ void CHCSmtLib2Interface::declareFunction(string const& _name, SortPointer const void CHCSmtLib2Interface::write(string _data) { - m_accumulatedOutput += move(_data) + "\n"; + m_accumulatedOutput += std::move(_data) + "\n"; } string CHCSmtLib2Interface::querySolver(string const& _input) diff --git a/libsmtutil/SMTLib2Interface.cpp b/libsmtutil/SMTLib2Interface.cpp index bd74cf2c9..3e117913a 100644 --- a/libsmtutil/SMTLib2Interface.cpp +++ b/libsmtutil/SMTLib2Interface.cpp @@ -45,8 +45,8 @@ SMTLib2Interface::SMTLib2Interface( optional _queryTimeout ): SolverInterface(_queryTimeout), - m_queryResponses(move(_queryResponses)), - m_smtCallback(move(_smtCallback)) + m_queryResponses(std::move(_queryResponses)), + m_smtCallback(std::move(_smtCallback)) { reset(); } @@ -264,7 +264,7 @@ string SMTLib2Interface::toSmtLibSort(vector const& _sorts) void SMTLib2Interface::write(string _data) { smtAssert(!m_accumulatedOutput.empty(), ""); - m_accumulatedOutput.back() += move(_data) + "\n"; + m_accumulatedOutput.back() += std::move(_data) + "\n"; } string SMTLib2Interface::checkSatAndGetValuesCommand(vector const& _expressionsToEvaluate) diff --git a/libsmtutil/SMTPortfolio.cpp b/libsmtutil/SMTPortfolio.cpp index aec9b0a1c..77a404a47 100644 --- a/libsmtutil/SMTPortfolio.cpp +++ b/libsmtutil/SMTPortfolio.cpp @@ -41,7 +41,7 @@ SMTPortfolio::SMTPortfolio( SolverInterface(_queryTimeout) { if (_enabledSolvers.smtlib2) - m_solvers.emplace_back(make_unique(move(_smtlib2Responses), move(_smtCallback), m_queryTimeout)); + m_solvers.emplace_back(make_unique(std::move(_smtlib2Responses), std::move(_smtCallback), m_queryTimeout)); #ifdef HAVE_Z3 if (_enabledSolvers.z3 && Z3Interface::available()) m_solvers.emplace_back(make_unique(m_queryTimeout)); diff --git a/libsmtutil/Z3CHCInterface.cpp b/libsmtutil/Z3CHCInterface.cpp index 82dca4878..bfbc9841b 100644 --- a/libsmtutil/Z3CHCInterface.cpp +++ b/libsmtutil/Z3CHCInterface.cpp @@ -101,7 +101,7 @@ tuple Z3CHCInterface::que { result = CheckResult::UNSATISFIABLE; auto invariants = m_z3Interface->fromZ3Expr(m_solver.get_answer()); - return {result, move(invariants), {}}; + return {result, std::move(invariants), {}}; } case z3::check_result::unknown: { diff --git a/libsolc/libsolc.cpp b/libsolc/libsolc.cpp index 48cf7e0f8..4ceeeac6f 100644 --- a/libsolc/libsolc.cpp +++ b/libsolc/libsolc.cpp @@ -56,7 +56,7 @@ string takeOverAllocation(char const* _data) for (auto iter = begin(solidityAllocations); iter != end(solidityAllocations); ++iter) if (iter->data() == _data) { - string chunk = move(*iter); + string chunk = std::move(*iter); solidityAllocations.erase(iter); return chunk; } @@ -109,7 +109,7 @@ ReadCallback::Callback wrapReadCallback(CStyleReadFileCallback _readCallback, vo string compile(string _input, CStyleReadFileCallback _readCallback, void* _readContext) { StandardCompiler compiler(wrapReadCallback(_readCallback, _readContext)); - return compiler.compile(move(_input)); + return compiler.compile(std::move(_input)); } } diff --git a/libsolidity/analysis/DeclarationContainer.cpp b/libsolidity/analysis/DeclarationContainer.cpp index 6d13243af..b6cd3eef0 100644 --- a/libsolidity/analysis/DeclarationContainer.cpp +++ b/libsolidity/analysis/DeclarationContainer.cpp @@ -210,7 +210,7 @@ void DeclarationContainer::populateHomonyms(back_insert_iterator _it) ResolvingSettings settings; settings.recursive = true; settings.alsoInvisible = true; - vector const& declarations = m_enclosingContainer->resolveName(name, move(settings)); + vector const& declarations = m_enclosingContainer->resolveName(name, std::move(settings)); if (!declarations.empty()) _it = make_pair(location, declarations); } diff --git a/libsolidity/analysis/FunctionCallGraph.cpp b/libsolidity/analysis/FunctionCallGraph.cpp index 45da1b4f0..e941c99c5 100644 --- a/libsolidity/analysis/FunctionCallGraph.cpp +++ b/libsolidity/analysis/FunctionCallGraph.cpp @@ -61,7 +61,7 @@ CallGraph FunctionCallGraphBuilder::buildCreationGraph(ContractDefinition const& builder.m_currentNode = CallGraph::SpecialNode::Entry; builder.processQueue(); - return move(builder.m_graph); + return std::move(builder.m_graph); } CallGraph FunctionCallGraphBuilder::buildDeployedGraph( @@ -109,7 +109,7 @@ CallGraph FunctionCallGraphBuilder::buildDeployedGraph( builder.m_currentNode = CallGraph::SpecialNode::Entry; builder.processQueue(); - return move(builder.m_graph); + return std::move(builder.m_graph); } bool FunctionCallGraphBuilder::visit(FunctionCall const& _functionCall) diff --git a/libsolidity/analysis/NameAndTypeResolver.cpp b/libsolidity/analysis/NameAndTypeResolver.cpp index 63a19a4cb..1b58d3c9a 100644 --- a/libsolidity/analysis/NameAndTypeResolver.cpp +++ b/libsolidity/analysis/NameAndTypeResolver.cpp @@ -184,7 +184,7 @@ vector NameAndTypeResolver::nameFromCurrentScope(ASTString c ResolvingSettings settings; settings.recursive = true; settings.alsoInvisible = _includeInvisibles; - return m_currentScope->resolveName(_name, move(settings)); + return m_currentScope->resolveName(_name, std::move(settings)); } Declaration const* NameAndTypeResolver::pathFromCurrentScope(vector const& _path) const @@ -204,7 +204,7 @@ std::vector NameAndTypeResolver::pathFromCurrentScopeWithAll settings.recursive = true; settings.alsoInvisible = false; settings.onlyVisibleAsUnqualifiedNames = true; - vector candidates = m_currentScope->resolveName(_path.front(), move(settings)); + vector candidates = m_currentScope->resolveName(_path.front(), std::move(settings)); for (size_t i = 1; i < _path.size() && candidates.size() == 1; i++) { diff --git a/libsolidity/analysis/ReferencesResolver.cpp b/libsolidity/analysis/ReferencesResolver.cpp index bf1fef7aa..50b1656ef 100644 --- a/libsolidity/analysis/ReferencesResolver.cpp +++ b/libsolidity/analysis/ReferencesResolver.cpp @@ -276,7 +276,7 @@ void ReferencesResolver::operator()(yul::Identifier const& _identifier) return; } - m_yulAnnotation->externalReferences[&_identifier].suffix = move(suffix); + m_yulAnnotation->externalReferences[&_identifier].suffix = std::move(suffix); m_yulAnnotation->externalReferences[&_identifier].declaration = declarations.front(); } diff --git a/libsolidity/analysis/TypeChecker.cpp b/libsolidity/analysis/TypeChecker.cpp index de3cdc847..1025e6576 100644 --- a/libsolidity/analysis/TypeChecker.cpp +++ b/libsolidity/analysis/TypeChecker.cpp @@ -1639,7 +1639,7 @@ bool TypeChecker::visit(TupleExpression const& _tuple) if (components.size() == 1) _tuple.annotation().type = type(*components[0]); else - _tuple.annotation().type = TypeProvider::tuple(move(types)); + _tuple.annotation().type = TypeProvider::tuple(std::move(types)); // If some of the components are not LValues, the error is reported above. _tuple.annotation().isLValue = true; _tuple.annotation().isPure = false; @@ -1710,7 +1710,7 @@ bool TypeChecker::visit(TupleExpression const& _tuple) if (components.size() == 1) _tuple.annotation().type = type(*components[0]); else - _tuple.annotation().type = TypeProvider::tuple(move(types)); + _tuple.annotation().type = TypeProvider::tuple(std::move(types)); } _tuple.annotation().isLValue = false; @@ -2811,8 +2811,8 @@ bool TypeChecker::visit(FunctionCall const& _functionCall) } funcCallAnno.type = returnTypes.size() == 1 ? - move(returnTypes.front()) : - TypeProvider::tuple(move(returnTypes)); + std::move(returnTypes.front()) : + TypeProvider::tuple(std::move(returnTypes)); break; } diff --git a/libsolidity/ast/AST.cpp b/libsolidity/ast/AST.cpp index 04c47a155..9cb5ae0f9 100644 --- a/libsolidity/ast/AST.cpp +++ b/libsolidity/ast/AST.cpp @@ -239,7 +239,7 @@ vector ContractDefinition::interfaceErrors(bool _require result += (*annotation().creationCallGraph)->usedErrors + (*annotation().deployedCallGraph)->usedErrors; - return util::convertContainer>(move(result)); + return util::convertContainer>(std::move(result)); } vector, FunctionTypePointer>> const& ContractDefinition::interfaceFunctionList(bool _includeInheritedFunctions) const diff --git a/libsolidity/ast/AST.h b/libsolidity/ast/AST.h index e688b66d1..d6e41bb5f 100644 --- a/libsolidity/ast/AST.h +++ b/libsolidity/ast/AST.h @@ -358,7 +358,7 @@ public: ): Declaration(_id, _location, _unitAlias, std::move(_unitAliasLocation)), m_path(std::move(_path)), - m_symbolAliases(move(_symbolAliases)) + m_symbolAliases(std::move(_symbolAliases)) { } void accept(ASTVisitor& _visitor) override; @@ -1503,7 +1503,7 @@ public: ): Statement(_id, _location, _docString), m_dialect(_dialect), - m_flags(move(_flags)), + m_flags(std::move(_flags)), m_operations(std::move(_operations)) {} void accept(ASTVisitor& _visitor) override; diff --git a/libsolidity/ast/ASTJsonExporter.cpp b/libsolidity/ast/ASTJsonExporter.cpp index e7e7a0143..d308cd90c 100644 --- a/libsolidity/ast/ASTJsonExporter.cpp +++ b/libsolidity/ast/ASTJsonExporter.cpp @@ -336,15 +336,15 @@ bool ASTJsonExporter::visit(UsingForDirective const& _node) { Json::Value functionNode; functionNode["function"] = toJson(*function); - functionList.append(move(functionNode)); + functionList.append(std::move(functionNode)); } - attributes.emplace_back("functionList", move(functionList)); + attributes.emplace_back("functionList", std::move(functionList)); } else attributes.emplace_back("libraryName", toJson(*_node.functionsOrLibrary().front())); attributes.emplace_back("global", _node.global()); - setJsonNode(_node, "UsingForDirective", move(attributes)); + setJsonNode(_node, "UsingForDirective", std::move(attributes)); return false; } @@ -518,7 +518,7 @@ bool ASTJsonExporter::visit(ModifierInvocation const& _node) else if (dynamic_cast(declaration)) attributes.emplace_back("kind", "baseConstructorSpecifier"); } - setJsonNode(_node, "ModifierInvocation", move(attributes)); + setJsonNode(_node, "ModifierInvocation", std::move(attributes)); return false; } @@ -645,9 +645,9 @@ bool ASTJsonExporter::visit(InlineAssembly const& _node) flags.append(*flag); else flags.append(Json::nullValue); - attributes.emplace_back(make_pair("flags", move(flags))); + attributes.emplace_back(make_pair("flags", std::move(flags))); } - setJsonNode(_node, "InlineAssembly", move(attributes)); + setJsonNode(_node, "InlineAssembly", std::move(attributes)); return false; } diff --git a/libsolidity/ast/ASTJsonImporter.cpp b/libsolidity/ast/ASTJsonImporter.cpp index df329ae72..96c37003e 100644 --- a/libsolidity/ast/ASTJsonImporter.cpp +++ b/libsolidity/ast/ASTJsonImporter.cpp @@ -299,7 +299,7 @@ ASTPointer ASTJsonImporter::createImportDirective(Json::Value c path, unitAlias, createNameSourceLocation(_node), - move(symbolAliases) + std::move(symbolAliases) ); astAssert(_node["absolutePath"].isString(), "Expected 'absolutePath' to be a string!"); @@ -391,7 +391,7 @@ ASTPointer ASTJsonImporter::createUsingForDirective(Json::Val return createASTNode( _node, - move(functions), + std::move(functions), !_node.isMember("libraryName"), _node["typeName"].isNull() ? nullptr : convertJsonToASTNode(_node["typeName"]), memberAsBool(_node, "global") @@ -686,7 +686,7 @@ ASTPointer ASTJsonImporter::createInlineAssembly(Json::Value con _node, nullOrASTString(_node, "documentation"), dialect, - move(flags), + std::move(flags), operations ); } diff --git a/libsolidity/ast/TypeProvider.cpp b/libsolidity/ast/TypeProvider.cpp index 97d230d2e..91d1da4be 100644 --- a/libsolidity/ast/TypeProvider.cpp +++ b/libsolidity/ast/TypeProvider.cpp @@ -404,7 +404,7 @@ TupleType const* TypeProvider::tuple(vector members) if (members.empty()) return &m_emptyTuple; - return createAndGet(move(members)); + return createAndGet(std::move(members)); } ReferenceType const* TypeProvider::withLocation(ReferenceType const* _type, DataLocation _location, bool _isPointer) diff --git a/libsolidity/ast/Types.cpp b/libsolidity/ast/Types.cpp index f88d1afce..34a6f4268 100644 --- a/libsolidity/ast/Types.cpp +++ b/libsolidity/ast/Types.cpp @@ -125,7 +125,7 @@ MemberList::Member::Member(Declaration const* _declaration, Type const* _type): {} MemberList::Member::Member(Declaration const* _declaration, Type const* _type, string _name): - name(move(_name)), + name(std::move(_name)), type(_type), declaration(_declaration) { @@ -305,7 +305,7 @@ MemberList const& Type::members(ASTNode const* _currentScope) const MemberList::MemberMap members = nativeMembers(_currentScope); if (_currentScope) members += boundFunctions(*this, *_currentScope); - m_members[_currentScope] = make_unique(move(members)); + m_members[_currentScope] = make_unique(std::move(members)); } return *m_members[_currentScope]; } @@ -2737,7 +2737,7 @@ Type const* TupleType::mobileType() const else mobiles.push_back(nullptr); } - return TypeProvider::tuple(move(mobiles)); + return TypeProvider::tuple(std::move(mobiles)); } FunctionType::FunctionType(FunctionDefinition const& _function, Kind _kind): diff --git a/libsolidity/codegen/CompilerContext.cpp b/libsolidity/codegen/CompilerContext.cpp index dbd1a1730..f1cc5b6dd 100644 --- a/libsolidity/codegen/CompilerContext.cpp +++ b/libsolidity/codegen/CompilerContext.cpp @@ -199,7 +199,7 @@ void CompilerContext::appendYulUtilityFunctions(OptimiserSettings const& _optimi if (!code.empty()) { appendInlineAssembly( - yul::reindent("{\n" + move(code) + "\n}"), + yul::reindent("{\n" + std::move(code) + "\n}"), {}, m_externallyUsedYulFunctions, true, diff --git a/libsolidity/codegen/ContractCompiler.cpp b/libsolidity/codegen/ContractCompiler.cpp index bdad48173..a89dbb21b 100644 --- a/libsolidity/codegen/ContractCompiler.cpp +++ b/libsolidity/codegen/ContractCompiler.cpp @@ -1293,7 +1293,7 @@ bool ContractCompiler::visit(Return const& _return) Type const* expectedType; if (expression->annotation().type->category() == Type::Category::Tuple || types.size() != 1) - expectedType = TypeProvider::tuple(move(types)); + expectedType = TypeProvider::tuple(std::move(types)); else expectedType = types.front(); compileExpression(*expression, expectedType); diff --git a/libsolidity/codegen/ExpressionCompiler.cpp b/libsolidity/codegen/ExpressionCompiler.cpp index 95087aa02..3ee824447 100644 --- a/libsolidity/codegen/ExpressionCompiler.cpp +++ b/libsolidity/codegen/ExpressionCompiler.cpp @@ -71,7 +71,7 @@ Type const* closestType(Type const* _type, Type const* _targetType, bool _isShif solAssert(tempComponents[i], ""); } } - return TypeProvider::tuple(move(tempComponents)); + return TypeProvider::tuple(std::move(tempComponents)); } else return _targetType->dataStoredIn(DataLocation::Storage) ? _type->mobileType() : _targetType; @@ -391,7 +391,7 @@ bool ExpressionCompiler::visit(TupleExpression const& _tuple) if (_tuple.annotation().willBeWrittenTo) { solAssert(!!m_currentLValue, ""); - lvalues.push_back(move(m_currentLValue)); + lvalues.push_back(std::move(m_currentLValue)); } } else if (_tuple.annotation().willBeWrittenTo) @@ -399,9 +399,9 @@ bool ExpressionCompiler::visit(TupleExpression const& _tuple) if (_tuple.annotation().willBeWrittenTo) { if (_tuple.components().size() == 1) - m_currentLValue = move(lvalues[0]); + m_currentLValue = std::move(lvalues[0]); else - m_currentLValue = make_unique(m_context, move(lvalues)); + m_currentLValue = make_unique(m_context, std::move(lvalues)); } } return false; diff --git a/libsolidity/codegen/ExpressionCompiler.h b/libsolidity/codegen/ExpressionCompiler.h index b583b8327..13e1e3106 100644 --- a/libsolidity/codegen/ExpressionCompiler.h +++ b/libsolidity/codegen/ExpressionCompiler.h @@ -151,7 +151,7 @@ void ExpressionCompiler::setLValue(Expression const& _expression, Arguments cons solAssert(!m_currentLValue, "Current LValue not reset before trying to set new one."); std::unique_ptr lvalue = std::make_unique(m_context, _arguments...); if (_expression.annotation().willBeWrittenTo) - m_currentLValue = move(lvalue); + m_currentLValue = std::move(lvalue); else lvalue->retrieveValue(_expression.location(), true); } diff --git a/libsolidity/codegen/LValue.cpp b/libsolidity/codegen/LValue.cpp index aa7524c93..2708d319d 100644 --- a/libsolidity/codegen/LValue.cpp +++ b/libsolidity/codegen/LValue.cpp @@ -557,7 +557,7 @@ TupleObject::TupleObject( CompilerContext& _compilerContext, std::vector>&& _lvalues ): - LValue(_compilerContext), m_lvalues(move(_lvalues)) + LValue(_compilerContext), m_lvalues(std::move(_lvalues)) { } diff --git a/libsolidity/codegen/MultiUseYulFunctionCollector.cpp b/libsolidity/codegen/MultiUseYulFunctionCollector.cpp index 69d30c6c8..39df88449 100644 --- a/libsolidity/codegen/MultiUseYulFunctionCollector.cpp +++ b/libsolidity/codegen/MultiUseYulFunctionCollector.cpp @@ -33,7 +33,7 @@ using namespace solidity::util; string MultiUseYulFunctionCollector::requestedFunctions() { - string result = move(m_code); + string result = std::move(m_code); m_code.clear(); m_requestedFunctions.clear(); return result; @@ -47,7 +47,7 @@ string MultiUseYulFunctionCollector::createFunction(string const& _name, functio string fun = _creator(); solAssert(!fun.empty(), ""); solAssert(fun.find("function " + _name + "(") != string::npos, "Function not properly named."); - m_code += move(fun); + m_code += std::move(fun); } return _name; } diff --git a/libsolidity/codegen/ir/IRGenerationContext.cpp b/libsolidity/codegen/ir/IRGenerationContext.cpp index 5d39bf4b5..cb1c371dc 100644 --- a/libsolidity/codegen/ir/IRGenerationContext.cpp +++ b/libsolidity/codegen/ir/IRGenerationContext.cpp @@ -121,7 +121,7 @@ void IRGenerationContext::addStateVariable( unsigned _byteOffset ) { - m_stateVariables[&_declaration] = make_pair(move(_storageOffset), _byteOffset); + m_stateVariables[&_declaration] = make_pair(std::move(_storageOffset), _byteOffset); } string IRGenerationContext::newYulVariable() @@ -137,12 +137,12 @@ void IRGenerationContext::initializeInternalDispatch(InternalDispatchMap _intern for (auto function: functions) enqueueFunctionForCodeGeneration(*function); - m_internalDispatchMap = move(_internalDispatch); + m_internalDispatchMap = std::move(_internalDispatch); } InternalDispatchMap IRGenerationContext::consumeInternalDispatchMap() { - InternalDispatchMap internalDispatch = move(m_internalDispatchMap); + InternalDispatchMap internalDispatch = std::move(m_internalDispatchMap); m_internalDispatchMap.clear(); return internalDispatch; } diff --git a/libsolidity/codegen/ir/IRGenerator.cpp b/libsolidity/codegen/ir/IRGenerator.cpp index 7c76f8344..a13a35301 100644 --- a/libsolidity/codegen/ir/IRGenerator.cpp +++ b/libsolidity/codegen/ir/IRGenerator.cpp @@ -113,7 +113,7 @@ pair IRGenerator::run( } asmStack.optimize(); - return {move(ir), asmStack.print(m_context.soliditySourceProvider())}; + return {std::move(ir), asmStack.print(m_context.soliditySourceProvider())}; } string IRGenerator::generate( @@ -214,7 +214,7 @@ string IRGenerator::generate( // NOTE: Function pointers can be passed from creation code via storage variables. We need to // get all the functions they could point to into the dispatch functions even if they're never // referenced by name in the deployed code. - m_context.initializeInternalDispatch(move(internalDispatchMap)); + m_context.initializeInternalDispatch(std::move(internalDispatchMap)); // Do not register immutables to avoid assignment. t("DeployedObject", IRNames::deployedObject(_contract)); @@ -236,8 +236,8 @@ string IRGenerator::generate( solAssert(_contract.annotation().creationCallGraph->get() != nullptr, ""); solAssert(_contract.annotation().deployedCallGraph->get() != nullptr, ""); - verifyCallGraph(collectReachableCallables(**_contract.annotation().creationCallGraph), move(creationFunctionList)); - verifyCallGraph(collectReachableCallables(**_contract.annotation().deployedCallGraph), move(deployedFunctionList)); + verifyCallGraph(collectReachableCallables(**_contract.annotation().creationCallGraph), std::move(creationFunctionList)); + verifyCallGraph(collectReachableCallables(**_contract.annotation().deployedCallGraph), std::move(deployedFunctionList)); return t.render(); } @@ -317,7 +317,7 @@ InternalDispatchMap IRGenerator::generateInternalDispatchFunctions(ContractDefin }); } - templ("cases", move(cases)); + templ("cases", std::move(cases)); return templ.render(); }); } @@ -944,7 +944,7 @@ void IRGenerator::generateConstructors(ContractDefinition const& _contract) generateFunctionWithModifierInner(*constructor); } } - t("userDefinedConstructorBody", move(body)); + t("userDefinedConstructorBody", std::move(body)); return t.render(); }); @@ -1117,7 +1117,7 @@ void IRGenerator::resetContext(ContractDefinition const& _contract, ExecutionCon m_context.soliditySourceProvider() ); newContext.copyFunctionIDsFrom(m_context); - m_context = move(newContext); + m_context = std::move(newContext); m_context.setMostDerivedContract(_contract); for (auto const& var: ContractType(_contract).stateVariables()) diff --git a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp index 5eaeed743..679510cd6 100644 --- a/libsolidity/codegen/ir/IRGeneratorForStatements.cpp +++ b/libsolidity/codegen/ir/IRGeneratorForStatements.cpp @@ -827,17 +827,17 @@ bool IRGeneratorForStatements::visit(BinaryOperation const& _binOp) expr = "iszero(" + expr + ")"; } else if (op == Token::Equal) - expr = "eq(" + move(args) + ")"; + expr = "eq(" + std::move(args) + ")"; else if (op == Token::NotEqual) - expr = "iszero(eq(" + move(args) + "))"; + expr = "iszero(eq(" + std::move(args) + "))"; else if (op == Token::GreaterThanOrEqual) - expr = "iszero(" + string(isSigned ? "slt(" : "lt(") + move(args) + "))"; + expr = "iszero(" + string(isSigned ? "slt(" : "lt(") + std::move(args) + "))"; else if (op == Token::LessThanOrEqual) - expr = "iszero(" + string(isSigned ? "sgt(" : "gt(") + move(args) + "))"; + expr = "iszero(" + string(isSigned ? "sgt(" : "gt(") + std::move(args) + "))"; else if (op == Token::GreaterThan) - expr = (isSigned ? "sgt(" : "gt(") + move(args) + ")"; + expr = (isSigned ? "sgt(" : "gt(") + std::move(args) + ")"; else if (op == Token::LessThan) - expr = (isSigned ? "slt(" : "lt(") + move(args) + ")"; + expr = (isSigned ? "slt(" : "lt(") + std::move(args) + ")"; else solAssert(false, "Unknown comparison operator."); define(_binOp) << expr << "\n"; @@ -1109,7 +1109,7 @@ void IRGeneratorForStatements::endVisit(FunctionCall const& _functionCall) messageArgumentType ); - appendCode() << move(requireOrAssertFunction) << "(" << IRVariable(*arguments[0]).name(); + appendCode() << std::move(requireOrAssertFunction) << "(" << IRVariable(*arguments[0]).name(); if (messageArgumentType && messageArgumentType->sizeOnStack() > 0) appendCode() << ", " << IRVariable(*arguments[1]).commaSeparatedList(); appendCode() << ")\n"; diff --git a/libsolidity/formal/ArraySlicePredicate.cpp b/libsolidity/formal/ArraySlicePredicate.cpp index 85fced906..f73985f18 100644 --- a/libsolidity/formal/ArraySlicePredicate.cpp +++ b/libsolidity/formal/ArraySlicePredicate.cpp @@ -86,6 +86,6 @@ pair ArraySlicePredicate::create(So return {false, m_slicePredicates[tupleName] = { {&slice, &header, &loop}, - {move(rule1), move(rule2), move(rule3), move(rule4)} + {std::move(rule1), std::move(rule2), std::move(rule3), std::move(rule4)} }}; } diff --git a/libsolidity/formal/BMC.cpp b/libsolidity/formal/BMC.cpp index bf3618791..0466bfbac 100644 --- a/libsolidity/formal/BMC.cpp +++ b/libsolidity/formal/BMC.cpp @@ -76,7 +76,7 @@ void BMC::analyze(SourceUnit const& _source, map, vector> BMC::modelExpressions() expressionName = m_charStreamProvider.charStream(*uf->location().sourceName).text( uf->location() ); - expressionNames.push_back(move(expressionName)); + expressionNames.push_back(std::move(expressionName)); } return {expressionsToEvaluate, expressionNames}; @@ -888,7 +888,7 @@ void BMC::addVerificationTarget( if (_type == VerificationTargetType::ConstantCondition) checkVerificationTarget(target); else - m_verificationTargets.emplace_back(move(target)); + m_verificationTargets.emplace_back(std::move(target)); } /// Solving. @@ -964,7 +964,7 @@ void BMC::checkCondition( message.str(), SecondarySourceLocation().append(modelMessage.str(), SourceLocation{}) .append(SMTEncoder::callStackMessage(_callStack)) - .append(move(secondaryLocation)) + .append(std::move(secondaryLocation)) ); break; } diff --git a/libsolidity/formal/CHC.cpp b/libsolidity/formal/CHC.cpp index 267ea9269..3d5c3e6c3 100644 --- a/libsolidity/formal/CHC.cpp +++ b/libsolidity/formal/CHC.cpp @@ -1422,7 +1422,7 @@ vector CHC::currentStateVariables(ContractDefinition const& smtutil::Expression CHC::currentEqualInitialVarsConstraints(vector const& _vars) const { return fold(_vars, smtutil::Expression(true), [this](auto&& _conj, auto _var) { - return move(_conj) && currentValue(*_var) == m_context.variable(*_var)->valueAtIndex(0); + return std::move(_conj) && currentValue(*_var) == m_context.variable(*_var)->valueAtIndex(0); }); } @@ -1566,7 +1566,7 @@ tuple CHC::query tie(resultNoOpt, invariantNoOpt, cexNoOpt) = m_interface->query(_query); if (resultNoOpt == CheckResult::SATISFIABLE) - cex = move(cexNoOpt); + cex = std::move(cexNoOpt); spacer->setSpacerOptions(true); } @@ -1817,7 +1817,7 @@ void CHC::checkAndReportTarget( predicates.insert(pred); map> invariants = collectInvariants(invariant, predicates, m_settings.invariants); for (auto pred: invariants | ranges::views::keys) - m_invariants[pred] += move(invariants.at(pred)); + m_invariants[pred] += std::move(invariants.at(pred)); } else if (result == CheckResult::SATISFIABLE) { diff --git a/libsolidity/formal/EncodingContext.cpp b/libsolidity/formal/EncodingContext.cpp index f9edd7db3..2000efd07 100644 --- a/libsolidity/formal/EncodingContext.cpp +++ b/libsolidity/formal/EncodingContext.cpp @@ -211,5 +211,5 @@ void EncodingContext::addAssertion(smtutil::Expression const& _expr) if (m_assertions.empty()) m_assertions.push_back(_expr); else - m_assertions.back() = _expr && move(m_assertions.back()); + m_assertions.back() = _expr && std::move(m_assertions.back()); } diff --git a/libsolidity/formal/EncodingContext.h b/libsolidity/formal/EncodingContext.h index 7c001f452..35e54ed76 100644 --- a/libsolidity/formal/EncodingContext.h +++ b/libsolidity/formal/EncodingContext.h @@ -63,7 +63,7 @@ public: smtutil::Expression newVariable(std::string _name, smtutil::SortPointer _sort) { solAssert(m_solver, ""); - return m_solver->newVariable(move(_name), move(_sort)); + return m_solver->newVariable(std::move(_name), std::move(_sort)); } struct IdCompare diff --git a/libsolidity/formal/Invariants.cpp b/libsolidity/formal/Invariants.cpp index 10d342ed4..9177a4d43 100644 --- a/libsolidity/formal/Invariants.cpp +++ b/libsolidity/formal/Invariants.cpp @@ -55,9 +55,9 @@ map> collectInvariants( auto arg0 = _expr->arguments.at(0); auto arg1 = _expr->arguments.at(1); if (starts_with(arg0.name, t)) - equalities.insert({arg0.name, {arg0, move(arg1)}}); + equalities.insert({arg0.name, {arg0, std::move(arg1)}}); else if (starts_with(arg1.name, t)) - equalities.insert({arg1.name, {arg1, move(arg0)}}); + equalities.insert({arg1.name, {arg1, std::move(arg0)}}); } for (auto const& arg: _expr->arguments) _addChild(&arg); diff --git a/libsolidity/formal/ModelChecker.cpp b/libsolidity/formal/ModelChecker.cpp index cf7a398ec..0d624f9e0 100644 --- a/libsolidity/formal/ModelChecker.cpp +++ b/libsolidity/formal/ModelChecker.cpp @@ -38,7 +38,7 @@ ModelChecker::ModelChecker( ReadCallback::Callback const& _smtCallback ): m_errorReporter(_errorReporter), - m_settings(move(_settings)), + m_settings(std::move(_settings)), m_context(), m_bmc(m_context, m_uniqueErrorReporter, _smtlib2Responses, _smtCallback, m_settings, _charStreamProvider), m_chc(m_context, m_uniqueErrorReporter, _smtlib2Responses, _smtCallback, m_settings, _charStreamProvider) diff --git a/libsolidity/formal/Predicate.cpp b/libsolidity/formal/Predicate.cpp index 91513a00c..d4b6994cf 100644 --- a/libsolidity/formal/Predicate.cpp +++ b/libsolidity/formal/Predicate.cpp @@ -50,13 +50,13 @@ Predicate const* Predicate::create( vector _scopeStack ) { - smt::SymbolicFunctionVariable predicate{_sort, move(_name), _context}; + smt::SymbolicFunctionVariable predicate{_sort, std::move(_name), _context}; string functorName = predicate.currentName(); solAssert(!m_predicates.count(functorName), ""); return &m_predicates.emplace( std::piecewise_construct, std::forward_as_tuple(functorName), - std::forward_as_tuple(move(predicate), _type, _node, _contractContext, move(_scopeStack)) + std::forward_as_tuple(std::move(predicate), _type, _node, _contractContext, std::move(_scopeStack)) ).first->second; } @@ -67,7 +67,7 @@ Predicate::Predicate( ContractDefinition const* _contractContext, vector _scopeStack ): - m_predicate(move(_predicate)), + m_predicate(std::move(_predicate)), m_type(_type), m_node(_node), m_contractContext(_contractContext), diff --git a/libsolidity/formal/SMTEncoder.cpp b/libsolidity/formal/SMTEncoder.cpp index 8c5dd647e..e779fbeb8 100644 --- a/libsolidity/formal/SMTEncoder.cpp +++ b/libsolidity/formal/SMTEncoder.cpp @@ -2977,7 +2977,7 @@ set const& SMTEncoder::contract resolvedFunctions.insert(baseFunction); } } - m_contractFunctions.emplace(&_contract, move(resolvedFunctions)); + m_contractFunctions.emplace(&_contract, std::move(resolvedFunctions)); } return m_contractFunctions.at(&_contract); } @@ -2991,7 +2991,7 @@ set const& SMTEncoder::contract for (auto const* baseFun: base->definedFunctions()) allFunctions.insert(baseFun); - m_contractFunctionsWithoutVirtual.emplace(&_contract, move(allFunctions)); + m_contractFunctionsWithoutVirtual.emplace(&_contract, std::move(allFunctions)); } return m_contractFunctionsWithoutVirtual.at(&_contract); diff --git a/libsolidity/formal/SymbolicState.cpp b/libsolidity/formal/SymbolicState.cpp index b1fd7978f..0679cee8a 100644 --- a/libsolidity/formal/SymbolicState.cpp +++ b/libsolidity/formal/SymbolicState.cpp @@ -32,8 +32,8 @@ BlockchainVariable::BlockchainVariable( map _members, EncodingContext& _context ): - m_name(move(_name)), - m_members(move(_members)), + m_name(std::move(_name)), + m_members(std::move(_members)), m_context(_context) { vector members; @@ -94,12 +94,12 @@ smtutil::Expression SymbolicState::balance() const smtutil::Expression SymbolicState::balance(smtutil::Expression _address) const { - return smtutil::Expression::select(balances(), move(_address)); + return smtutil::Expression::select(balances(), std::move(_address)); } smtutil::Expression SymbolicState::blockhash(smtutil::Expression _blockNumber) const { - return smtutil::Expression::select(m_tx.member("blockhash"), move(_blockNumber)); + return smtutil::Expression::select(m_tx.member("blockhash"), std::move(_blockNumber)); } void SymbolicState::newBalances() @@ -114,13 +114,13 @@ void SymbolicState::transfer(smtutil::Expression _from, smtutil::Expression _to, { unsigned indexBefore = m_state.index(); addBalance(_from, 0 - _value); - addBalance(_to, move(_value)); + addBalance(_to, std::move(_value)); unsigned indexAfter = m_state.index(); solAssert(indexAfter > indexBefore, ""); m_state.newVar(); /// Do not apply the transfer operation if _from == _to. auto newState = smtutil::Expression::ite( - move(_from) == move(_to), + std::move(_from) == std::move(_to), m_state.value(indexBefore), m_state.value(indexAfter) ); @@ -132,7 +132,7 @@ void SymbolicState::addBalance(smtutil::Expression _address, smtutil::Expression auto newBalances = smtutil::Expression::store( balances(), _address, - balance(_address) + move(_value) + balance(_address) + std::move(_value) ); m_state.assignMember("balances", newBalances); } @@ -322,7 +322,7 @@ void SymbolicState::buildABIFunctions(set const& _abiFuncti functions[name] = functionSort; } - m_abi = make_unique("abi", move(functions), m_context); + m_abi = make_unique("abi", std::move(functions), m_context); } smtutil::Expression SymbolicState::abiFunction(frontend::FunctionCall const* _funCall) diff --git a/libsolidity/formal/SymbolicVariables.cpp b/libsolidity/formal/SymbolicVariables.cpp index f0fa7df86..799ac4adb 100644 --- a/libsolidity/formal/SymbolicVariables.cpp +++ b/libsolidity/formal/SymbolicVariables.cpp @@ -38,7 +38,7 @@ SymbolicVariable::SymbolicVariable( ): m_type(_type), m_originalType(_originalType), - m_uniqueName(move(_uniqueName)), + m_uniqueName(std::move(_uniqueName)), m_context(_context), m_ssa(make_unique()) { @@ -52,8 +52,8 @@ SymbolicVariable::SymbolicVariable( string _uniqueName, EncodingContext& _context ): - m_sort(move(_sort)), - m_uniqueName(move(_uniqueName)), + m_sort(std::move(_sort)), + m_uniqueName(std::move(_uniqueName)), m_context(_context), m_ssa(make_unique()) { @@ -108,7 +108,7 @@ SymbolicBoolVariable::SymbolicBoolVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _type, move(_uniqueName), _context) + SymbolicVariable(_type, _type, std::move(_uniqueName), _context) { solAssert(m_type->category() == frontend::Type::Category::Bool, ""); } @@ -119,7 +119,7 @@ SymbolicIntVariable::SymbolicIntVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _originalType, move(_uniqueName), _context) + SymbolicVariable(_type, _originalType, std::move(_uniqueName), _context) { solAssert(isNumber(*m_type), ""); } @@ -128,7 +128,7 @@ SymbolicAddressVariable::SymbolicAddressVariable( string _uniqueName, EncodingContext& _context ): - SymbolicIntVariable(TypeProvider::uint(160), TypeProvider::uint(160), move(_uniqueName), _context) + SymbolicIntVariable(TypeProvider::uint(160), TypeProvider::uint(160), std::move(_uniqueName), _context) { } @@ -138,7 +138,7 @@ SymbolicFixedBytesVariable::SymbolicFixedBytesVariable( string _uniqueName, EncodingContext& _context ): - SymbolicIntVariable(TypeProvider::uint(_numBytes * 8), _originalType, move(_uniqueName), _context) + SymbolicIntVariable(TypeProvider::uint(_numBytes * 8), _originalType, std::move(_uniqueName), _context) { } @@ -147,7 +147,7 @@ SymbolicFunctionVariable::SymbolicFunctionVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _type, move(_uniqueName), _context), + SymbolicVariable(_type, _type, std::move(_uniqueName), _context), m_declaration(m_context.newVariable(currentName(), m_sort)) { solAssert(m_type->category() == frontend::Type::Category::Function, ""); @@ -158,7 +158,7 @@ SymbolicFunctionVariable::SymbolicFunctionVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(move(_sort), move(_uniqueName), _context), + SymbolicVariable(std::move(_sort), std::move(_uniqueName), _context), m_declaration(m_context.newVariable(currentName(), m_sort)) { solAssert(m_sort->kind == Kind::Function, ""); @@ -219,7 +219,7 @@ SymbolicEnumVariable::SymbolicEnumVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _type, move(_uniqueName), _context) + SymbolicVariable(_type, _type, std::move(_uniqueName), _context) { solAssert(isEnum(*m_type), ""); } @@ -229,7 +229,7 @@ SymbolicTupleVariable::SymbolicTupleVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _type, move(_uniqueName), _context) + SymbolicVariable(_type, _type, std::move(_uniqueName), _context) { solAssert(isTuple(*m_type), ""); } @@ -239,7 +239,7 @@ SymbolicTupleVariable::SymbolicTupleVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(move(_sort), move(_uniqueName), _context) + SymbolicVariable(std::move(_sort), std::move(_uniqueName), _context) { solAssert(m_sort->kind == Kind::Tuple, ""); } @@ -288,7 +288,7 @@ SymbolicArrayVariable::SymbolicArrayVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _originalType, move(_uniqueName), _context), + SymbolicVariable(_type, _originalType, std::move(_uniqueName), _context), m_pair( smtSort(*_type), m_uniqueName + "_length_pair", @@ -303,7 +303,7 @@ SymbolicArrayVariable::SymbolicArrayVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(move(_sort), move(_uniqueName), _context), + SymbolicVariable(std::move(_sort), std::move(_uniqueName), _context), m_pair( std::make_shared( "array_length_pair", @@ -346,7 +346,7 @@ SymbolicStructVariable::SymbolicStructVariable( string _uniqueName, EncodingContext& _context ): - SymbolicVariable(_type, _type, move(_uniqueName), _context) + SymbolicVariable(_type, _type, std::move(_uniqueName), _context) { solAssert(isNonRecursiveStruct(*m_type), ""); auto const* structType = dynamic_cast(_type); diff --git a/libsolidity/interface/ABI.cpp b/libsolidity/interface/ABI.cpp index eab1801c6..cbfa36122 100644 --- a/libsolidity/interface/ABI.cpp +++ b/libsolidity/interface/ABI.cpp @@ -134,7 +134,7 @@ Json::Value ABI::generate(ContractDefinition const& _contractDef) formatType(p->name(), *type, *p->annotation().type, false) ); } - abi.emplace(move(errorJson)); + abi.emplace(std::move(errorJson)); } Json::Value abiJson{Json::arrayValue}; diff --git a/libsolidity/interface/CompilerStack.cpp b/libsolidity/interface/CompilerStack.cpp index c53bf9321..702d5a0d2 100644 --- a/libsolidity/interface/CompilerStack.cpp +++ b/libsolidity/interface/CompilerStack.cpp @@ -208,7 +208,7 @@ void CompilerStack::setRemappings(vector _remappings) solThrow(CompilerError, "Must set remappings before parsing."); for (auto const& remapping: _remappings) solAssert(!remapping.prefix.empty(), ""); - m_importRemapper.setRemappings(move(_remappings)); + m_importRemapper.setRemappings(std::move(_remappings)); } void CompilerStack::setViaIR(bool _viaIR) @@ -407,7 +407,7 @@ void CompilerStack::importASTs(map const& _sources) src.first, true // imported from AST ); - m_sources[path] = move(source); + m_sources[path] = std::move(source); } m_stackState = ParsedAndImported; m_importedSources = true; @@ -793,7 +793,7 @@ Json::Value CompilerStack::generatedSources(string const& _contractName, bool _r sources[0]["name"] = sourceName; sources[0]["id"] = sourceIndex; sources[0]["language"] = "Yul"; - sources[0]["contents"] = move(source); + sources[0]["contents"] = std::move(source); } } diff --git a/libsolidity/interface/ImportRemapper.cpp b/libsolidity/interface/ImportRemapper.cpp index 9d5561013..4d4fa42d4 100644 --- a/libsolidity/interface/ImportRemapper.cpp +++ b/libsolidity/interface/ImportRemapper.cpp @@ -35,7 +35,7 @@ void ImportRemapper::setRemappings(vector _remappings) { for (auto const& remapping: _remappings) solAssert(!remapping.prefix.empty(), ""); - m_remappings = move(_remappings); + m_remappings = std::move(_remappings); } SourceUnitName ImportRemapper::apply(ImportPath const& _path, string const& _context) const diff --git a/libsolidity/interface/Natspec.cpp b/libsolidity/interface/Natspec.cpp index 449690493..566b67607 100644 --- a/libsolidity/interface/Natspec.cpp +++ b/libsolidity/interface/Natspec.cpp @@ -92,7 +92,7 @@ Json::Value Natspec::userDocumentation(ContractDefinition const& _contractDef) { Json::Value errorDoc{Json::objectValue}; errorDoc["notice"] = value; - doc["errors"][error->functionType(true)->externalSignature()].append(move(errorDoc)); + doc["errors"][error->functionType(true)->externalSignature()].append(std::move(errorDoc)); } } @@ -140,10 +140,10 @@ Json::Value Natspec::devDocumentation(ContractDefinition const& _contractDef) ); if (!jsonReturn.empty()) - method["returns"] = move(jsonReturn); + method["returns"] = std::move(jsonReturn); if (!method.empty()) - doc["methods"][it.second->externalSignature()] = move(method); + doc["methods"][it.second->externalSignature()] = std::move(method); } } @@ -230,7 +230,7 @@ Json::Value Natspec::extractCustomDoc(multimap const& _tags) return Json::nullValue; Json::Value result{Json::objectValue}; for (auto& [tag, value]: concatenated) - result[tag] = move(value); + result[tag] = std::move(value); return result; } diff --git a/libsolidity/interface/StandardCompiler.cpp b/libsolidity/interface/StandardCompiler.cpp index 24bcddba9..c6cd741c1 100644 --- a/libsolidity/interface/StandardCompiler.cpp +++ b/libsolidity/interface/StandardCompiler.cpp @@ -403,7 +403,7 @@ Json::Value collectEVMObject( if (_runtimeObject && _artifactRequested("immutableReferences")) output["immutableReferences"] = formatImmutableReferences(_object.immutableReferences); if (_artifactRequested("generatedSources")) - output["generatedSources"] = move(_generatedSources); + output["generatedSources"] = std::move(_generatedSources); return output; } @@ -966,7 +966,7 @@ std::variant StandardCompiler: if (sourceContracts[source].empty()) return formatFatalError("JSONError", "Source contracts must be a non-empty array."); } - ret.modelCheckerSettings.contracts = {move(sourceContracts)}; + ret.modelCheckerSettings.contracts = {std::move(sourceContracts)}; } if (modelCheckerSettings.isMember("divModNoSlacks")) @@ -1076,7 +1076,7 @@ Json::Value StandardCompiler::compileSolidity(StandardCompiler::InputsAndSetting compilerStack.setViaIR(_inputsAndSettings.viaIR); compilerStack.setEVMVersion(_inputsAndSettings.evmVersion); compilerStack.setParserErrorRecovery(_inputsAndSettings.parserErrorRecovery); - compilerStack.setRemappings(move(_inputsAndSettings.remappings)); + compilerStack.setRemappings(std::move(_inputsAndSettings.remappings)); compilerStack.setOptimiserSettings(std::move(_inputsAndSettings.optimiserSettings)); compilerStack.setRevertStringBehaviour(_inputsAndSettings.revertStrings); if (_inputsAndSettings.debugInfoSelection.has_value()) @@ -1582,7 +1582,7 @@ Json::Value StandardCompiler::formatFunctionDebugData( fun["entryPoint"] = Json::nullValue; fun["parameterSlots"] = Json::UInt64(info.params); fun["returnSlots"] = Json::UInt64(info.returns); - ret[name] = move(fun); + ret[name] = std::move(fun); } return ret; diff --git a/libsolidity/interface/StorageLayout.cpp b/libsolidity/interface/StorageLayout.cpp index 74d7ccf4b..76c840db5 100644 --- a/libsolidity/interface/StorageLayout.cpp +++ b/libsolidity/interface/StorageLayout.cpp @@ -40,8 +40,8 @@ Json::Value StorageLayout::generate(ContractDefinition const& _contractDef) variables.append(generate(*var, slot, offset)); Json::Value layout; - layout["storage"] = move(variables); - layout["types"] = move(m_types); + layout["storage"] = std::move(variables); + layout["types"] = std::move(m_types); return layout; } @@ -81,7 +81,7 @@ void StorageLayout::generate(Type const* _type) auto const& offsets = structType->storageOffsetsOfMember(member->name()); members.append(generate(*member, offsets.first, offsets.second)); } - typeInfo["members"] = move(members); + typeInfo["members"] = std::move(members); typeInfo["encoding"] = "inplace"; } else if (auto mappingType = dynamic_cast(_type)) diff --git a/libsolidity/lsp/FileRepository.cpp b/libsolidity/lsp/FileRepository.cpp index 58bc0bf8d..4e8ebbb12 100644 --- a/libsolidity/lsp/FileRepository.cpp +++ b/libsolidity/lsp/FileRepository.cpp @@ -62,7 +62,7 @@ string FileRepository::sourceUnitNameToUri(string const& _sourceUnitName) const if (!regex_search(inputPath, windowsDriveLetterPath)) return inputPath; else - return "/" + move(inputPath); + return "/" + std::move(inputPath); }; if (m_sourceUnitNamesToUri.count(_sourceUnitName)) @@ -124,7 +124,7 @@ Result FileRepository::tryResolvePath(std::string const boost::filesystem::path canonicalPath = boost::filesystem::path(prefix) / boost::filesystem::path(_strippedSourceUnitName); if (boost::filesystem::exists(canonicalPath)) - candidates.push_back(move(canonicalPath)); + candidates.push_back(std::move(canonicalPath)); } if (candidates.empty()) @@ -169,7 +169,7 @@ frontend::ReadCallback::Result FileRepository::readFile(string const& _kind, str auto contents = readFileAsString(resolvedPath.get()); solAssert(m_sourceCodes.count(_sourceUnitName) == 0, ""); m_sourceCodes[_sourceUnitName] = contents; - return ReadCallback::Result{true, move(contents)}; + return ReadCallback::Result{true, std::move(contents)}; } catch (std::exception const& _exception) { diff --git a/libsolidity/lsp/GotoDefinition.cpp b/libsolidity/lsp/GotoDefinition.cpp index 26fb686db..532792c17 100644 --- a/libsolidity/lsp/GotoDefinition.cpp +++ b/libsolidity/lsp/GotoDefinition.cpp @@ -44,13 +44,13 @@ void GotoDefinition::operator()(MessageID _id, Json::Value const& _args) // Handles all expressions that can have one or more declaration annotation. if (auto const* declaration = referencedDeclaration(expression)) if (auto location = declarationLocation(declaration)) - locations.emplace_back(move(location.value())); + locations.emplace_back(std::move(location.value())); } else if (auto const* identifierPath = dynamic_cast(sourceNode)) { if (auto const* declaration = identifierPath->annotation().referencedDeclaration) if (auto location = declarationLocation(declaration)) - locations.emplace_back(move(location.value())); + locations.emplace_back(std::move(location.value())); } else if (auto const* importDirective = dynamic_cast(sourceNode)) { diff --git a/libsolidity/lsp/LanguageServer.cpp b/libsolidity/lsp/LanguageServer.cpp index 65eeaf3d5..ce68dbef3 100644 --- a/libsolidity/lsp/LanguageServer.cpp +++ b/libsolidity/lsp/LanguageServer.cpp @@ -202,7 +202,7 @@ void LanguageServer::changeConfiguration(Json::Value const& _settings) else typeFailureCount++; } - m_fileRepository.setIncludePaths(move(includePaths)); + m_fileRepository.setIncludePaths(std::move(includePaths)); } else ++typeFailureCount; @@ -289,7 +289,7 @@ void LanguageServer::compileAndUpdateDiagnostics() string message = error->typeName() + ":"; if (string const* comment = error->comment()) message += " " + *comment; - jsonDiag["message"] = move(message); + jsonDiag["message"] = std::move(message); jsonDiag["range"] = toRange(*location); if (auto const* secondary = error->secondarySourceLocation()) @@ -318,8 +318,8 @@ void LanguageServer::compileAndUpdateDiagnostics() params["uri"] = m_fileRepository.sourceUnitNameToUri(sourceUnitName); if (!diagnostics.empty()) m_nonemptyDiagnostics.insert(sourceUnitName); - params["diagnostics"] = move(diagnostics); - m_client.notify("textDocument/publishDiagnostics", move(params)); + params["diagnostics"] = std::move(diagnostics); + m_client.notify("textDocument/publishDiagnostics", std::move(params)); } } @@ -418,7 +418,7 @@ void LanguageServer::handleInitialize(MessageID _id, Json::Value const& _args) replyArgs["capabilities"]["semanticTokensProvider"]["full"] = true; // XOR requests.full.delta = true replyArgs["capabilities"]["renameProvider"] = true; - m_client.reply(_id, move(replyArgs)); + m_client.reply(_id, std::move(replyArgs)); } void LanguageServer::handleInitialized(MessageID, Json::Value const&) @@ -480,7 +480,7 @@ void LanguageServer::handleTextDocumentDidOpen(Json::Value const& _args) string text = _args["textDocument"]["text"].asString(); string uri = _args["textDocument"]["uri"].asString(); m_openFiles.insert(uri); - m_fileRepository.setSourceByUri(uri, move(text)); + m_fileRepository.setSourceByUri(uri, std::move(text)); compileAndUpdateDiagnostics(); } @@ -516,10 +516,10 @@ void LanguageServer::handleTextDocumentDidChange(Json::Value const& _args) ); string buffer = m_fileRepository.sourceUnits().at(sourceUnitName); - buffer.replace(static_cast(change->start), static_cast(change->end - change->start), move(text)); - text = move(buffer); + buffer.replace(static_cast(change->start), static_cast(change->end - change->start), std::move(text)); + text = std::move(buffer); } - m_fileRepository.setSourceByUri(uri, move(text)); + m_fileRepository.setSourceByUri(uri, std::move(text)); } compileAndUpdateDiagnostics(); diff --git a/libsolidity/lsp/Transport.cpp b/libsolidity/lsp/Transport.cpp index 90c0b20a7..5af723128 100644 --- a/libsolidity/lsp/Transport.cpp +++ b/libsolidity/lsp/Transport.cpp @@ -67,7 +67,7 @@ optional Transport::receive() return nullopt; } - return {move(jsonMessage)}; + return {std::move(jsonMessage)}; } void Transport::trace(std::string _message, Json::Value _extra) @@ -76,9 +76,9 @@ void Transport::trace(std::string _message, Json::Value _extra) { Json::Value params; if (_extra.isObject()) - params = move(_extra); - params["message"] = move(_message); - notify("$/logTrace", move(params)); + params = std::move(_extra); + params["message"] = std::move(_message); + notify("$/logTrace", std::move(params)); } } @@ -101,30 +101,30 @@ optional> Transport::parseHeaders() if (!headers.emplace(boost::trim_copy(name), boost::trim_copy(value)).second) return nullopt; } - return {move(headers)}; + return {std::move(headers)}; } void Transport::notify(string _method, Json::Value _message) { Json::Value json; - json["method"] = move(_method); - json["params"] = move(_message); - send(move(json)); + json["method"] = std::move(_method); + json["params"] = std::move(_message); + send(std::move(json)); } void Transport::reply(MessageID _id, Json::Value _message) { Json::Value json; - json["result"] = move(_message); - send(move(json), _id); + json["result"] = std::move(_message); + send(std::move(json), _id); } void Transport::error(MessageID _id, ErrorCode _code, string _message) { Json::Value json; json["error"]["code"] = static_cast(_code); - json["error"]["message"] = move(_message); - send(move(json), _id); + json["error"]["message"] = std::move(_message); + send(std::move(json), _id); } void Transport::send(Json::Value _json, MessageID _id) diff --git a/libsolidity/parsing/DocStringParser.cpp b/libsolidity/parsing/DocStringParser.cpp index 5c07950ed..7e6e158b7 100644 --- a/libsolidity/parsing/DocStringParser.cpp +++ b/libsolidity/parsing/DocStringParser.cpp @@ -116,7 +116,7 @@ multimap DocStringParser::parse() currPos = nlPos + 1; } } - return move(m_docTags); + return std::move(m_docTags); } DocStringParser::iter DocStringParser::parseDocTagLine(iter _pos, iter _end, bool _appending) diff --git a/libsolidity/parsing/Parser.cpp b/libsolidity/parsing/Parser.cpp index 9ccb1aca3..afa70609d 100644 --- a/libsolidity/parsing/Parser.cpp +++ b/libsolidity/parsing/Parser.cpp @@ -274,7 +274,7 @@ ASTPointer Parser::parseImportDirective() expectToken(Token::As); tie(alias, aliasLocation) = expectIdentifierWithLocation(); } - symbolAliases.emplace_back(ImportDirective::SymbolAlias{move(id), move(alias), aliasLocation}); + symbolAliases.emplace_back(ImportDirective::SymbolAlias{std::move(id), std::move(alias), aliasLocation}); if (m_scanner->currentToken() != Token::Comma) break; advance(); @@ -302,7 +302,7 @@ ASTPointer Parser::parseImportDirective() fatalParserError(6326_error, "Import path cannot be empty."); nodeFactory.markEndPosition(); expectToken(Token::Semicolon); - return nodeFactory.createNode(path, unitAlias, unitAliasLocation, move(symbolAliases)); + return nodeFactory.createNode(path, unitAlias, unitAliasLocation, std::move(symbolAliases)); } std::pair Parser::parseContractKind() @@ -496,7 +496,7 @@ ASTPointer Parser::parseOverrideSpecifier() expectToken(Token::RParen); } - return nodeFactory.createNode(move(overrides)); + return nodeFactory.createNode(std::move(overrides)); } StateMutability Parser::parseStateMutability() @@ -686,7 +686,7 @@ ASTPointer Parser::parseStructDefinition() } nodeFactory.markEndPosition(); expectToken(Token::RBrace); - return nodeFactory.createNode(move(name), move(nameLocation), move(members)); + return nodeFactory.createNode(std::move(name), std::move(nameLocation), std::move(members)); } ASTPointer Parser::parseEnumValue() @@ -918,7 +918,7 @@ pair, SourceLocation> Parser::expectIdentifierWithLocation SourceLocation nameLocation = currentLocation(); ASTPointer name = expectIdentifierToken(); - return {move(name), move(nameLocation)}; + return {std::move(name), std::move(nameLocation)}; } ASTPointer Parser::parseEventDefinition() @@ -957,7 +957,7 @@ ASTPointer Parser::parseErrorDefinition() ASTPointer parameters = parseParameterList({}); nodeFactory.markEndPosition(); expectToken(Token::Semicolon); - return nodeFactory.createNode(name, move(nameLocation), documentation, parameters); + return nodeFactory.createNode(name, std::move(nameLocation), documentation, parameters); } ASTPointer Parser::parseUsingDirective() @@ -996,7 +996,7 @@ ASTPointer Parser::parseUsingDirective() } nodeFactory.markEndPosition(); expectToken(Token::Semicolon); - return nodeFactory.createNode(move(functions), usesBraces, typeName, global); + return nodeFactory.createNode(std::move(functions), usesBraces, typeName, global); } ASTPointer Parser::parseModifierInvocation() @@ -1014,7 +1014,7 @@ ASTPointer Parser::parseModifierInvocation() } else nodeFactory.setEndPositionFromNode(name); - return nodeFactory.createNode(name, move(arguments)); + return nodeFactory.createNode(name, std::move(arguments)); } ASTPointer Parser::parseIdentifier() @@ -1052,7 +1052,7 @@ ASTPointer Parser::parseUserDefinedValueTypeDefi expectToken(Token::Semicolon); return nodeFactory.createNode( name, - move(nameLocation), + std::move(nameLocation), typeName ); } @@ -1377,7 +1377,7 @@ ASTPointer Parser::parseInlineAssembly(ASTPointer con BOOST_THROW_EXCEPTION(FatalError()); location.end = nativeLocationOf(*block).end; - return make_shared(nextID(), location, _docString, dialect, move(flags), block); + return make_shared(nextID(), location, _docString, dialect, std::move(flags), block); } ASTPointer Parser::parseIfStatement(ASTPointer const& _docString) @@ -1710,9 +1710,9 @@ pair Parser::tryParseIndexAcce IndexAccessedPath iap = parseIndexAccessedPath(); if (m_scanner->currentToken() == Token::Identifier || TokenTraits::isLocationSpecifier(m_scanner->currentToken())) - return make_pair(LookAheadInfo::VariableDeclaration, move(iap)); + return make_pair(LookAheadInfo::VariableDeclaration, std::move(iap)); else - return make_pair(LookAheadInfo::Expression, move(iap)); + return make_pair(LookAheadInfo::Expression, std::move(iap)); } ASTPointer Parser::parseVariableDeclarationStatement( diff --git a/libsolutil/Whiskers.cpp b/libsolutil/Whiskers.cpp index 340527bdd..043f2dd76 100644 --- a/libsolutil/Whiskers.cpp +++ b/libsolutil/Whiskers.cpp @@ -32,7 +32,7 @@ using namespace std; using namespace solidity::util; Whiskers::Whiskers(string _template): - m_template(move(_template)) + m_template(std::move(_template)) { } @@ -41,7 +41,7 @@ Whiskers& Whiskers::operator()(string _parameter, string _value) checkParameterValid(_parameter); checkParameterUnknown(_parameter); checkTemplateContainsTags(_parameter, {""}); - m_parameters[move(_parameter)] = move(_value); + m_parameters[std::move(_parameter)] = std::move(_value); return *this; } @@ -50,7 +50,7 @@ Whiskers& Whiskers::operator()(string _parameter, bool _value) checkParameterValid(_parameter); checkParameterUnknown(_parameter); checkTemplateContainsTags(_parameter, {"?", "/"}); - m_conditions[move(_parameter)] = _value; + m_conditions[std::move(_parameter)] = _value; return *this; } @@ -65,7 +65,7 @@ Whiskers& Whiskers::operator()( for (auto const& element: _values) for (auto const& val: element) checkParameterValid(val.first); - m_listParameters[move(_listParameter)] = move(_values); + m_listParameters[std::move(_listParameter)] = std::move(_values); return *this; } diff --git a/libyul/AsmParser.cpp b/libyul/AsmParser.cpp index ba4bf1115..8043c758a 100644 --- a/libyul/AsmParser.cpp +++ b/libyul/AsmParser.cpp @@ -88,7 +88,7 @@ void Parser::updateLocationEndFrom( DebugData updatedDebugData = *_debugData; updatedDebugData.nativeLocation.end = _location.end; updatedDebugData.originLocation.end = _location.end; - _debugData = make_shared(move(updatedDebugData)); + _debugData = make_shared(std::move(updatedDebugData)); break; } case UseSourceLocationFrom::LocationOverride: @@ -98,7 +98,7 @@ void Parser::updateLocationEndFrom( { DebugData updatedDebugData = *_debugData; updatedDebugData.nativeLocation.end = _location.end; - _debugData = make_shared(move(updatedDebugData)); + _debugData = make_shared(std::move(updatedDebugData)); break; } } @@ -246,7 +246,7 @@ optional> Parser::parseSrcComment( { shared_ptr sourceName = m_sourceNames->at(static_cast(sourceIndex.value())); solAssert(sourceName, ""); - return {{tail, SourceLocation{start.value(), end.value(), move(sourceName)}}}; + return {{tail, SourceLocation{start.value(), end.value(), std::move(sourceName)}}}; } return {{tail, SourceLocation{}}}; } @@ -313,7 +313,7 @@ Statement Parser::parseStatement() _if.condition = make_unique(parseExpression()); _if.body = parseBlock(); updateLocationEndFrom(_if.debugData, nativeLocationOf(_if.body)); - return Statement{move(_if)}; + return Statement{std::move(_if)}; } case Token::Switch: { @@ -331,7 +331,7 @@ Statement Parser::parseStatement() if (_switch.cases.empty()) fatalParserError(2418_error, "Switch statement without any cases."); updateLocationEndFrom(_switch.debugData, nativeLocationOf(_switch.cases.back().body)); - return Statement{move(_switch)}; + return Statement{std::move(_switch)}; } case Token::For: return parseForLoop(); @@ -371,7 +371,7 @@ Statement Parser::parseStatement() case Token::LParen: { Expression expr = parseCall(std::move(elementary)); - return ExpressionStatement{debugDataOf(expr), move(expr)}; + return ExpressionStatement{debugDataOf(expr), std::move(expr)}; } case Token::Comma: case Token::AssemblyAssign: @@ -414,7 +414,7 @@ Statement Parser::parseStatement() assignment.value = make_unique(parseExpression()); updateLocationEndFrom(assignment.debugData, nativeLocationOf(*assignment.value)); - return Statement{move(assignment)}; + return Statement{std::move(assignment)}; } default: fatalParserError(6913_error, "Call or assignment expected."); @@ -485,11 +485,11 @@ Expression Parser::parseExpression() nativeLocationOf(_identifier), "Builtin function \"" + _identifier.name.str() + "\" must be called." ); - return move(_identifier); + return std::move(_identifier); }, [&](Literal& _literal) -> Expression { - return move(_literal); + return std::move(_literal); } }, operation); } diff --git a/libyul/AsmPrinter.cpp b/libyul/AsmPrinter.cpp index fb0fa565e..54733cc43 100644 --- a/libyul/AsmPrinter.cpp +++ b/libyul/AsmPrinter.cpp @@ -197,7 +197,7 @@ string AsmPrinter::operator()(ForLoop const& _forLoop) delim = ' '; return locationComment + - ("for " + move(pre) + delim + move(condition) + delim + move(post) + "\n") + + ("for " + std::move(pre) + delim + std::move(condition) + delim + std::move(post) + "\n") + (*this)(_forLoop.body); } diff --git a/libyul/ControlFlowSideEffectsCollector.cpp b/libyul/ControlFlowSideEffectsCollector.cpp index 6e96712a0..19eb8275d 100644 --- a/libyul/ControlFlowSideEffectsCollector.cpp +++ b/libyul/ControlFlowSideEffectsCollector.cpp @@ -92,7 +92,7 @@ void ControlFlowBuilder::operator()(FunctionDefinition const& _function) m_currentNode->successors.emplace_back(flow.exit); - m_functionFlows[&_function] = move(flow); + m_functionFlows[&_function] = std::move(flow); m_leave = nullptr; } diff --git a/libyul/ObjectParser.cpp b/libyul/ObjectParser.cpp index afd4b7d94..1a2d8b33a 100644 --- a/libyul/ObjectParser.cpp +++ b/libyul/ObjectParser.cpp @@ -88,7 +88,7 @@ shared_ptr ObjectParser::parseObject(Object* _containingObject) expectToken(Token::LBrace); - ret->code = parseCode(move(sourceNameMapping)); + ret->code = parseCode(std::move(sourceNameMapping)); while (currentToken() != Token::RBrace) { @@ -113,7 +113,7 @@ shared_ptr ObjectParser::parseCode(optional _sourceNames) fatalParserError(4846_error, "Expected keyword \"code\"."); advance(); - return parseBlock(move(_sourceNames)); + return parseBlock(std::move(_sourceNames)); } optional ObjectParser::tryParseSourceNameMapping() const @@ -156,7 +156,7 @@ optional ObjectParser::tryParseSourceNameMapping() const Token const next = scanner.next(); if (next == Token::EOS) - return {move(sourceNames)}; + return {std::move(sourceNames)}; if (next != Token::Comma) break; scanner.next(); @@ -172,7 +172,7 @@ optional ObjectParser::tryParseSourceNameMapping() const shared_ptr ObjectParser::parseBlock(optional _sourceNames) { - Parser parser(m_errorReporter, m_dialect, move(_sourceNames)); + Parser parser(m_errorReporter, m_dialect, std::move(_sourceNames)); shared_ptr block = parser.parseInline(m_scanner); yulAssert(block || m_errorReporter.hasErrors(), "Invalid block but no error!"); return block; diff --git a/libyul/backends/evm/ConstantOptimiser.cpp b/libyul/backends/evm/ConstantOptimiser.cpp index aecd00bf4..59e987b69 100644 --- a/libyul/backends/evm/ConstantOptimiser.cpp +++ b/libyul/backends/evm/ConstantOptimiser.cpp @@ -130,7 +130,7 @@ Representation const& RepresentationFinder::findRepresentation(u256 const& _valu if (numberEncodingSize(~_value) < numberEncodingSize(_value)) // Negated is shorter to represent - routine = min(move(routine), represent("not"_yulstring, findRepresentation(~_value))); + routine = min(std::move(routine), represent("not"_yulstring, findRepresentation(~_value))); // Decompose value into a * 2**k + b where abs(b) << 2**k for (unsigned bits = 255; bits > 8 && m_maxSteps > 0; --bits) @@ -171,10 +171,10 @@ Representation const& RepresentationFinder::findRepresentation(u256 const& _valu if (m_maxSteps > 0) m_maxSteps--; - routine = min(move(routine), move(newRoutine)); + routine = min(std::move(routine), std::move(newRoutine)); } yulAssert(MiniEVMInterpreter{m_dialect}.eval(*routine.expression) == _value, "Invalid expression generated."); - return m_cache[_value] = move(routine); + return m_cache[_value] = std::move(routine); } Representation RepresentationFinder::represent(u256 const& _value) const diff --git a/libyul/backends/evm/ControlFlowGraph.h b/libyul/backends/evm/ControlFlowGraph.h index 8ca2076a0..b267b8461 100644 --- a/libyul/backends/evm/ControlFlowGraph.h +++ b/libyul/backends/evm/ControlFlowGraph.h @@ -236,7 +236,7 @@ struct CFG BasicBlock& makeBlock(std::shared_ptr _debugData) { - return blocks.emplace_back(BasicBlock{move(_debugData), {}, {}}); + return blocks.emplace_back(BasicBlock{std::move(_debugData), {}, {}}); } }; diff --git a/libyul/backends/evm/ControlFlowGraphBuilder.cpp b/libyul/backends/evm/ControlFlowGraphBuilder.cpp index 855d96fbd..1980fb442 100644 --- a/libyul/backends/evm/ControlFlowGraphBuilder.cpp +++ b/libyul/backends/evm/ControlFlowGraphBuilder.cpp @@ -532,7 +532,7 @@ Stack const& ControlFlowGraphBuilder::visitFunctionCall(FunctionCall const& _cal return TemporarySlot{_call, _i}; }) | ranges::to, // operation - move(builtinCall) + std::move(builtinCall) }).output; } else @@ -607,8 +607,8 @@ void ControlFlowGraphBuilder::makeConditionalJump( { yulAssert(m_currentBlock, ""); m_currentBlock->exit = CFG::BasicBlock::ConditionalJump{ - move(_debugData), - move(_condition), + std::move(_debugData), + std::move(_condition), &_nonZero, &_zero }; @@ -624,7 +624,7 @@ void ControlFlowGraphBuilder::jump( ) { yulAssert(m_currentBlock, ""); - m_currentBlock->exit = CFG::BasicBlock::Jump{move(_debugData), &_target, backwards}; + m_currentBlock->exit = CFG::BasicBlock::Jump{std::move(_debugData), &_target, backwards}; _target.entries.emplace_back(m_currentBlock); m_currentBlock = &_target; } diff --git a/libyul/backends/evm/EVMCodeTransform.cpp b/libyul/backends/evm/EVMCodeTransform.cpp index ce5578274..7c9bf05cf 100644 --- a/libyul/backends/evm/EVMCodeTransform.cpp +++ b/libyul/backends/evm/EVMCodeTransform.cpp @@ -64,9 +64,9 @@ CodeTransform::CodeTransform( m_builtinContext(_builtinContext), m_allowStackOpt(_allowStackOpt), m_useNamedLabelsForFunctions(_useNamedLabelsForFunctions), - m_identifierAccessCodeGen(move(_identifierAccessCodeGen)), - m_context(move(_context)), - m_delayedReturnVariables(move(_delayedReturnVariables)), + m_identifierAccessCodeGen(std::move(_identifierAccessCodeGen)), + m_context(std::move(_context)), + m_delayedReturnVariables(std::move(_delayedReturnVariables)), m_functionExitLabel(_functionExitLabel) { if (!m_context) @@ -406,11 +406,11 @@ void CodeTransform::operator()(FunctionDefinition const& _function) if (!m_allowStackOpt) subTransform.setupReturnVariablesAndFunctionExit(); - subTransform.m_assignedNamedLabels = move(m_assignedNamedLabels); + subTransform.m_assignedNamedLabels = std::move(m_assignedNamedLabels); subTransform(_function.body); - m_assignedNamedLabels = move(subTransform.m_assignedNamedLabels); + m_assignedNamedLabels = std::move(subTransform.m_assignedNamedLabels); m_assembly.setSourceLocation(originLocationOf(_function)); if (!subTransform.m_stackErrors.empty()) diff --git a/libyul/backends/evm/EVMDialect.cpp b/libyul/backends/evm/EVMDialect.cpp index c86be6f69..0f5c307e3 100644 --- a/libyul/backends/evm/EVMDialect.cpp +++ b/libyul/backends/evm/EVMDialect.cpp @@ -383,7 +383,7 @@ BuiltinFunctionForEVM const* EVMDialect::verbatimFunction(size_t _arguments, siz } ).second; builtinFunction.isMSize = true; - function = make_shared(move(builtinFunction)); + function = make_shared(std::move(builtinFunction)); } return function.get(); } diff --git a/libyul/backends/evm/EthAssemblyAdapter.cpp b/libyul/backends/evm/EthAssemblyAdapter.cpp index 5d7b4cbf4..685f56cbc 100644 --- a/libyul/backends/evm/EthAssemblyAdapter.cpp +++ b/libyul/backends/evm/EthAssemblyAdapter.cpp @@ -96,7 +96,7 @@ void EthAssemblyAdapter::appendLinkerSymbol(std::string const& _linkerSymbol) void EthAssemblyAdapter::appendVerbatim(bytes _data, size_t _arguments, size_t _returnVariables) { - m_assembly.appendVerbatim(move(_data), _arguments, _returnVariables); + m_assembly.appendVerbatim(std::move(_data), _arguments, _returnVariables); } void EthAssemblyAdapter::appendJump(int _stackDiffAfter, JumpType _jumpType) diff --git a/libyul/backends/evm/OptimizedEVMCodeTransform.cpp b/libyul/backends/evm/OptimizedEVMCodeTransform.cpp index 08987b565..db73ba2a7 100644 --- a/libyul/backends/evm/OptimizedEVMCodeTransform.cpp +++ b/libyul/backends/evm/OptimizedEVMCodeTransform.cpp @@ -61,7 +61,7 @@ vector OptimizedEVMCodeTransform::run( optimizedCodeTransform(*dfg->entry); for (Scope::Function const* function: dfg->functions) optimizedCodeTransform(dfg->functionInfo.at(function)); - return move(optimizedCodeTransform.m_stackErrors); + return std::move(optimizedCodeTransform.m_stackErrors); } void OptimizedEVMCodeTransform::operator()(CFG::FunctionCall const& _call) @@ -459,7 +459,7 @@ void OptimizedEVMCodeTransform::operator()(CFG::BasicBlock const& _block) { // Restore the stack afterwards for the non-zero case below. ScopeGuard stackRestore([storedStack = m_stack, this]() { - m_stack = move(storedStack); + m_stack = std::move(storedStack); m_assembly.setStackHeight(static_cast(m_stack.size())); }); diff --git a/libyul/backends/evm/StackLayoutGenerator.cpp b/libyul/backends/evm/StackLayoutGenerator.cpp index 4f9a1e2a1..8b39b364f 100644 --- a/libyul/backends/evm/StackLayoutGenerator.cpp +++ b/libyul/backends/evm/StackLayoutGenerator.cpp @@ -65,7 +65,7 @@ map> StackLayoutGenerator: stackTooDeepErrors[YulString{}] = reportStackTooDeep(_cfg, YulString{}); for (auto const& function: _cfg.functions) if (auto errors = reportStackTooDeep(_cfg, function->name); !errors.empty()) - stackTooDeepErrors[function->name] = move(errors); + stackTooDeepErrors[function->name] = std::move(errors); return stackTooDeepErrors; } @@ -324,8 +324,8 @@ Stack StackLayoutGenerator::propagateStackThroughBlock(Stack _exitStack, CFG::Ba Stack newStack = propagateStackThroughOperation(stack, operation, _aggressiveStackCompression); if (!_aggressiveStackCompression && !findStackTooDeep(newStack, stack).empty()) // If we had stack errors, run again with aggressive stack compression. - return propagateStackThroughBlock(move(_exitStack), _block, true); - stack = move(newStack); + return propagateStackThroughBlock(std::move(_exitStack), _block, true); + stack = std::move(newStack); } return stack; @@ -715,13 +715,13 @@ void StackLayoutGenerator::fillInJunk(CFG::BasicBlock const& _block) util::BreadthFirstSearch breadthFirstSearch{{_entry}}; breadthFirstSearch.run([&](CFG::BasicBlock const* _block, auto _addChild) { auto& blockInfo = m_layout.blockInfos.at(_block); - blockInfo.entryLayout = Stack{_numJunk, JunkSlot{}} + move(blockInfo.entryLayout); + blockInfo.entryLayout = Stack{_numJunk, JunkSlot{}} + std::move(blockInfo.entryLayout); for (auto const& operation: _block->operations) { auto& operationEntryLayout = m_layout.operationEntryLayout.at(&operation); - operationEntryLayout = Stack{_numJunk, JunkSlot{}} + move(operationEntryLayout); + operationEntryLayout = Stack{_numJunk, JunkSlot{}} + std::move(operationEntryLayout); } - blockInfo.exitLayout = Stack{_numJunk, JunkSlot{}} + move(blockInfo.exitLayout); + blockInfo.exitLayout = Stack{_numJunk, JunkSlot{}} + std::move(blockInfo.exitLayout); std::visit(util::GenericVisitor{ [&](CFG::BasicBlock::MainExit const&) {}, diff --git a/libyul/backends/wasm/BinaryTransform.cpp b/libyul/backends/wasm/BinaryTransform.cpp index 321792b08..03f385d80 100644 --- a/libyul/backends/wasm/BinaryTransform.cpp +++ b/libyul/backends/wasm/BinaryTransform.cpp @@ -239,12 +239,12 @@ static map const builtins = { bytes prefixSize(bytes _data) { size_t size = _data.size(); - return lebEncode(size) + move(_data); + return lebEncode(size) + std::move(_data); } bytes makeSection(Section _section, bytes _data) { - return toBytes(_section) + prefixSize(move(_data)); + return toBytes(_section) + prefixSize(std::move(_data)); } /// This is a kind of run-length-encoding of local types. @@ -306,7 +306,7 @@ bytes BinaryTransform::run(Module const& _module) // TODO should we prefix and / or shorten the name? bytes data = BinaryTransform::run(module); size_t const length = data.size(); - ret += customSection(name, move(data)); + ret += customSection(name, std::move(data)); // Skip all the previous sections and the size field of this current custom section. size_t const offset = ret.size() - length; subModulePosAndSize[name] = {offset, length}; @@ -321,10 +321,10 @@ bytes BinaryTransform::run(Module const& _module) } BinaryTransform bt( - move(globalIDs), - move(functionIDs), - move(functionTypes), - move(subModulePosAndSize) + std::move(globalIDs), + std::move(functionIDs), + std::move(functionTypes), + std::move(subModulePosAndSize) ); ret += bt.codeSection(_module.functions); @@ -378,7 +378,7 @@ bytes BinaryTransform::operator()(BuiltinCall const& _call) yulAssert(builtins.count(_call.functionName), "Builtin " + _call.functionName + " not found"); // NOTE: the dialect ensures we have the right amount of arguments bytes args = visit(_call.arguments); - bytes ret = move(args) + toBytes(builtins.at(_call.functionName)); + bytes ret = std::move(args) + toBytes(builtins.at(_call.functionName)); if ( _call.functionName.find(".load") != string::npos || _call.functionName.find(".store") != string::npos @@ -500,7 +500,7 @@ bytes BinaryTransform::operator()(FunctionDefinition const& _function) yulAssert(m_labels.empty(), "Stray labels."); - return prefixSize(move(ret)); + return prefixSize(std::move(ret)); } BinaryTransform::Type BinaryTransform::typeOf(FunctionImport const& _import) @@ -602,7 +602,7 @@ bytes BinaryTransform::typeSection(map> co index++; } - return makeSection(Section::TYPE, lebEncode(index) + move(result)); + return makeSection(Section::TYPE, lebEncode(index) + std::move(result)); } bytes BinaryTransform::importSection( @@ -620,7 +620,7 @@ bytes BinaryTransform::importSection( toBytes(importKind) + lebEncode(_functionTypes.at(import.internalName)); } - return makeSection(Section::IMPORT, move(result)); + return makeSection(Section::IMPORT, std::move(result)); } bytes BinaryTransform::functionSection( @@ -631,7 +631,7 @@ bytes BinaryTransform::functionSection( bytes result = lebEncode(_functions.size()); for (auto const& fun: _functions) result += lebEncode(_functionTypes.at(fun.name)); - return makeSection(Section::FUNCTION, move(result)); + return makeSection(Section::FUNCTION, std::move(result)); } bytes BinaryTransform::memorySection() @@ -639,7 +639,7 @@ bytes BinaryTransform::memorySection() bytes result = lebEncode(1); result.push_back(static_cast(LimitsKind::Min)); result.push_back(1); // initial length - return makeSection(Section::MEMORY, move(result)); + return makeSection(Section::MEMORY, std::move(result)); } bytes BinaryTransform::globalSection(vector const& _globals) @@ -656,7 +656,7 @@ bytes BinaryTransform::globalSection(vector con toBytes(Opcode::End); } - return makeSection(Section::GLOBAL, move(result)); + return makeSection(Section::GLOBAL, std::move(result)); } bytes BinaryTransform::exportSection(map const& _functionIDs) @@ -666,13 +666,13 @@ bytes BinaryTransform::exportSection(map const& _functionIDs) result += encodeName("memory") + toBytes(Export::Memory) + lebEncode(0); if (hasMain) result += encodeName("main") + toBytes(Export::Function) + lebEncode(_functionIDs.at("main")); - return makeSection(Section::EXPORT, move(result)); + return makeSection(Section::EXPORT, std::move(result)); } bytes BinaryTransform::customSection(string const& _name, bytes _data) { - bytes result = encodeName(_name) + move(_data); - return makeSection(Section::CUSTOM, move(result)); + bytes result = encodeName(_name) + std::move(_data); + return makeSection(Section::CUSTOM, std::move(result)); } bytes BinaryTransform::codeSection(vector const& _functions) @@ -680,7 +680,7 @@ bytes BinaryTransform::codeSection(vector const& _func bytes result = lebEncode(_functions.size()); for (FunctionDefinition const& fun: _functions) result += (*this)(fun); - return makeSection(Section::CODE, move(result)); + return makeSection(Section::CODE, std::move(result)); } bytes BinaryTransform::visit(vector const& _expressions) diff --git a/libyul/backends/wasm/EVMToEwasmTranslator.cpp b/libyul/backends/wasm/EVMToEwasmTranslator.cpp index 359cc023b..d36b1cda3 100644 --- a/libyul/backends/wasm/EVMToEwasmTranslator.cpp +++ b/libyul/backends/wasm/EVMToEwasmTranslator.cpp @@ -92,7 +92,7 @@ Object EVMToEwasmTranslator::run(Object const& _object) Object ret; ret.name = _object.name; - ret.code = make_shared(move(ast)); + ret.code = make_shared(std::move(ast)); ret.debugData = _object.debugData; ret.analysisInfo = make_shared(); diff --git a/libyul/backends/wasm/TextTransform.cpp b/libyul/backends/wasm/TextTransform.cpp index 9880f5ee5..62596ba6e 100644 --- a/libyul/backends/wasm/TextTransform.cpp +++ b/libyul/backends/wasm/TextTransform.cpp @@ -90,7 +90,7 @@ string TextTransform::run(wasm::Module const& _module) ret += "\n"; for (auto const& f: _module.functions) ret += transform(f) + "\n"; - return move(ret) + ")\n"; + return std::move(ret) + ")\n"; } string TextTransform::operator()(wasm::Literal const& _literal) @@ -159,7 +159,7 @@ string TextTransform::operator()(wasm::If const& _if) string TextTransform::operator()(wasm::Loop const& _loop) { string label = _loop.labelName.empty() ? "" : " $" + _loop.labelName; - return "(loop" + move(label) + "\n" + indented(joinTransformed(_loop.statements, '\n')) + ")\n"; + return "(loop" + std::move(label) + "\n" + indented(joinTransformed(_loop.statements, '\n')) + ")\n"; } string TextTransform::operator()(wasm::Branch const& _branch) @@ -180,7 +180,7 @@ string TextTransform::operator()(wasm::Return const&) string TextTransform::operator()(wasm::Block const& _block) { string label = _block.labelName.empty() ? "" : " $" + _block.labelName; - return "(block" + move(label) + "\n" + indented(joinTransformed(_block.statements, '\n')) + "\n)\n"; + return "(block" + std::move(label) + "\n" + indented(joinTransformed(_block.statements, '\n')) + "\n)\n"; } string TextTransform::indented(string const& _in) @@ -230,7 +230,7 @@ string TextTransform::joinTransformed(vector const& _expressio string t = visit(e); if (!t.empty() && !ret.empty() && ret.back() != '\n') ret += _separator; - ret += move(t); + ret += std::move(t); } return ret; } diff --git a/libyul/backends/wasm/WasmCodeTransform.cpp b/libyul/backends/wasm/WasmCodeTransform.cpp index 32c774533..2d895d3fe 100644 --- a/libyul/backends/wasm/WasmCodeTransform.cpp +++ b/libyul/backends/wasm/WasmCodeTransform.cpp @@ -68,7 +68,7 @@ wasm::Expression WasmCodeTransform::generateMultiAssignment( ) { yulAssert(!_variableNames.empty(), ""); - wasm::LocalAssignment assignment{move(_variableNames.front()), std::move(_firstValue)}; + wasm::LocalAssignment assignment{std::move(_variableNames.front()), std::move(_firstValue)}; if (_variableNames.size() == 1) return { std::move(assignment) }; @@ -80,10 +80,10 @@ wasm::Expression WasmCodeTransform::generateMultiAssignment( yulAssert(allocatedIndices.size() == _variableNames.size() - 1, ""); wasm::Block block; - block.statements.emplace_back(move(assignment)); + block.statements.emplace_back(std::move(assignment)); for (size_t i = 1; i < _variableNames.size(); ++i) block.statements.emplace_back(wasm::LocalAssignment{ - move(_variableNames.at(i)), + std::move(_variableNames.at(i)), make_unique(wasm::GlobalVariable{m_globalVariables.at(allocatedIndices[i - 1]).variableName}) }); return { std::move(block) }; @@ -99,7 +99,7 @@ wasm::Expression WasmCodeTransform::operator()(yul::VariableDeclaration const& _ } if (_varDecl.value) - return generateMultiAssignment(move(variableNames), visit(*_varDecl.value)); + return generateMultiAssignment(std::move(variableNames), visit(*_varDecl.value)); else return wasm::BuiltinCall{"nop", {}}; } @@ -109,7 +109,7 @@ wasm::Expression WasmCodeTransform::operator()(yul::Assignment const& _assignmen vector variableNames; for (auto const& var: _assignment.variableNames) variableNames.emplace_back(var.name.str()); - return generateMultiAssignment(move(variableNames), visit(*_assignment.value)); + return generateMultiAssignment(std::move(variableNames), visit(*_assignment.value)); } wasm::Expression WasmCodeTransform::operator()(yul::ExpressionStatement const& _statement) @@ -134,7 +134,7 @@ void WasmCodeTransform::importBuiltinFunction(BuiltinFunction const* _builtin, s }; for (auto const& param: _builtin->parameters) imp.paramTypes.emplace_back(translatedType(param)); - m_functionsToImport[internalName] = move(imp); + m_functionsToImport[internalName] = std::move(imp); } } @@ -199,7 +199,7 @@ wasm::Expression WasmCodeTransform::operator()(yul::If const& _if) else yulAssert(false, "Invalid condition type"); - return wasm::If{make_unique(move(condition)), visit(_if.body.statements), {}}; + return wasm::If{make_unique(std::move(condition)), visit(_if.body.statements), {}}; } wasm::Expression WasmCodeTransform::operator()(yul::Switch const& _switch) @@ -224,7 +224,7 @@ wasm::Expression WasmCodeTransform::operator()(yul::Switch const& _switch) visitReturnByValue(*c.value) )}; wasm::If ifStmnt{ - make_unique(move(comparison)), + make_unique(std::move(comparison)), visit(c.body.statements), {} }; @@ -234,7 +234,7 @@ wasm::Expression WasmCodeTransform::operator()(yul::Switch const& _switch) ifStmnt.elseStatements = make_unique>(); nextBlock = ifStmnt.elseStatements.get(); } - currentBlock->emplace_back(move(ifStmnt)); + currentBlock->emplace_back(std::move(ifStmnt)); currentBlock = nextBlock; } else @@ -275,8 +275,8 @@ wasm::Expression WasmCodeTransform::operator()(yul::ForLoop const& _for) loop.statements += visit(_for.post.statements); loop.statements.emplace_back(wasm::Branch{wasm::Label{loop.labelName}}); - statements += make_vector(move(loop)); - return wasm::Block{breakLabel, move(statements)}; + statements += make_vector(std::move(loop)); + return wasm::Block{breakLabel, std::move(statements)}; } wasm::Expression WasmCodeTransform::operator()(yul::Break const&) diff --git a/libyul/backends/wasm/WasmDialect.cpp b/libyul/backends/wasm/WasmDialect.cpp index 817d53467..b724ba69e 100644 --- a/libyul/backends/wasm/WasmDialect.cpp +++ b/libyul/backends/wasm/WasmDialect.cpp @@ -269,7 +269,7 @@ void WasmDialect::addFunction( vector> _literalArguments ) { - YulString name{move(_name)}; + YulString name{std::move(_name)}; BuiltinFunction& f = m_functions[name]; f.name = name; f.parameters = std::move(_params); diff --git a/libyul/optimiser/ConditionalSimplifier.h b/libyul/optimiser/ConditionalSimplifier.h index 5df56476a..e558a1c6c 100644 --- a/libyul/optimiser/ConditionalSimplifier.h +++ b/libyul/optimiser/ConditionalSimplifier.h @@ -64,7 +64,7 @@ private: Dialect const& _dialect, std::map _sideEffects ): - m_dialect(_dialect), m_functionSideEffects(move(_sideEffects)) + m_dialect(_dialect), m_functionSideEffects(std::move(_sideEffects)) {} Dialect const& m_dialect; std::map m_functionSideEffects; diff --git a/libyul/optimiser/DeadCodeEliminator.h b/libyul/optimiser/DeadCodeEliminator.h index 2c166a836..ae8c1b2a6 100644 --- a/libyul/optimiser/DeadCodeEliminator.h +++ b/libyul/optimiser/DeadCodeEliminator.h @@ -63,7 +63,7 @@ private: DeadCodeEliminator( Dialect const& _dialect, std::map _sideEffects - ): m_dialect(_dialect), m_functionSideEffects(move(_sideEffects)) {} + ): m_dialect(_dialect), m_functionSideEffects(std::move(_sideEffects)) {} Dialect const& m_dialect; std::map m_functionSideEffects; diff --git a/libyul/optimiser/ForLoopInitRewriter.cpp b/libyul/optimiser/ForLoopInitRewriter.cpp index 345dd1266..7cfa16b4f 100644 --- a/libyul/optimiser/ForLoopInitRewriter.cpp +++ b/libyul/optimiser/ForLoopInitRewriter.cpp @@ -40,7 +40,7 @@ void ForLoopInitRewriter::operator()(Block& _block) (*this)(forLoop.post); vector rewrite; swap(rewrite, forLoop.pre.statements); - rewrite.emplace_back(move(forLoop)); + rewrite.emplace_back(std::move(forLoop)); return { std::move(rewrite) }; } else diff --git a/libyul/optimiser/FunctionSpecializer.cpp b/libyul/optimiser/FunctionSpecializer.cpp index 1d14db18b..4555e2f8f 100644 --- a/libyul/optimiser/FunctionSpecializer.cpp +++ b/libyul/optimiser/FunctionSpecializer.cpp @@ -65,7 +65,7 @@ void FunctionSpecializer::operator()(FunctionCall& _f) if (ranges::any_of(arguments, [](auto& _a) { return _a.has_value(); })) { - YulString oldName = move(_f.functionName.name); + YulString oldName = std::move(_f.functionName.name); auto newName = m_nameDispenser.newName(oldName); m_oldToNewMap[oldName].emplace_back(make_pair(newName, arguments)); @@ -106,12 +106,12 @@ FunctionDefinition FunctionSpecializer::specialize( VariableDeclaration{ _f.debugData, vector{newFunction.parameters[index]}, - make_unique(move(*argument)) + make_unique(std::move(*argument)) } ); newFunction.body.statements = - move(missingVariableDeclarations) + move(newFunction.body.statements); + std::move(missingVariableDeclarations) + std::move(newFunction.body.statements); // Only take those indices that cannot be specialized, i.e., whose value is `nullopt`. newFunction.parameters = @@ -120,7 +120,7 @@ FunctionDefinition FunctionSpecializer::specialize( applyMap(_arguments, [&](auto const& _v) { return !_v; }) ); - newFunction.name = move(_newName); + newFunction.name = std::move(_newName); return newFunction; } @@ -146,10 +146,10 @@ void FunctionSpecializer::run(OptimiserStepContext& _context, Block& _ast) f.m_oldToNewMap.at(functionDefinition.name), [&](auto& _p) -> Statement { - return f.specialize(functionDefinition, move(_p.first), move(_p.second)); + return f.specialize(functionDefinition, std::move(_p.first), std::move(_p.second)); } ); - return move(out) + make_vector(move(functionDefinition)); + return std::move(out) + make_vector(std::move(functionDefinition)); } } diff --git a/libyul/optimiser/KnowledgeBase.cpp b/libyul/optimiser/KnowledgeBase.cpp index 460f6707f..77848cce0 100644 --- a/libyul/optimiser/KnowledgeBase.cpp +++ b/libyul/optimiser/KnowledgeBase.cpp @@ -89,7 +89,7 @@ optional KnowledgeBase::valueIfKnownConstant(YulString _a) Expression KnowledgeBase::simplify(Expression _expression) { m_counter = 0; - return simplifyRecursively(move(_expression)); + return simplifyRecursively(std::move(_expression)); } Expression KnowledgeBase::simplifyRecursively(Expression _expression) diff --git a/libyul/optimiser/NameDispenser.cpp b/libyul/optimiser/NameDispenser.cpp index 01d33919f..d43b6802f 100644 --- a/libyul/optimiser/NameDispenser.cpp +++ b/libyul/optimiser/NameDispenser.cpp @@ -37,7 +37,7 @@ using namespace solidity::util; NameDispenser::NameDispenser(Dialect const& _dialect, Block const& _ast, set _reservedNames): NameDispenser(_dialect, NameCollector(_ast).names() + _reservedNames) { - m_reservedNames = move(_reservedNames); + m_reservedNames = std::move(_reservedNames); } NameDispenser::NameDispenser(Dialect const& _dialect, set _usedNames): diff --git a/libyul/optimiser/NameSimplifier.cpp b/libyul/optimiser/NameSimplifier.cpp index dfe1df9f4..0eb568beb 100644 --- a/libyul/optimiser/NameSimplifier.cpp +++ b/libyul/optimiser/NameSimplifier.cpp @@ -111,7 +111,7 @@ void NameSimplifier::findSimplification(YulString const& _name) { YulString newName{name}; m_context.dispenser.markUsed(newName); - m_translations[_name] = move(newName); + m_translations[_name] = std::move(newName); } } diff --git a/libyul/optimiser/ReasoningBasedSimplifier.cpp b/libyul/optimiser/ReasoningBasedSimplifier.cpp index 94c7102bd..af39978ed 100644 --- a/libyul/optimiser/ReasoningBasedSimplifier.cpp +++ b/libyul/optimiser/ReasoningBasedSimplifier.cpp @@ -71,7 +71,7 @@ void ReasoningBasedSimplifier::operator()(If& _if) { Literal trueCondition = m_dialect.trueLiteral(); trueCondition.debugData = debugDataOf(*_if.condition); - _if.condition = make_unique(move(trueCondition)); + _if.condition = make_unique(std::move(trueCondition)); } else { @@ -83,7 +83,7 @@ void ReasoningBasedSimplifier::operator()(If& _if) { Literal falseCondition = m_dialect.zeroLiteralForType(m_dialect.boolType); falseCondition.debugData = debugDataOf(*_if.condition); - _if.condition = make_unique(move(falseCondition)); + _if.condition = make_unique(std::move(falseCondition)); _if.body = yul::Block{}; // Nothing left to be done. return; diff --git a/libyul/optimiser/StackCompressor.cpp b/libyul/optimiser/StackCompressor.cpp index 6e33078a0..a6173996f 100644 --- a/libyul/optimiser/StackCompressor.cpp +++ b/libyul/optimiser/StackCompressor.cpp @@ -176,7 +176,7 @@ void eliminateVariables( varsToEliminate += chooseVarsToEliminate(candidates[functionName], static_cast(numVariables)); } - Rematerialiser::run(_dialect, _ast, move(varsToEliminate)); + Rematerialiser::run(_dialect, _ast, std::move(varsToEliminate)); // Do not remove functions. set allFunctions = NameCollector{_ast, NameCollector::OnlyFunctions}.names(); UnusedPruner::runUntilStabilised(_dialect, _ast, _allowMSizeOptimization, nullptr, allFunctions); diff --git a/libyul/optimiser/StackToMemoryMover.cpp b/libyul/optimiser/StackToMemoryMover.cpp index 425680923..74d05635e 100644 --- a/libyul/optimiser/StackToMemoryMover.cpp +++ b/libyul/optimiser/StackToMemoryMover.cpp @@ -50,7 +50,7 @@ vector generateMemoryStore( Identifier{_debugData, memoryStoreFunction->name}, { Literal{_debugData, LiteralKind::Number, _mpos, {}}, - move(_value) + std::move(_value) } }}); return result; @@ -95,7 +95,7 @@ void StackToMemoryMover::run( ) ); stackToMemoryMover(_block); - _block.statements += move(stackToMemoryMover.m_newFunctionDefinitions); + _block.statements += std::move(stackToMemoryMover.m_newFunctionDefinitions); } StackToMemoryMover::StackToMemoryMover( @@ -106,7 +106,7 @@ StackToMemoryMover::StackToMemoryMover( m_context(_context), m_memoryOffsetTracker(_memoryOffsetTracker), m_nameDispenser(_context.dispenser), -m_functionReturnVariables(move(_functionReturnVariables)) +m_functionReturnVariables(std::move(_functionReturnVariables)) { auto const* evmDialect = dynamic_cast(&_context.dialect); yulAssert( @@ -156,7 +156,7 @@ void StackToMemoryMover::operator()(FunctionDefinition& _functionDefinition) newFunctionName, stackParameters, {}, - move(_functionDefinition.body) + std::move(_functionDefinition.body) }); // Generate new names for the arguments to maintain disambiguation. std::map newArgumentNames; @@ -165,7 +165,7 @@ void StackToMemoryMover::operator()(FunctionDefinition& _functionDefinition) for (auto& parameter: _functionDefinition.parameters) parameter.name = util::valueOrDefault(newArgumentNames, parameter.name, parameter.name); // Replace original function by a call to the new function and an assignment to the return variable from memory. - _functionDefinition.body = Block{_functionDefinition.debugData, move(memoryVariableInits)}; + _functionDefinition.body = Block{_functionDefinition.debugData, std::move(memoryVariableInits)}; _functionDefinition.body.statements.emplace_back(ExpressionStatement{ _functionDefinition.debugData, FunctionCall{ @@ -189,7 +189,7 @@ void StackToMemoryMover::operator()(FunctionDefinition& _functionDefinition) } if (!memoryVariableInits.empty()) - _functionDefinition.body.statements = move(memoryVariableInits) + move(_functionDefinition.body.statements); + _functionDefinition.body.statements = std::move(memoryVariableInits) + std::move(_functionDefinition.body.statements); _functionDefinition.returnVariables = _functionDefinition.returnVariables | ranges::views::filter( not_fn(m_memoryOffsetTracker) @@ -214,7 +214,7 @@ void StackToMemoryMover::operator()(Block& _block) m_context.dialect, debugData, *offset, - _stmt.value ? *move(_stmt.value) : Literal{debugData, LiteralKind::Number, "0"_yulstring, {}} + _stmt.value ? *std::move(_stmt.value) : Literal{debugData, LiteralKind::Number, "0"_yulstring, {}} ); else return {}; @@ -245,7 +245,7 @@ void StackToMemoryMover::operator()(Block& _block) vector memoryAssignments; vector variableAssignments; - VariableDeclaration tempDecl{debugData, {}, move(_stmt.value)}; + VariableDeclaration tempDecl{debugData, {}, std::move(_stmt.value)}; yulAssert(rhsMemorySlots.size() == _lhsVars.size(), ""); for (auto&& [lhsVar, rhsSlot]: ranges::views::zip(_lhsVars, rhsMemorySlots)) @@ -265,26 +265,26 @@ void StackToMemoryMover::operator()(Block& _block) m_context.dialect, _stmt.debugData, *offset, - move(*rhs) + std::move(*rhs) ); else variableAssignments.emplace_back(StatementType{ debugData, - { move(lhsVar) }, - move(rhs) + { std::move(lhsVar) }, + std::move(rhs) }); } vector result; if (tempDecl.variables.empty()) - result.emplace_back(ExpressionStatement{debugData, *move(tempDecl.value)}); + result.emplace_back(ExpressionStatement{debugData, *std::move(tempDecl.value)}); else - result.emplace_back(move(tempDecl)); + result.emplace_back(std::move(tempDecl)); reverse(memoryAssignments.begin(), memoryAssignments.end()); - result += move(memoryAssignments); + result += std::move(memoryAssignments); reverse(variableAssignments.begin(), variableAssignments.end()); - result += move(variableAssignments); - return OptionalStatements{move(result)}; + result += std::move(variableAssignments); + return OptionalStatements{std::move(result)}; }; util::iterateReplacing( diff --git a/libyul/optimiser/UnusedFunctionParameterPruner.cpp b/libyul/optimiser/UnusedFunctionParameterPruner.cpp index 75e8325a3..6ce097f42 100644 --- a/libyul/optimiser/UnusedFunctionParameterPruner.cpp +++ b/libyul/optimiser/UnusedFunctionParameterPruner.cpp @@ -118,7 +118,7 @@ void UnusedFunctionParameterPruner::run(OptimiserStepContext& _context, Block& _ originalFunction.returnVariables = filter(originalFunction.returnVariables, used.second); - return make_vector(move(originalFunction), move(linkingFunction)); + return make_vector(std::move(originalFunction), std::move(linkingFunction)); } } diff --git a/libyul/optimiser/UnusedStoreBase.cpp b/libyul/optimiser/UnusedStoreBase.cpp index de13a23cc..49f550842 100644 --- a/libyul/optimiser/UnusedStoreBase.cpp +++ b/libyul/optimiser/UnusedStoreBase.cpp @@ -40,7 +40,7 @@ void UnusedStoreBase::operator()(If const& _if) TrackedStores skipBranch{m_stores}; (*this)(_if.body); - merge(m_stores, move(skipBranch)); + merge(m_stores, std::move(skipBranch)); } void UnusedStoreBase::operator()(Switch const& _switch) @@ -56,17 +56,17 @@ void UnusedStoreBase::operator()(Switch const& _switch) if (!c.value) hasDefault = true; (*this)(c.body); - branches.emplace_back(move(m_stores)); + branches.emplace_back(std::move(m_stores)); m_stores = preState; } if (hasDefault) { - m_stores = move(branches.back()); + m_stores = std::move(branches.back()); branches.pop_back(); } for (auto& branch: branches) - merge(m_stores, move(branch)); + merge(m_stores, std::move(branch)); } void UnusedStoreBase::operator()(FunctionDefinition const& _functionDefinition) @@ -97,7 +97,7 @@ void UnusedStoreBase::operator()(ForLoop const& _forLoop) TrackedStores zeroRuns{m_stores}; (*this)(_forLoop.body); - merge(m_stores, move(m_forLoopInfo.pendingContinueStmts)); + merge(m_stores, std::move(m_forLoopInfo.pendingContinueStmts)); m_forLoopInfo.pendingContinueStmts = {}; (*this)(_forLoop.post); @@ -110,50 +110,50 @@ void UnusedStoreBase::operator()(ForLoop const& _forLoop) (*this)(_forLoop.body); - merge(m_stores, move(m_forLoopInfo.pendingContinueStmts)); + merge(m_stores, std::move(m_forLoopInfo.pendingContinueStmts)); m_forLoopInfo.pendingContinueStmts.clear(); (*this)(_forLoop.post); visit(*_forLoop.condition); // Order of merging does not matter because "max" is commutative and associative. - merge(m_stores, move(oneRun)); + merge(m_stores, std::move(oneRun)); } else // Shortcut to avoid horrible runtime. shortcutNestedLoop(zeroRuns); // Order of merging does not matter because "max" is commutative and associative. - merge(m_stores, move(zeroRuns)); - merge(m_stores, move(m_forLoopInfo.pendingBreakStmts)); + merge(m_stores, std::move(zeroRuns)); + merge(m_stores, std::move(m_forLoopInfo.pendingBreakStmts)); m_forLoopInfo.pendingBreakStmts.clear(); } void UnusedStoreBase::operator()(Break const&) { - m_forLoopInfo.pendingBreakStmts.emplace_back(move(m_stores)); + m_forLoopInfo.pendingBreakStmts.emplace_back(std::move(m_stores)); m_stores.clear(); } void UnusedStoreBase::operator()(Continue const&) { - m_forLoopInfo.pendingContinueStmts.emplace_back(move(m_stores)); + m_forLoopInfo.pendingContinueStmts.emplace_back(std::move(m_stores)); m_stores.clear(); } void UnusedStoreBase::merge(TrackedStores& _target, TrackedStores&& _other) { - util::joinMap(_target, move(_other), []( + util::joinMap(_target, std::move(_other), []( map& _assignmentHere, map&& _assignmentThere ) { - return util::joinMap(_assignmentHere, move(_assignmentThere), State::join); + return util::joinMap(_assignmentHere, std::move(_assignmentThere), State::join); }); } void UnusedStoreBase::merge(TrackedStores& _target, vector&& _source) { for (TrackedStores& ts: _source) - merge(_target, move(ts)); + merge(_target, std::move(ts)); _source.clear(); } diff --git a/libyul/optimiser/UnusedStoreEliminator.cpp b/libyul/optimiser/UnusedStoreEliminator.cpp index 0e6acdeea..754c02ac5 100644 --- a/libyul/optimiser/UnusedStoreEliminator.cpp +++ b/libyul/optimiser/UnusedStoreEliminator.cpp @@ -186,7 +186,7 @@ void UnusedStoreEliminator::visit(Statement const& _statement) m_stores[YulString{}].insert({&_statement, initialState}); vector operations = operationsFromFunctionCall(*funCall); yulAssert(operations.size() == 1, ""); - m_storeOperations[&_statement] = move(operations.front()); + m_storeOperations[&_statement] = std::move(operations.front()); } } diff --git a/test/CommonSyntaxTest.cpp b/test/CommonSyntaxTest.cpp index 5b66aea30..f794439de 100644 --- a/test/CommonSyntaxTest.cpp +++ b/test/CommonSyntaxTest.cpp @@ -245,10 +245,10 @@ vector CommonSyntaxTest::parseExpectations(istream& _stream) string errorMessage(it, line.end()); expectations.emplace_back(SyntaxTestError{ - move(errorType), - move(errorId), - move(errorMessage), - move(sourceName), + std::move(errorType), + std::move(errorId), + std::move(errorMessage), + std::move(sourceName), locationStart, locationEnd }); diff --git a/test/EVMHost.cpp b/test/EVMHost.cpp index 6c5cb6912..118a517fb 100644 --- a/test/EVMHost.cpp +++ b/test/EVMHost.cpp @@ -50,7 +50,7 @@ evmc::VM& EVMHost::getVM(string const& _path) if (vm && errorCode == EVMC_LOADER_SUCCESS) { if (vm.get_capabilities() & (EVMC_CAPABILITY_EVM1 | EVMC_CAPABILITY_EWASM)) - vms[_path] = make_unique(evmc::VM(move(vm))); + vms[_path] = make_unique(evmc::VM(std::move(vm))); else cerr << "VM loaded neither supports EVM1 nor EWASM" << endl; } diff --git a/test/Metadata.cpp b/test/Metadata.cpp index 27e5332af..88a1f7b42 100644 --- a/test/Metadata.cpp +++ b/test/Metadata.cpp @@ -162,7 +162,7 @@ std::optional> parseCBORMetadata(bytes const& _metadata) { string key = parser.readKey(); string value = parser.readValue(); - ret[move(key)] = move(value); + ret[std::move(key)] = std::move(value); } return ret; } diff --git a/test/TestCaseReader.cpp b/test/TestCaseReader.cpp index d9015b55f..43e4a6fc3 100644 --- a/test/TestCaseReader.cpp +++ b/test/TestCaseReader.cpp @@ -194,7 +194,7 @@ pair TestCaseReader::parseSourcesAndSettingsWithLineNumber(is } // Register the last source as the main one sources[currentSourceName] = currentSource; - return {{move(sources), move(externalSources), move(currentSourceName)}, lineNumber}; + return {{std::move(sources), std::move(externalSources), std::move(currentSourceName)}, lineNumber}; } string TestCaseReader::parseSimpleExpectations(istream& _file) diff --git a/test/libevmasm/Optimiser.cpp b/test/libevmasm/Optimiser.cpp index f08f227cb..6fc3c5a74 100644 --- a/test/libevmasm/Optimiser.cpp +++ b/test/libevmasm/Optimiser.cpp @@ -143,7 +143,7 @@ namespace for (BasicBlock const& block: cfg.optimisedBlocks()) copy(output.begin() + static_cast(block.begin), output.begin() + static_cast(block.end), back_inserter(optItems)); - output = move(optItems); + output = std::move(optItems); } return output; } diff --git a/test/liblangutil/Scanner.cpp b/test/liblangutil/Scanner.cpp index c288ed854..9e196b0f5 100644 --- a/test/liblangutil/Scanner.cpp +++ b/test/liblangutil/Scanner.cpp @@ -150,11 +150,11 @@ struct TestScanner { unique_ptr stream; unique_ptr scanner; - explicit TestScanner(string _text) { reset(move(_text)); } + explicit TestScanner(string _text) { reset(std::move(_text)); } void reset(std::string _text) { - stream = make_unique(move(_text), ""); + stream = make_unique(std::move(_text), ""); scanner = make_unique(*stream); } diff --git a/test/libsolidity/GasTest.cpp b/test/libsolidity/GasTest.cpp index fd215cb94..030472e8a 100644 --- a/test/libsolidity/GasTest.cpp +++ b/test/libsolidity/GasTest.cpp @@ -58,7 +58,7 @@ void GasTest::parseExpectations(std::istream& _stream) { string kind = line.substr(3, line.length() - 4); boost::trim(kind); - currentKind = &m_expectations[move(kind)]; + currentKind = &m_expectations[std::move(kind)]; } else if (!currentKind) BOOST_THROW_EXCEPTION(runtime_error("No function kind specified. Expected \"creation:\", \"external:\" or \"internal:\".")); diff --git a/test/libsolidity/SMTCheckerTest.cpp b/test/libsolidity/SMTCheckerTest.cpp index 10084b014..eed911b1a 100644 --- a/test/libsolidity/SMTCheckerTest.cpp +++ b/test/libsolidity/SMTCheckerTest.cpp @@ -77,7 +77,7 @@ SMTCheckerTest::SMTCheckerTest(string const& _filename): SyntaxTest(_filename, E return filtered; }; if (m_modelCheckerSettings.invariants.invariants.empty()) - m_expectations = removeInv(move(m_expectations)); + m_expectations = removeInv(std::move(m_expectations)); auto const& ignoreInv = m_reader.stringSetting("SMTIgnoreInv", "yes"); if (ignoreInv == "no") diff --git a/test/libsolidity/SemanticTest.cpp b/test/libsolidity/SemanticTest.cpp index 785a32fdc..9cf2b8d52 100644 --- a/test/libsolidity/SemanticTest.cpp +++ b/test/libsolidity/SemanticTest.cpp @@ -61,7 +61,7 @@ SemanticTest::SemanticTest( m_sideEffectHooks(makeSideEffectHooks()), m_enforceCompileToEwasm(_enforceCompileToEwasm), m_enforceGasCost(_enforceGasCost), - m_enforceGasCostMinValue(move(_enforceGasCostMinValue)) + m_enforceGasCostMinValue(std::move(_enforceGasCostMinValue)) { static set const compileViaYulAllowedValues{"also", "true", "false"}; static set const yulRunTriggers{"also", "true"}; @@ -457,14 +457,14 @@ TestCase::TestResult SemanticTest::runTest( success = false; test.setFailure(!m_transactionSuccessful); - test.setRawBytes(move(output)); + test.setRawBytes(std::move(output)); test.setContractABI(m_compiler.contractABI(m_compiler.lastContractName(m_sources.mainSourceFile))); } vector effects; for (SideEffectHook const& hook: m_sideEffectHooks) effects += hook(test.call()); - test.setSideEffects(move(effects)); + test.setSideEffects(std::move(effects)); success &= test.call().expectedSideEffects == test.call().actualSideEffects; } diff --git a/test/libsolidity/SolidityExecutionFramework.cpp b/test/libsolidity/SolidityExecutionFramework.cpp index 70d0b2a6e..cb47cf45e 100644 --- a/test/libsolidity/SolidityExecutionFramework.cpp +++ b/test/libsolidity/SolidityExecutionFramework.cpp @@ -109,7 +109,7 @@ bytes SolidityExecutionFramework::multiSourceCompileContract( try { asmStack.optimize(); - obj = move(*asmStack.assemble(yul::YulStack::Machine::EVM).bytecode); + obj = std::move(*asmStack.assemble(yul::YulStack::Machine::EVM).bytecode); obj.link(_libraryAddresses); break; } diff --git a/test/libsolidity/util/TestFileParser.cpp b/test/libsolidity/util/TestFileParser.cpp index 4ad0701e4..915586ad2 100644 --- a/test/libsolidity/util/TestFileParser.cpp +++ b/test/libsolidity/util/TestFileParser.cpp @@ -178,7 +178,7 @@ vector TestFileParser::parseFunctionCall accept(Token::Newline, true); call.expectedSideEffects = parseFunctionCallSideEffects(); - calls.emplace_back(move(call)); + calls.emplace_back(std::move(call)); } } catch (TestParserError const& _e) diff --git a/test/libyul/ObjectParser.cpp b/test/libyul/ObjectParser.cpp index bee0025af..be3de930d 100644 --- a/test/libyul/ObjectParser.cpp +++ b/test/libyul/ObjectParser.cpp @@ -122,7 +122,7 @@ tuple, ErrorList> tryGetSourceLocationMapping(string _so ErrorReporter reporter(errors); Dialect const& dialect = yul::EVMDialect::strictAssemblyForEVM(EVMVersion::berlin()); ObjectParser objectParser{reporter, dialect}; - CharStream stream(move(source), ""); + CharStream stream(std::move(source), ""); auto object = objectParser.parse(make_shared(stream), false); BOOST_REQUIRE(object && object->debugData); return {object->debugData->sourceNames, std::move(errors)}; diff --git a/test/libyul/Parser.cpp b/test/libyul/Parser.cpp index 49152e7f8..511ed6c19 100644 --- a/test/libyul/Parser.cpp +++ b/test/libyul/Parser.cpp @@ -65,7 +65,7 @@ shared_ptr parse(string const& _source, Dialect const& _dialect, ErrorRep auto parserResult = yul::Parser( errorReporter, _dialect, - move(indicesToSourceNames) + std::move(indicesToSourceNames) ).parse(stream); if (parserResult) { diff --git a/test/solc/Common.cpp b/test/solc/Common.cpp index ead9b798d..8e2e329e4 100644 --- a/test/solc/Common.cpp +++ b/test/solc/Common.cpp @@ -91,5 +91,5 @@ string test::stripPreReleaseWarning(string const& _stderrContent) }; string output = regex_replace(_stderrContent, preReleaseWarningRegex, ""); - return regex_replace(move(output), noOutputRegex, ""); + return regex_replace(std::move(output), noOutputRegex, ""); } diff --git a/test/yulPhaser/FitnessMetrics.cpp b/test/yulPhaser/FitnessMetrics.cpp index bd063bf1f..bde15a537 100644 --- a/test/yulPhaser/FitnessMetrics.cpp +++ b/test/yulPhaser/FitnessMetrics.cpp @@ -64,7 +64,7 @@ protected: Program optimisedProgram(Program _program) const { [[maybe_unused]] size_t originalSize = _program.codeSize(m_weights); - Program result = move(_program); + Program result = std::move(_program); result.optimise(m_chromosome.optimisationSteps()); // Make sure that the program and the chromosome we have chosen are suitable for the test diff --git a/test/yulPhaser/ProgramCache.cpp b/test/yulPhaser/ProgramCache.cpp index 3a84aad67..2dab86fcd 100644 --- a/test/yulPhaser/ProgramCache.cpp +++ b/test/yulPhaser/ProgramCache.cpp @@ -52,7 +52,7 @@ protected: Program optimisedProgram(Program _program, string _abbreviatedOptimisationSteps) const { - Program result = move(_program); + Program result = std::move(_program); result.optimise(Chromosome::genesToSteps(_abbreviatedOptimisationSteps)); return result; } diff --git a/test/yulPhaser/TestHelpers.cpp b/test/yulPhaser/TestHelpers.cpp index 1df5c4e54..50afd70a3 100644 --- a/test/yulPhaser/TestHelpers.cpp +++ b/test/yulPhaser/TestHelpers.cpp @@ -30,7 +30,7 @@ using namespace solidity::phaser::test; function phaser::test::wholeChromosomeReplacement(Chromosome _newChromosome) { - return [_newChromosome = move(_newChromosome)](Chromosome const&) { return _newChromosome; }; + return [_newChromosome = std::move(_newChromosome)](Chromosome const&) { return _newChromosome; }; } function phaser::test::geneSubstitution(size_t _geneIndex, string _geneValue) diff --git a/tools/yulPhaser/Chromosome.cpp b/tools/yulPhaser/Chromosome.cpp index 687c669da..6e8d3544e 100644 --- a/tools/yulPhaser/Chromosome.cpp +++ b/tools/yulPhaser/Chromosome.cpp @@ -43,7 +43,7 @@ Chromosome Chromosome::makeRandom(size_t _length) for (size_t i = 0; i < _length; ++i) steps.push_back(randomOptimisationStep()); - return Chromosome(move(steps)); + return Chromosome(std::move(steps)); } ostream& phaser::operator<<(ostream& _stream, Chromosome const& _chromosome) diff --git a/tools/yulPhaser/GeneticAlgorithms.cpp b/tools/yulPhaser/GeneticAlgorithms.cpp index 907703738..ff40d222a 100644 --- a/tools/yulPhaser/GeneticAlgorithms.cpp +++ b/tools/yulPhaser/GeneticAlgorithms.cpp @@ -71,7 +71,7 @@ Population RandomAlgorithm::runNextRound(Population _population) size_t replacementCount = _population.individuals().size() - elitePopulation.individuals().size(); return - move(elitePopulation) + + std::move(elitePopulation) + Population::makeRandom( _population.fitnessMetric(), replacementCount, diff --git a/tools/yulPhaser/Mutations.cpp b/tools/yulPhaser/Mutations.cpp index 69ec7fc49..873fbbb9b 100644 --- a/tools/yulPhaser/Mutations.cpp +++ b/tools/yulPhaser/Mutations.cpp @@ -44,7 +44,7 @@ function phaser::geneRandomisation(double _chance) gene ); - return Chromosome(move(genes)); + return Chromosome(std::move(genes)); }; } @@ -57,7 +57,7 @@ function phaser::geneDeletion(double _chance) if (!SimulationRNG::bernoulliTrial(_chance)) genes.push_back(gene); - return Chromosome(move(genes)); + return Chromosome(std::move(genes)); }; } @@ -77,7 +77,7 @@ function phaser::geneAddition(double _chance) genes.push_back(Chromosome::randomGene()); } - return Chromosome(move(genes)); + return Chromosome(std::move(genes)); }; } @@ -102,7 +102,7 @@ function phaser::mutationSequence(vector> _mutation { Chromosome mutatedChromosome = _chromosome; for (size_t i = 0; i < _mutations.size(); ++i) - mutatedChromosome = _mutations[i](move(mutatedChromosome)); + mutatedChromosome = _mutations[i](std::move(mutatedChromosome)); return mutatedChromosome; }; diff --git a/tools/yulPhaser/PairSelections.h b/tools/yulPhaser/PairSelections.h index 2bdc62a24..12532c76a 100644 --- a/tools/yulPhaser/PairSelections.h +++ b/tools/yulPhaser/PairSelections.h @@ -107,7 +107,7 @@ class PairMosaicSelection: public PairSelection { public: explicit PairMosaicSelection(std::vector> _pattern, double _selectionSize = 1.0): - m_pattern(move(_pattern)), + m_pattern(std::move(_pattern)), m_selectionSize(_selectionSize) { assert(m_pattern.size() > 0 || _selectionSize == 0.0); diff --git a/tools/yulPhaser/Phaser.cpp b/tools/yulPhaser/Phaser.cpp index 213e6f15b..db5ec35ce 100644 --- a/tools/yulPhaser/Phaser.cpp +++ b/tools/yulPhaser/Phaser.cpp @@ -239,8 +239,8 @@ unique_ptr FitnessMetricFactory::build( { for (size_t i = 0; i < _programs.size(); ++i) metrics.push_back(make_unique( - _programCaches[i] != nullptr ? optional{} : move(_programs[i]), - move(_programCaches[i]), + _programCaches[i] != nullptr ? optional{} : std::move(_programs[i]), + std::move(_programCaches[i]), _weights, _options.chromosomeRepetitions )); @@ -251,8 +251,8 @@ unique_ptr FitnessMetricFactory::build( { for (size_t i = 0; i < _programs.size(); ++i) metrics.push_back(make_unique( - _programCaches[i] != nullptr ? optional{} : move(_programs[i]), - move(_programCaches[i]), + _programCaches[i] != nullptr ? optional{} : std::move(_programs[i]), + std::move(_programCaches[i]), _options.relativeMetricScale, _weights, _options.chromosomeRepetitions @@ -266,13 +266,13 @@ unique_ptr FitnessMetricFactory::build( switch (_options.metricAggregator) { case MetricAggregatorChoice::Average: - return make_unique(move(metrics)); + return make_unique(std::move(metrics)); case MetricAggregatorChoice::Sum: - return make_unique(move(metrics)); + return make_unique(std::move(metrics)); case MetricAggregatorChoice::Maximum: - return make_unique(move(metrics)); + return make_unique(std::move(metrics)); case MetricAggregatorChoice::Minimum: - return make_unique(move(metrics)); + return make_unique(std::move(metrics)); default: assertThrow(false, solidity::util::Exception, "Invalid MetricAggregatorChoice value."); } @@ -309,7 +309,7 @@ Population PopulationFactory::build( for (size_t populationSize: _options.randomPopulation) combinedSize += populationSize; - population = move(population) + buildRandom( + population = std::move(population) + buildRandom( combinedSize, _options.minChromosomeLength, _options.maxChromosomeLength, @@ -317,7 +317,7 @@ Population PopulationFactory::build( ); for (string const& populationFilePath: _options.populationFromFile) - population = move(population) + buildFromFile(populationFilePath, _fitnessMetric); + population = std::move(population) + buildFromFile(populationFilePath, _fitnessMetric); return population; } @@ -331,7 +331,7 @@ Population PopulationFactory::buildFromStrings( for (string const& geneSequence: _geneSequences) chromosomes.emplace_back(geneSequence); - return Population(move(_fitnessMetric), move(chromosomes)); + return Population(std::move(_fitnessMetric), std::move(chromosomes)); } Population PopulationFactory::buildRandom( @@ -342,7 +342,7 @@ Population PopulationFactory::buildRandom( ) { return Population::makeRandom( - move(_fitnessMetric), + std::move(_fitnessMetric), _populationSize, _minChromosomeLength, _maxChromosomeLength @@ -354,7 +354,7 @@ Population PopulationFactory::buildFromFile( shared_ptr _fitnessMetric ) { - return buildFromStrings(readLinesFromFile(_filePath), move(_fitnessMetric)); + return buildFromStrings(readLinesFromFile(_filePath), std::move(_fitnessMetric)); } ProgramCacheFactory::Options ProgramCacheFactory::Options::fromCommandLine(po::variables_map const& _arguments) @@ -371,7 +371,7 @@ vector> ProgramCacheFactory::build( { vector> programCaches; for (Program& program: _programs) - programCaches.push_back(_options.programCacheEnabled ? make_shared(move(program)) : nullptr); + programCaches.push_back(_options.programCacheEnabled ? make_shared(std::move(program)) : nullptr); return programCaches; } @@ -400,7 +400,7 @@ vector ProgramFactory::build(Options const& _options) } get(programOrErrors).optimise(Chromosome(_options.prefix).optimisationSteps()); - inputPrograms.push_back(move(get(programOrErrors))); + inputPrograms.push_back(std::move(get(programOrErrors))); } return inputPrograms; @@ -823,12 +823,12 @@ void Phaser::runPhaser(po::variables_map const& _arguments) programCaches, codeWeights ); - Population population = PopulationFactory::build(populationOptions, move(fitnessMetric)); + Population population = PopulationFactory::build(populationOptions, std::move(fitnessMetric)); if (_arguments["mode"].as() == PhaserMode::RunAlgorithm) - runAlgorithm(_arguments, move(population), move(programCaches)); + runAlgorithm(_arguments, std::move(population), std::move(programCaches)); else - printOptimisedProgramsOrASTs(_arguments, population, move(programs), _arguments["mode"].as()); + printOptimisedProgramsOrASTs(_arguments, population, std::move(programs), _arguments["mode"].as()); } void Phaser::runAlgorithm( @@ -844,7 +844,7 @@ void Phaser::runAlgorithm( _population.individuals().size() ); - AlgorithmRunner algorithmRunner(move(_population), move(_programCaches), buildAlgorithmRunnerOptions(_arguments), cout); + AlgorithmRunner algorithmRunner(std::move(_population), std::move(_programCaches), buildAlgorithmRunnerOptions(_arguments), cout); algorithmRunner.run(*geneticAlgorithm); } diff --git a/tools/yulPhaser/Population.cpp b/tools/yulPhaser/Population.cpp index 1dba2e2fd..d4fe1f0bd 100644 --- a/tools/yulPhaser/Population.cpp +++ b/tools/yulPhaser/Population.cpp @@ -68,7 +68,7 @@ Population Population::makeRandom( for (size_t i = 0; i < _size; ++i) chromosomes.push_back(Chromosome::makeRandom(_chromosomeLengthGenerator())); - return Population(move(_fitnessMetric), move(chromosomes)); + return Population(std::move(_fitnessMetric), std::move(chromosomes)); } Population Population::makeRandom( @@ -79,7 +79,7 @@ Population Population::makeRandom( ) { return makeRandom( - move(_fitnessMetric), + std::move(_fitnessMetric), _size, std::bind(uniformChromosomeLength, _minChromosomeLength, _maxChromosomeLength) ); @@ -112,7 +112,7 @@ Population Population::crossover(PairSelection const& _selection, function Population::symmetricCrossoverWithRemainder( m_individuals[i].chromosome, m_individuals[j].chromosome ); - crossedIndividuals.emplace_back(move(get<0>(children)), *m_fitnessMetric); - crossedIndividuals.emplace_back(move(get<1>(children)), *m_fitnessMetric); + crossedIndividuals.emplace_back(std::move(get<0>(children)), *m_fitnessMetric); + crossedIndividuals.emplace_back(std::move(get<1>(children)), *m_fitnessMetric); indexSelected[i] = true; indexSelected[j] = true; } @@ -159,7 +159,7 @@ Population operator+(Population _a, Population _b) assert(_a.m_fitnessMetric == _b.m_fitnessMetric); using ::operator+; // Import the std::vector concat operator from CommonData.h - return Population(_a.m_fitnessMetric, move(_a.m_individuals) + move(_b.m_individuals)); + return Population(_a.m_fitnessMetric, std::move(_a.m_individuals) + std::move(_b.m_individuals)); } } @@ -193,7 +193,7 @@ vector Population::chromosomesToIndividuals( { vector individuals; for (auto& chromosome: _chromosomes) - individuals.emplace_back(move(chromosome), _fitnessMetric); + individuals.emplace_back(std::move(chromosome), _fitnessMetric); return individuals; } diff --git a/tools/yulPhaser/Program.cpp b/tools/yulPhaser/Program.cpp index 5c61701d8..c62b8e130 100644 --- a/tools/yulPhaser/Program.cpp +++ b/tools/yulPhaser/Program.cpp @@ -102,7 +102,7 @@ variant Program::load(CharStream& _sourceCode) void Program::optimise(vector const& _optimisationSteps) { - m_ast = applyOptimisationSteps(m_dialect, m_nameDispenser, move(m_ast), _optimisationSteps); + m_ast = applyOptimisationSteps(m_dialect, m_nameDispenser, std::move(m_ast), _optimisationSteps); } ostream& phaser::operator<<(ostream& _stream, Program const& _program) @@ -153,7 +153,7 @@ variant, ErrorList> Program::parseObject(Dialect const& _diale // to refactor ObjectParser and Object to use unique_ptr instead). auto astCopy = make_unique(get(ASTCopier{}(*selectedObject->code))); - return variant, ErrorList>(move(astCopy)); + return variant, ErrorList>(std::move(astCopy)); } variant, ErrorList> Program::analyzeAST(Dialect const& _dialect, Block const& _ast) @@ -168,7 +168,7 @@ variant, ErrorList> Program::analyzeAST(Dialect cons return errors; assert(errorReporter.errors().empty()); - return variant, ErrorList>(move(analysisInfo)); + return variant, ErrorList>(std::move(analysisInfo)); } unique_ptr Program::disambiguateAST( diff --git a/tools/yulPhaser/Selections.h b/tools/yulPhaser/Selections.h index 88264e25a..bd51cfe78 100644 --- a/tools/yulPhaser/Selections.h +++ b/tools/yulPhaser/Selections.h @@ -86,7 +86,7 @@ class MosaicSelection: public Selection { public: explicit MosaicSelection(std::vector _pattern, double _selectionSize = 1.0): - m_pattern(move(_pattern)), + m_pattern(std::move(_pattern)), m_selectionSize(_selectionSize) { assert(m_pattern.size() > 0 || _selectionSize == 0.0);