ast: Remove pointless deleted copy constructors
ast::Node has a deleted copy constructor, so the derived classes cannot be implicitly copied. Change-Id: I57f74a4ab35dd00b3290b964cb6492f4fa4505a5 Reviewed-on: https://dawn-review.googlesource.com/c/tint/+/66602 Commit-Queue: Ben Clayton <bclayton@google.com> Kokoro: Ben Clayton <bclayton@google.com> Kokoro: Kokoro <noreply+kokoro@google.com> Reviewed-by: James Price <jrprice@google.com>
This commit is contained in:
parent
4f3ff57c28
commit
2bd1321133
|
@ -48,9 +48,6 @@ class ArrayAccessorExpression
|
||||||
|
|
||||||
/// the index expression
|
/// the index expression
|
||||||
Expression* const index;
|
Expression* const index;
|
||||||
|
|
||||||
private:
|
|
||||||
ArrayAccessorExpression(const ArrayAccessorExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -48,9 +48,6 @@ class AssignmentStatement : public Castable<AssignmentStatement, Statement> {
|
||||||
|
|
||||||
/// right side expression
|
/// right side expression
|
||||||
Expression* const rhs;
|
Expression* const rhs;
|
||||||
|
|
||||||
private:
|
|
||||||
AssignmentStatement(const AssignmentStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -118,9 +118,6 @@ class BinaryExpression : public Castable<BinaryExpression, Expression> {
|
||||||
Expression* const lhs;
|
Expression* const lhs;
|
||||||
/// the right side expression
|
/// the right side expression
|
||||||
Expression* const rhs;
|
Expression* const rhs;
|
||||||
|
|
||||||
private:
|
|
||||||
BinaryExpression(const BinaryExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
inline bool BinaryExpression::IsArithmetic() const {
|
inline bool BinaryExpression::IsArithmetic() const {
|
||||||
|
|
|
@ -49,9 +49,6 @@ class BitcastExpression : public Castable<BitcastExpression, Expression> {
|
||||||
ast::Type* const type;
|
ast::Type* const type;
|
||||||
/// the expression
|
/// the expression
|
||||||
Expression* const expr;
|
Expression* const expr;
|
||||||
|
|
||||||
private:
|
|
||||||
BitcastExpression(const BitcastExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -52,9 +52,6 @@ class BlockStatement : public Castable<BlockStatement, Statement> {
|
||||||
|
|
||||||
/// the statement list
|
/// the statement list
|
||||||
StatementList const statements;
|
StatementList const statements;
|
||||||
|
|
||||||
private:
|
|
||||||
BlockStatement(const BlockStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -36,9 +36,6 @@ class BreakStatement : public Castable<BreakStatement, Statement> {
|
||||||
/// @param ctx the clone context
|
/// @param ctx the clone context
|
||||||
/// @return the newly cloned node
|
/// @return the newly cloned node
|
||||||
BreakStatement* Clone(CloneContext* ctx) const override;
|
BreakStatement* Clone(CloneContext* ctx) const override;
|
||||||
|
|
||||||
private:
|
|
||||||
BreakStatement(const BreakStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -49,9 +49,6 @@ class CallExpression : public Castable<CallExpression, Expression> {
|
||||||
IdentifierExpression* const func;
|
IdentifierExpression* const func;
|
||||||
/// The arguments
|
/// The arguments
|
||||||
ExpressionList const args;
|
ExpressionList const args;
|
||||||
|
|
||||||
private:
|
|
||||||
CallExpression(const CallExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -41,9 +41,6 @@ class CallStatement : public Castable<CallStatement, Statement> {
|
||||||
|
|
||||||
/// The call expression
|
/// The call expression
|
||||||
CallExpression* const expr;
|
CallExpression* const expr;
|
||||||
|
|
||||||
private:
|
|
||||||
CallStatement(const CallStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -56,9 +56,6 @@ class CaseStatement : public Castable<CaseStatement, Statement> {
|
||||||
|
|
||||||
/// The case body
|
/// The case body
|
||||||
BlockStatement* const body;
|
BlockStatement* const body;
|
||||||
|
|
||||||
private:
|
|
||||||
CaseStatement(const CaseStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of case statements
|
/// A list of case statements
|
||||||
|
|
|
@ -33,9 +33,6 @@ class ConstructorExpression
|
||||||
ConstructorExpression(ProgramID pid, const Source& src);
|
ConstructorExpression(ProgramID pid, const Source& src);
|
||||||
/// Move constructor
|
/// Move constructor
|
||||||
ConstructorExpression(ConstructorExpression&&);
|
ConstructorExpression(ConstructorExpression&&);
|
||||||
|
|
||||||
private:
|
|
||||||
ConstructorExpression(const ConstructorExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -36,9 +36,6 @@ class ContinueStatement : public Castable<ContinueStatement, Statement> {
|
||||||
/// @param ctx the clone context
|
/// @param ctx the clone context
|
||||||
/// @return the newly cloned node
|
/// @return the newly cloned node
|
||||||
ContinueStatement* Clone(CloneContext* ctx) const override;
|
ContinueStatement* Clone(CloneContext* ctx) const override;
|
||||||
|
|
||||||
private:
|
|
||||||
ContinueStatement(const ContinueStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -36,9 +36,6 @@ class DiscardStatement : public Castable<DiscardStatement, Statement> {
|
||||||
/// @param ctx the clone context
|
/// @param ctx the clone context
|
||||||
/// @return the newly cloned node
|
/// @return the newly cloned node
|
||||||
DiscardStatement* Clone(CloneContext* ctx) const override;
|
DiscardStatement* Clone(CloneContext* ctx) const override;
|
||||||
|
|
||||||
private:
|
|
||||||
DiscardStatement(const DiscardStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -50,9 +50,6 @@ class ElseStatement : public Castable<ElseStatement, Statement> {
|
||||||
|
|
||||||
/// The else body
|
/// The else body
|
||||||
BlockStatement* const body;
|
BlockStatement* const body;
|
||||||
|
|
||||||
private:
|
|
||||||
ElseStatement(const ElseStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of else statements
|
/// A list of else statements
|
||||||
|
|
|
@ -36,9 +36,6 @@ class Expression : public Castable<Expression, Node> {
|
||||||
Expression(ProgramID pid, const Source& src);
|
Expression(ProgramID pid, const Source& src);
|
||||||
/// Move constructor
|
/// Move constructor
|
||||||
Expression(Expression&&);
|
Expression(Expression&&);
|
||||||
|
|
||||||
private:
|
|
||||||
Expression(const Expression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of expressions
|
/// A list of expressions
|
||||||
|
|
|
@ -36,9 +36,6 @@ class FallthroughStatement : public Castable<FallthroughStatement, Statement> {
|
||||||
/// @param ctx the clone context
|
/// @param ctx the clone context
|
||||||
/// @return the newly cloned node
|
/// @return the newly cloned node
|
||||||
FallthroughStatement* Clone(CloneContext* ctx) const override;
|
FallthroughStatement* Clone(CloneContext* ctx) const override;
|
||||||
|
|
||||||
private:
|
|
||||||
FallthroughStatement(const FallthroughStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -59,9 +59,6 @@ class ForLoopStatement : public Castable<ForLoopStatement, Statement> {
|
||||||
|
|
||||||
/// The loop body block
|
/// The loop body block
|
||||||
BlockStatement* const body;
|
BlockStatement* const body;
|
||||||
|
|
||||||
private:
|
|
||||||
ForLoopStatement(const ForLoopStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -86,9 +86,6 @@ class Function : public Castable<Function, Node> {
|
||||||
|
|
||||||
/// The decorations attached to the function return type.
|
/// The decorations attached to the function return type.
|
||||||
DecorationList const return_type_decorations;
|
DecorationList const return_type_decorations;
|
||||||
|
|
||||||
private:
|
|
||||||
Function(const Function&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of functions
|
/// A list of functions
|
||||||
|
|
|
@ -40,9 +40,6 @@ class IdentifierExpression : public Castable<IdentifierExpression, Expression> {
|
||||||
|
|
||||||
/// The symbol for the identifier
|
/// The symbol for the identifier
|
||||||
Symbol const symbol;
|
Symbol const symbol;
|
||||||
|
|
||||||
private:
|
|
||||||
IdentifierExpression(const IdentifierExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -54,9 +54,6 @@ class IfStatement : public Castable<IfStatement, Statement> {
|
||||||
|
|
||||||
/// The else statements
|
/// The else statements
|
||||||
ElseStatementList const else_statements;
|
ElseStatementList const else_statements;
|
||||||
|
|
||||||
private:
|
|
||||||
IfStatement(const IfStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -47,9 +47,6 @@ class LoopStatement : public Castable<LoopStatement, Statement> {
|
||||||
|
|
||||||
/// The continuing statements
|
/// The continuing statements
|
||||||
BlockStatement* const continuing;
|
BlockStatement* const continuing;
|
||||||
|
|
||||||
private:
|
|
||||||
LoopStatement(const LoopStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -48,9 +48,6 @@ class MemberAccessorExpression
|
||||||
|
|
||||||
/// The member expression
|
/// The member expression
|
||||||
IdentifierExpression* const member;
|
IdentifierExpression* const member;
|
||||||
|
|
||||||
private:
|
|
||||||
MemberAccessorExpression(const MemberAccessorExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -46,9 +46,6 @@ class ReturnStatement : public Castable<ReturnStatement, Statement> {
|
||||||
|
|
||||||
/// The value returned. May be null.
|
/// The value returned. May be null.
|
||||||
Expression* const value;
|
Expression* const value;
|
||||||
|
|
||||||
private:
|
|
||||||
ReturnStatement(const ReturnStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -44,9 +44,6 @@ class ScalarConstructorExpression
|
||||||
|
|
||||||
/// The literal value
|
/// The literal value
|
||||||
Literal* const literal;
|
Literal* const literal;
|
||||||
|
|
||||||
private:
|
|
||||||
ScalarConstructorExpression(const ScalarConstructorExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -37,9 +37,6 @@ class Statement : public Castable<Statement, Node> {
|
||||||
Statement(ProgramID pid, const Source& src);
|
Statement(ProgramID pid, const Source& src);
|
||||||
/// Move constructor
|
/// Move constructor
|
||||||
Statement(Statement&&);
|
Statement(Statement&&);
|
||||||
|
|
||||||
private:
|
|
||||||
Statement(const Statement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of statements
|
/// A list of statements
|
||||||
|
|
|
@ -58,9 +58,6 @@ class Struct : public Castable<Struct, TypeDecl> {
|
||||||
|
|
||||||
/// The struct decorations
|
/// The struct decorations
|
||||||
DecorationList const decorations;
|
DecorationList const decorations;
|
||||||
|
|
||||||
private:
|
|
||||||
Struct(const Struct&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -59,9 +59,6 @@ class StructMember : public Castable<StructMember, Node> {
|
||||||
|
|
||||||
/// The decorations
|
/// The decorations
|
||||||
DecorationList const decorations;
|
DecorationList const decorations;
|
||||||
|
|
||||||
private:
|
|
||||||
StructMember(const StructMember&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of struct members
|
/// A list of struct members
|
||||||
|
|
|
@ -51,8 +51,6 @@ class SwitchStatement : public Castable<SwitchStatement, Statement> {
|
||||||
|
|
||||||
/// The Switch body
|
/// The Switch body
|
||||||
CaseStatementList const body;
|
CaseStatementList const body;
|
||||||
|
|
||||||
private:
|
|
||||||
SwitchStatement(const SwitchStatement&) = delete;
|
SwitchStatement(const SwitchStatement&) = delete;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,6 @@ class TypeConstructorExpression
|
||||||
|
|
||||||
/// The values
|
/// The values
|
||||||
ExpressionList const values;
|
ExpressionList const values;
|
||||||
|
|
||||||
private:
|
|
||||||
TypeConstructorExpression(const TypeConstructorExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -37,10 +37,6 @@ class TypeDecl : public Castable<TypeDecl, Node> {
|
||||||
|
|
||||||
/// The name of the type declaration
|
/// The name of the type declaration
|
||||||
Symbol const name;
|
Symbol const name;
|
||||||
|
|
||||||
private:
|
|
||||||
TypeDecl(const TypeDecl&) = delete;
|
|
||||||
TypeDecl& operator=(const TypeDecl&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -48,9 +48,6 @@ class UnaryOpExpression : public Castable<UnaryOpExpression, Expression> {
|
||||||
|
|
||||||
/// The expression
|
/// The expression
|
||||||
Expression* const expr;
|
Expression* const expr;
|
||||||
|
|
||||||
private:
|
|
||||||
UnaryOpExpression(const UnaryOpExpression&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
|
@ -152,9 +152,6 @@ class Variable : public Castable<Variable, Node> {
|
||||||
|
|
||||||
/// The declared access control
|
/// The declared access control
|
||||||
Access const declared_access;
|
Access const declared_access;
|
||||||
|
|
||||||
private:
|
|
||||||
Variable(const Variable&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// A list of variables
|
/// A list of variables
|
||||||
|
|
|
@ -44,9 +44,6 @@ class VariableDeclStatement
|
||||||
|
|
||||||
/// The variable
|
/// The variable
|
||||||
Variable* const variable;
|
Variable* const variable;
|
||||||
|
|
||||||
private:
|
|
||||||
VariableDeclStatement(const VariableDeclStatement&) = delete;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ast
|
} // namespace ast
|
||||||
|
|
Loading…
Reference in New Issue