Skip to content

Commit e394331

Browse files
committed
Remove the usage of boost::noncopyable
Prior to this half of the codebase used explicit deleted copy constructors, the others used boost::noncopyable.
1 parent 15decd2 commit e394331

20 files changed

+70
-38
lines changed

libevmasm/SimplificationRules.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929

3030
#include <libsolutil/CommonData.h>
3131

32-
#include <boost/noncopyable.hpp>
33-
3432
#include <functional>
3533
#include <vector>
3634

@@ -47,9 +45,13 @@ class Pattern;
4745
/**
4846
* Container for all simplification rules.
4947
*/
50-
class Rules: public boost::noncopyable
48+
class Rules
5149
{
5250
public:
51+
/// Noncopyable.
52+
Rules(Rules const&) = delete;
53+
Rules& operator=(Rules const&) = delete;
54+
5355
using Expression = ExpressionClasses::Expression;
5456

5557
Rules();

libsmtutil/CVC4Interface.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#pragma once
2020

2121
#include <libsmtutil/SolverInterface.h>
22-
#include <boost/noncopyable.hpp>
2322

2423
#if defined(__GLIBC__)
2524
// The CVC4 headers includes the deprecated system headers <ext/hash_map>
@@ -37,9 +36,13 @@
3736
namespace solidity::smtutil
3837
{
3938

40-
class CVC4Interface: public SolverInterface, public boost::noncopyable
39+
class CVC4Interface: public SolverInterface
4140
{
4241
public:
42+
/// Noncopyable.
43+
CVC4Interface(CVC4Interface const&) = delete;
44+
CVC4Interface& operator=(CVC4Interface const&) = delete;
45+
4346
CVC4Interface(std::optional<unsigned> _queryTimeout = {});
4447

4548
void reset() override;

libsmtutil/SMTLib2Interface.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
#include <libsolutil/Common.h>
2626
#include <libsolutil/FixedHash.h>
2727

28-
#include <boost/noncopyable.hpp>
2928
#include <cstdio>
3029
#include <map>
3130
#include <set>
@@ -35,9 +34,13 @@
3534
namespace solidity::smtutil
3635
{
3736

38-
class SMTLib2Interface: public SolverInterface, public boost::noncopyable
37+
class SMTLib2Interface: public SolverInterface
3938
{
4039
public:
40+
/// Noncopyable.
41+
SMTLib2Interface(SMTLib2Interface const&) = delete;
42+
SMTLib2Interface& operator=(SMTLib2Interface const&) = delete;
43+
4144
explicit SMTLib2Interface(
4245
std::map<util::h256, std::string> _queryResponses = {},
4346
frontend::ReadCallback::Callback _smtCallback = {},

libsmtutil/SMTPortfolio.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
#include <libsolidity/interface/ReadFile.h>
2424
#include <libsolutil/FixedHash.h>
2525

26-
#include <boost/noncopyable.hpp>
2726
#include <map>
2827
#include <vector>
2928

@@ -36,9 +35,13 @@ namespace solidity::smtutil
3635
* It also checks whether different solvers give conflicting answers
3736
* to SMT queries.
3837
*/
39-
class SMTPortfolio: public SolverInterface, public boost::noncopyable
38+
class SMTPortfolio: public SolverInterface
4039
{
4140
public:
41+
/// Noncopyable.
42+
SMTPortfolio(SMTPortfolio const&) = delete;
43+
SMTPortfolio& operator=(SMTPortfolio const&) = delete;
44+
4245
SMTPortfolio(
4346
std::map<util::h256, std::string> _smtlib2Responses = {},
4447
frontend::ReadCallback::Callback _smtCallback = {},

libsmtutil/SolverInterface.h

-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323

2424
#include <libsolutil/Common.h>
2525

26-
#include <boost/noncopyable.hpp>
2726
#include <cstdio>
2827
#include <map>
2928
#include <memory>

libsmtutil/Z3Interface.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,18 @@
1919
#pragma once
2020

2121
#include <libsmtutil/SolverInterface.h>
22-
#include <boost/noncopyable.hpp>
2322
#include <z3++.h>
2423

2524
namespace solidity::smtutil
2625
{
2726

28-
class Z3Interface: public SolverInterface, public boost::noncopyable
27+
class Z3Interface: public SolverInterface
2928
{
3029
public:
30+
/// Noncopyable.
31+
Z3Interface(Z3Interface const&) = delete;
32+
Z3Interface& operator=(Z3Interface const&) = delete;
33+
3134
Z3Interface(std::optional<unsigned> _queryTimeout = {});
3235

3336
static bool available();

libsolidity/analysis/DeclarationContainer.h

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <libsolidity/ast/ASTForward.h>
2727
#include <liblangutil/Exceptions.h>
2828
#include <liblangutil/SourceLocation.h>
29-
#include <boost/noncopyable.hpp>
3029

3130
namespace solidity::frontend
3231
{

libsolidity/analysis/DeclarationTypeChecker.h

-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
#include <libsolidity/ast/ASTAnnotations.h>
2323
#include <liblangutil/EVMVersion.h>
2424

25-
#include <boost/noncopyable.hpp>
2625
#include <list>
2726
#include <map>
2827

libsolidity/analysis/GlobalContext.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#pragma once
2525

2626
#include <libsolidity/ast/ASTForward.h>
27-
#include <boost/noncopyable.hpp>
2827
#include <map>
2928
#include <memory>
3029
#include <string>
@@ -41,9 +40,13 @@ class Type; // forward
4140
* @note must not be destroyed or moved during compilation as its objects can be referenced from
4241
* other objects.
4342
*/
44-
class GlobalContext: private boost::noncopyable
43+
class GlobalContext
4544
{
4645
public:
46+
/// Noncopyable.
47+
GlobalContext(GlobalContext const&) = delete;
48+
GlobalContext& operator=(GlobalContext const&) = delete;
49+
4750
GlobalContext();
4851
void setCurrentContract(ContractDefinition const& _contract);
4952
void resetCurrentContract() { m_currentContract = nullptr; }

libsolidity/analysis/NameAndTypeResolver.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131

3232
#include <liblangutil/EVMVersion.h>
3333

34-
#include <boost/noncopyable.hpp>
35-
3634
#include <list>
3735
#include <map>
3836

@@ -48,9 +46,13 @@ namespace solidity::frontend
4846
* Resolves name references, typenames and sets the (explicitly given) types for all variable
4947
* declarations.
5048
*/
51-
class NameAndTypeResolver: private boost::noncopyable
49+
class NameAndTypeResolver
5250
{
5351
public:
52+
/// Noncopyable.
53+
NameAndTypeResolver(NameAndTypeResolver const&) = delete;
54+
NameAndTypeResolver& operator=(NameAndTypeResolver const&) = delete;
55+
5456
/// Creates the resolver with the given declarations added to the global scope.
5557
/// @param _scopes mapping of scopes to be used (usually default constructed), these
5658
/// are filled during the lifetime of this object.

libsolidity/analysis/ReferencesResolver.h

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
#include <liblangutil/EVMVersion.h>
2929
#include <libyul/optimiser/ASTWalker.h>
3030

31-
#include <boost/noncopyable.hpp>
3231
#include <list>
3332
#include <map>
3433

libsolidity/ast/AST.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include <libsolutil/FixedHash.h>
3535
#include <libsolutil/LazyInit.h>
3636

37-
#include <boost/noncopyable.hpp>
3837
#include <json/json.h>
3938

4039
#include <memory>
@@ -62,9 +61,13 @@ class ASTConstVisitor;
6261
* It is possible to traverse all direct and indirect children of an AST node by calling
6362
* accept, providing an ASTVisitor.
6463
*/
65-
class ASTNode: private boost::noncopyable
64+
class ASTNode
6665
{
6766
public:
67+
/// Noncopyable.
68+
ASTNode(ASTNode const&) = delete;
69+
ASTNode& operator=(ASTNode const&) = delete;
70+
6871
using CompareByID = frontend::ASTCompareByID<ASTNode>;
6972
using SourceLocation = langutil::SourceLocation;
7073

libsolidity/codegen/ExpressionCompiler.h

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include <liblangutil/SourceLocation.h>
3232
#include <libsolutil/Common.h>
3333

34-
#include <boost/noncopyable.hpp>
3534
#include <functional>
3635
#include <memory>
3736

libsolidity/interface/CompilerStack.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@
4545
#include <libsolutil/FixedHash.h>
4646
#include <libsolutil/LazyInit.h>
4747

48-
#include <boost/noncopyable.hpp>
4948
#include <json/json.h>
5049

5150
#include <functional>
@@ -88,9 +87,13 @@ class DeclarationContainer;
8887
* If error recovery is active, it is possible to progress through the stages even when
8988
* there are errors. In any case, producing code is only possible without errors.
9089
*/
91-
class CompilerStack: boost::noncopyable
90+
class CompilerStack
9291
{
9392
public:
93+
/// Noncopyable.
94+
CompilerStack(CompilerStack const&) = delete;
95+
CompilerStack& operator=(CompilerStack const&) = delete;
96+
9497
enum State {
9598
Empty,
9699
SourcesSet,

libsolidity/interface/ReadFile.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,19 @@
2020

2121
#include <liblangutil/Exceptions.h>
2222

23-
#include <boost/noncopyable.hpp>
2423
#include <functional>
2524
#include <string>
2625

2726
namespace solidity::frontend
2827
{
2928

30-
class ReadCallback: boost::noncopyable
29+
class ReadCallback
3130
{
3231
public:
32+
/// Noncopyable.
33+
ReadCallback(ReadCallback const&) = delete;
34+
ReadCallback& operator=(ReadCallback const&) = delete;
35+
3336
/// File reading or generic query result.
3437
struct Result
3538
{

libsolidity/interface/StandardCompiler.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ namespace solidity::frontend
3636
* Standard JSON compiler interface, which expects a JSON input and returns a JSON output.
3737
* See docs/using-the-compiler#compiler-input-and-output-json-description.
3838
*/
39-
class StandardCompiler: boost::noncopyable
39+
class StandardCompiler
4040
{
4141
public:
42+
/// Noncopyable.
43+
StandardCompiler(StandardCompiler const&) = delete;
44+
StandardCompiler& operator=(StandardCompiler const&) = delete;
45+
4246
/// Creates a new StandardCompiler.
4347
/// @param _readFile callback used to read files for import statements. Must return
4448
/// and must not emit exceptions.

libyul/Dialect.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@
2525
#include <libyul/SideEffects.h>
2626
#include <libyul/ControlFlowSideEffects.h>
2727

28-
#include <boost/noncopyable.hpp>
29-
3028
#include <vector>
3129
#include <set>
3230
#include <optional>
@@ -57,8 +55,12 @@ struct BuiltinFunction
5755
}
5856
};
5957

60-
struct Dialect: boost::noncopyable
58+
struct Dialect
6159
{
60+
/// Noncopiable.
61+
Dialect(Dialect const&) = delete;
62+
Dialect& operator=(Dialect const&) = delete;
63+
6264
/// Default type, can be omitted.
6365
YulString defaultType;
6466
/// Type used for the literals "true" and "false".

libyul/YulString.h

-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121

2222
#pragma once
2323

24-
#include <boost/noncopyable.hpp>
25-
2624
#include <unordered_map>
2725
#include <memory>
2826
#include <vector>

libyul/optimiser/SimplificationRules.h

+5-3
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@
3131
#include <liblangutil/EVMVersion.h>
3232
#include <liblangutil/SourceLocation.h>
3333

34-
#include <boost/noncopyable.hpp>
35-
3634
#include <functional>
3735
#include <optional>
3836
#include <vector>
@@ -46,9 +44,13 @@ class Pattern;
4644
/**
4745
* Container for all simplification rules.
4846
*/
49-
class SimplificationRules: public boost::noncopyable
47+
class SimplificationRules
5048
{
5149
public:
50+
/// Noncopiable.
51+
SimplificationRules(SimplificationRules const&) = delete;
52+
SimplificationRules& operator=(SimplificationRules const&) = delete;
53+
5254
using Rule = evmasm::SimplificationRule<Pattern>;
5355

5456
explicit SimplificationRules(std::optional<langutil::EVMVersion> _evmVersion = std::nullopt);

test/Common.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <test/evmc/evmc.h>
2525

2626
#include <boost/filesystem/path.hpp>
27-
#include <boost/noncopyable.hpp>
2827
#include <boost/program_options.hpp>
2928

3029
namespace solidity::test
@@ -49,8 +48,12 @@ static constexpr auto heraDownloadLink = "https://github.com/ewasm/hera/releases
4948

5049
struct ConfigException : public util::Exception {};
5150

52-
struct CommonOptions: boost::noncopyable
51+
struct CommonOptions
5352
{
53+
/// Noncopyable.
54+
CommonOptions(CommonOptions const&) = delete;
55+
CommonOptions& operator=(CommonOptions const&) = delete;
56+
5457
std::vector<boost::filesystem::path> vmPaths;
5558
boost::filesystem::path testPath;
5659
bool ewasm = false;

0 commit comments

Comments
 (0)