diff options
author | Yizhe <yizhe@pku.edu.cn> | 2021-02-26 08:56:00 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-03-01 10:42:27 +0000 |
commit | 875bda0637f587ded1a4e8bfab1703b54eee2b2e (patch) | |
tree | c51272f4fab9e605a774d85352af10e3466b1ac8 /gcc/rust/ast/rust-expr.h | |
parent | 1b857e339dd144e3405a9a5a6f3275a2e56b2f54 (diff) | |
download | gcc-875bda0637f587ded1a4e8bfab1703b54eee2b2e.zip gcc-875bda0637f587ded1a4e8bfab1703b54eee2b2e.tar.gz gcc-875bda0637f587ded1a4e8bfab1703b54eee2b2e.tar.bz2 |
Modify AST and HIR code to use the new enums
Diffstat (limited to 'gcc/rust/ast/rust-expr.h')
-rw-r--r-- | gcc/rust/ast/rust-expr.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/gcc/rust/ast/rust-expr.h b/gcc/rust/ast/rust-expr.h index 9e69998..3de14cc 100644 --- a/gcc/rust/ast/rust-expr.h +++ b/gcc/rust/ast/rust-expr.h @@ -366,9 +366,10 @@ protected: // Unary prefix - or ! negation or NOT operators. class NegationExpr : public OperatorExpr { -private: +public: using ExprType = NegationOperator; +private: /* Note: overload negation via std::ops::Neg and not via std::ops::Not * Negation only works for signed integer and floating-point types, NOT only * works for boolean and integer types (via bitwise NOT) */ @@ -408,9 +409,10 @@ protected: // Infix binary operators. +, -, *, /, %, &, |, ^, <<, >> class ArithmeticOrLogicalExpr : public OperatorExpr { -private: +public: using ExprType = ArithmeticOrLogicalOperator; +private: // Note: overloading trait specified in comments ExprType expr_type; @@ -483,9 +485,10 @@ protected: // Infix binary comparison operators. ==, !=, <, <=, >, >= class ComparisonExpr : public OperatorExpr { -private: - using ExprType = ComparisionOperator; +public: + using ExprType = ComparisonOperator; +private: // Note: overloading trait specified in comments ExprType expr_type; @@ -559,9 +562,10 @@ protected: // Infix binary lazy boolean logical operators && and ||. class LazyBooleanExpr : public OperatorExpr { -private: +public: using ExprType = LazyBooleanOperator; +private: ExprType expr_type; std::unique_ptr<Expr> right_expr; @@ -760,9 +764,10 @@ protected: * expressions. */ class CompoundAssignmentExpr : public OperatorExpr { -private: +public: using ExprType = CompoundAssignmentOperator; +private: // Note: overloading trait specified in comments ExprType expr_type; std::unique_ptr<Expr> right_expr; |