Skip to content

Commit

Permalink
Yul: Make Dialect into a class.
Browse files Browse the repository at this point in the history
  • Loading branch information
clonker authored and cameel committed Dec 9, 2024
1 parent 54efdc9 commit 5efaa66
Show file tree
Hide file tree
Showing 43 changed files with 44 additions and 43 deletions.
2 changes: 1 addition & 1 deletion libsolidity/ast/AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace solidity::yul
{
// Forward-declaration to <yul/AST.h>
class AST;
struct Dialect;
class Dialect;
}

namespace solidity::frontend
Expand Down
2 changes: 1 addition & 1 deletion libsolidity/ast/ASTAnnotations.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ namespace solidity::yul
{
struct AsmAnalysisInfo;
struct Identifier;
struct Dialect;
class Dialect;
}

namespace solidity::frontend
Expand Down
2 changes: 1 addition & 1 deletion libyul/AST.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

struct NameWithDebugData { langutil::DebugData::ConstPtr debugData; YulName name; };
using NameWithDebugDataList = std::vector<NameWithDebugData>;
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmJsonConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

/**
* Converter of the yul AST into JSON format
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmJsonImporter.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

/**
* Component that imports an AST from json format to the internal format
Expand Down
2 changes: 1 addition & 1 deletion libyul/AsmPrinter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

/**
* Converts a parsed Yul AST into readable string representation.
Expand Down
2 changes: 1 addition & 1 deletion libyul/ControlFlowSideEffectsCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

struct ControlFlowNode
{
Expand Down
3 changes: 2 additions & 1 deletion libyul/Dialect.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,9 @@ struct BuiltinFunction
}
};

struct Dialect
class Dialect
{
public:
/// Noncopiable.
Dialect(Dialect const&) = delete;
Dialect& operator=(Dialect const&) = delete;
Expand Down
2 changes: 1 addition & 1 deletion libyul/Object.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct AsmAnalysisInfo;

using SourceNameMap = std::map<unsigned, std::shared_ptr<std::string const>>;
Expand Down
2 changes: 1 addition & 1 deletion libyul/Utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
class EVMDialect;
struct BuiltinFunction;
struct BuiltinFunctionForEVM;
Expand Down
2 changes: 1 addition & 1 deletion libyul/backends/evm/ConstantOptimiser.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
class GasMeter;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/CommonSubexpressionEliminator.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
struct SideEffects;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/ControlFlowSimplifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct OptimiserStepContext;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/DataFlowAnalyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct SideEffects;
class KnowledgeBase;

Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/DeadCodeEliminator.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct OptimiserStepContext;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/Disambiguator.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

/**
* Creates a copy of a Yul AST replacing all identifiers by unique names.
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/ExpressionInliner.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct OptimiserStepContext;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/ExpressionSimplifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct OptimiserStepContext;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/ExpressionSplitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
struct OptimiserStepContext;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/FunctionCallFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

/**
* Finds all calls to a function of a given name using an ASTModifier.
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/KnowledgeBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
struct AssignedValue;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/Metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
class EVMDialect;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/NameDispenser.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

/**
* Optimizer component that can be used to generate new names that
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/NameDisplacer.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

/**
* Optimiser component that renames identifiers to free up certain names.
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/NameSimplifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

/**
* Pass to "simplify" all identifier names.
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/OptimiserStep.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
struct Block;
class NameDispenser;

Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/Semantics.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

/**
* Specific AST walker that determines side-effect free-ness and movability of code.
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/SimplificationRules.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
namespace solidity::yul
{
struct AssignedValue;
struct Dialect;
class Dialect;
class EVMDialect;
class Pattern;

Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/StackCompressor.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;
class Object;
struct FunctionDefinition;

Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/Suite.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace solidity::yul
{

struct AsmAnalysisInfo;
struct Dialect;
class Dialect;
class GasMeter;
class Object;

Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/UnusedAssignEliminator.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

/**
* Optimiser component that removes assignments to variables that are not used
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/UnusedPruner.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct SideEffects;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/UnusedStoreBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

/**
* Base class for both UnusedAssignEliminator and UnusedStoreEliminator.
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/UnusedStoreEliminator.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
struct AssignedValue;

/**
Expand Down
2 changes: 1 addition & 1 deletion libyul/optimiser/VarNameCleaner.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
namespace solidity::yul
{

struct Dialect;
class Dialect;

/**
* Pass to normalize identifier suffixes.
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ namespace solidity::yul
struct AsmAnalysisInfo;
struct Block;
class Object;
struct Dialect;
class Dialect;
class AST;
}

Expand Down
2 changes: 1 addition & 1 deletion test/libyul/ControlFlowGraphTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

namespace test
{
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/SSAControlFlowGraphTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

namespace test
{
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/StackLayoutGeneratorTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;

namespace test
{
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/YulOptimizerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace solidity::yul
{
struct AsmAnalysisInfo;
class Object;
struct Dialect;
class Dialect;
}

namespace solidity::yul::test
Expand Down
2 changes: 1 addition & 1 deletion test/libyul/YulOptimizerTestCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ namespace solidity::yul
{
struct AsmAnalysisInfo;
class Object;
struct Dialect;
class Dialect;
class AST;
}

Expand Down
2 changes: 1 addition & 1 deletion test/tools/yulInterpreter/Interpreter.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

namespace solidity::yul
{
struct Dialect;
class Dialect;
}

namespace solidity::yul::test
Expand Down
2 changes: 1 addition & 1 deletion tools/yulPhaser/Program.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace solidity::yul
{

struct AsmAnalysisInfo;
struct Dialect;
class Dialect;
struct CodeWeights;

}
Expand Down

0 comments on commit 5efaa66

Please sign in to comment.