aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYizhe <yizhe@pku.edu.cn>2021-02-26 07:42:39 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-03-01 10:42:27 +0000
commitf0b7bd41383ace6e68c3527ca02cacad1583c63b (patch)
tree0de263aaf1f3a15ab6b1c5c27031aa36bd398699
parentc8af0988598c9cee1204f8eef111e3e89beae14d (diff)
downloadgcc-f0b7bd41383ace6e68c3527ca02cacad1583c63b.zip
gcc-f0b7bd41383ace6e68c3527ca02cacad1583c63b.tar.gz
gcc-f0b7bd41383ace6e68c3527ca02cacad1583c63b.tar.bz2
Fix typo
-rw-r--r--gcc/rust/backend/rust-compile-expr.h2
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h2
-rw-r--r--gcc/rust/operator.h2
-rw-r--r--gcc/rust/rust-backend.h4
-rw-r--r--gcc/rust/rust-gcc.cc22
5 files changed, 16 insertions, 16 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h
index 7d3f9d9..1c20979 100644
--- a/gcc/rust/backend/rust-compile-expr.h
+++ b/gcc/rust/backend/rust-compile-expr.h
@@ -316,7 +316,7 @@ public:
auto location = expr.get_locus ();
translated
- = ctx->get_backend ()->comparision_expression (op, lhs, rhs, location);
+ = ctx->get_backend ()->comparison_expression (op, lhs, rhs, location);
}
void visit (HIR::LazyBooleanExpr &expr)
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index 15c89eb..ad4f7bf 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -475,7 +475,7 @@ protected:
class ComparisonExpr : public OperatorExpr
{
private:
- using ExprType = ComparisionOperator;
+ using ExprType = ComparisonOperator;
// Note: overloading trait specified in comments
ExprType expr_type;
diff --git a/gcc/rust/operator.h b/gcc/rust/operator.h
index 2dd161f..2072dfb 100644
--- a/gcc/rust/operator.h
+++ b/gcc/rust/operator.h
@@ -23,7 +23,7 @@ enum class ArithmeticOrLogicalOperator
RIGHT_SHIFT // std::ops::Shr
};
-enum class ComparisionOperator
+enum class ComparisonOperator
{
EQUAL, // std::cmp::PartialEq::eq
NOT_EQUAL, // std::cmp::PartialEq::ne
diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h
index 394851a..cca341d 100644
--- a/gcc/rust/rust-backend.h
+++ b/gcc/rust/rust-backend.h
@@ -377,8 +377,8 @@ public:
= 0;
// Return an expression for the operation LEFT OP RIGHT.
- // Supported values of OP are enumerated in ComparisionOperator.
- virtual Bexpression *comparision_expression (ComparisionOperator op,
+ // Supported values of OP are enumerated in ComparisonOperator.
+ virtual Bexpression *comparison_expression (ComparisonOperator op,
Bexpression *left,
Bexpression *right, Location)
= 0;
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index 8bdd1b3..a19ddae 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -300,7 +300,7 @@ public:
Bexpression *left,
Bexpression *right, Location);
- Bexpression *comparision_expression (ComparisionOperator op,
+ Bexpression *comparison_expression (ComparisonOperator op,
Bexpression *left, Bexpression *right,
Location);
@@ -1689,21 +1689,21 @@ operator_to_tree_code (ArithmeticOrLogicalOperator op, bool floating_point)
}
static enum tree_code
-operator_to_tree_code (ComparisionOperator op)
+operator_to_tree_code (ComparisonOperator op)
{
switch (op)
{
- case ComparisionOperator::EQUAL:
+ case ComparisonOperator::EQUAL:
return EQ_EXPR;
- case ComparisionOperator::NOT_EQUAL:
+ case ComparisonOperator::NOT_EQUAL:
return NE_EXPR;
- case ComparisionOperator::GREATER_THAN:
+ case ComparisonOperator::GREATER_THAN:
return GT_EXPR;
- case ComparisionOperator::LESS_THAN:
+ case ComparisonOperator::LESS_THAN:
return LT_EXPR;
- case ComparisionOperator::GREATER_OR_EQUAL:
+ case ComparisonOperator::GREATER_OR_EQUAL:
return GE_EXPR;
- case ComparisionOperator::LESS_OR_EQUAL:
+ case ComparisonOperator::LESS_OR_EQUAL:
return LE_EXPR;
default:
gcc_unreachable ();
@@ -1809,9 +1809,9 @@ Gcc_backend::arithmetic_or_logical_expression (ArithmeticOrLogicalOperator op,
return this->make_expression (new_tree);
}
-// Return an expression for the comparision operation LEFT OP RIGHT.
+// Return an expression for the comparison operation LEFT OP RIGHT.
Bexpression *
-Gcc_backend::comparision_expression (ComparisionOperator op, Bexpression *left,
+Gcc_backend::comparison_expression (ComparisonOperator op, Bexpression *left,
Bexpression *right, Location location)
{
/* Check if either expression is an error, in which case we return an error
@@ -1821,7 +1821,7 @@ Gcc_backend::comparision_expression (ComparisionOperator op, Bexpression *left,
if (left_tree == error_mark_node || right_tree == error_mark_node)
return this->error_expression ();
- /* For comparision operators, the resulting type should be boolean. */
+ /* For comparison operators, the resulting type should be boolean. */
auto tree_type = boolean_type_node;
auto tree_code = operator_to_tree_code (op);