(root)/
gcc-13.2.0/
gcc/
rust/
util/
rust-operators.h
       1  // Copyright (C) 2020-2023 Free Software Foundation, Inc.
       2  
       3  // This file is part of GCC.
       4  
       5  // GCC is free software; you can redistribute it and/or modify it under
       6  // the terms of the GNU General Public License as published by the Free
       7  // Software Foundation; either version 3, or (at your option) any later
       8  // version.
       9  
      10  // GCC is distributed in the hope that it will be useful, but WITHOUT ANY
      11  // WARRANTY; without even the implied warranty of MERCHANTABILITY or
      12  // FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
      13  // for more details.
      14  
      15  // You should have received a copy of the GNU General Public License
      16  // along with GCC; see the file COPYING3.  If not see
      17  // <http://www.gnu.org/licenses/>.
      18  
      19  #ifndef RUST_OPERATOR_H
      20  #define RUST_OPERATOR_H
      21  
      22  enum class NegationOperator
      23  {
      24    NEGATE,
      25    NOT
      26  };
      27  
      28  enum class ArithmeticOrLogicalOperator
      29  {
      30    ADD,	       // std::ops::Add
      31    SUBTRACT,    // std::ops::Sub
      32    MULTIPLY,    // std::ops::Mul
      33    DIVIDE,      // std::ops::Div
      34    MODULUS,     // std::ops::Rem
      35    BITWISE_AND, // std::ops::BitAnd
      36    BITWISE_OR,  // std::ops::BitOr
      37    BITWISE_XOR, // std::ops::BitXor
      38    LEFT_SHIFT,  // std::ops::Shl
      39    RIGHT_SHIFT  // std::ops::Shr
      40  };
      41  
      42  enum class ComparisonOperator
      43  {
      44    EQUAL,	    // std::cmp::PartialEq::eq
      45    NOT_EQUAL,	    // std::cmp::PartialEq::ne
      46    GREATER_THAN,	    // std::cmp::PartialEq::gt
      47    LESS_THAN,	    // std::cmp::PartialEq::lt
      48    GREATER_OR_EQUAL, // std::cmp::PartialEq::ge
      49    LESS_OR_EQUAL	    // std::cmp::PartialEq::le
      50  };
      51  
      52  enum class LazyBooleanOperator
      53  {
      54    LOGICAL_OR,
      55    LOGICAL_AND
      56  };
      57  
      58  enum class CompoundAssignmentOperator
      59  {
      60    ADD,	       // std::ops::AddAssign
      61    SUBTRACT,    // std::ops::SubAssign
      62    MULTIPLY,    // std::ops::MulAssign
      63    DIVIDE,      // std::ops::DivAssign
      64    MODULUS,     // std::ops::RemAssign
      65    BITWISE_AND, // std::ops::BitAndAssign
      66    BITWISE_OR,  // std::ops::BitOrAssign
      67    BITWISE_XOR, // std::ops::BitXorAssign
      68    LEFT_SHIFT,  // std::ops::ShlAssign
      69    RIGHT_SHIFT  // std::ops::ShrAssign
      70  };
      71  
      72  #endif // RUST_OPERATOR_H