aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorYizhe <yizhe@pku.edu.cn>2021-02-26 09:14:16 +0000
committerPhilip Herron <herron.philip@googlemail.com>2021-03-01 10:42:27 +0000
commit6f1035737677dbe38dc6f25f24744fd209d0209c (patch)
tree8245702867a2f7abc173a0fe6493d5d8e8474811 /gcc
parent4ebeb3165cfdaa1b95ed39779760b634974a80e5 (diff)
downloadgcc-6f1035737677dbe38dc6f25f24744fd209d0209c.zip
gcc-6f1035737677dbe38dc6f25f24744fd209d0209c.tar.gz
gcc-6f1035737677dbe38dc6f25f24744fd209d0209c.tar.bz2
Fix formatting
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/hir/rust-ast-lower-expr.h19
-rw-r--r--gcc/rust/hir/tree/rust-hir-full-test.cc40
-rw-r--r--gcc/rust/parse/rust-parse-impl.h34
-rw-r--r--gcc/rust/rust-backend.h4
-rw-r--r--gcc/rust/rust-gcc.cc7
5 files changed, 54 insertions, 50 deletions
diff --git a/gcc/rust/hir/rust-ast-lower-expr.h b/gcc/rust/hir/rust-ast-lower-expr.h
index 6247be0..7d19370 100644
--- a/gcc/rust/hir/rust-ast-lower-expr.h
+++ b/gcc/rust/hir/rust-ast-lower-expr.h
@@ -402,7 +402,8 @@ public:
= new HIR::ArithmeticOrLogicalExpr (mapping,
std::unique_ptr<HIR::Expr> (lhs),
std::unique_ptr<HIR::Expr> (rhs),
- expr.get_expr_type(), expr.get_locus ());
+ expr.get_expr_type (),
+ expr.get_locus ());
}
void visit (AST::ComparisonExpr &expr)
@@ -419,8 +420,8 @@ public:
translated
= new HIR::ComparisonExpr (mapping, std::unique_ptr<HIR::Expr> (lhs),
- std::unique_ptr<HIR::Expr> (rhs), expr.get_expr_type(),
- expr.get_locus ());
+ std::unique_ptr<HIR::Expr> (rhs),
+ expr.get_expr_type (), expr.get_locus ());
}
void visit (AST::LazyBooleanExpr &expr)
@@ -437,8 +438,8 @@ public:
translated
= new HIR::LazyBooleanExpr (mapping, std::unique_ptr<HIR::Expr> (lhs),
- std::unique_ptr<HIR::Expr> (rhs), expr.get_expr_type(),
- expr.get_locus ());
+ std::unique_ptr<HIR::Expr> (rhs),
+ expr.get_expr_type (), expr.get_locus ());
}
void visit (AST::NegationExpr &expr)
@@ -454,14 +455,16 @@ public:
UNKNOWN_LOCAL_DEFID);
translated
= new HIR::NegationExpr (mapping,
- std::unique_ptr<HIR::Expr> (negated_value), expr.get_expr_type(),
- std::move (outer_attribs), expr.get_locus ());
+ std::unique_ptr<HIR::Expr> (negated_value),
+ expr.get_expr_type (), std::move (outer_attribs),
+ expr.get_locus ());
}
/* Compound assignment expression is compiled away. */
void visit (AST::CompoundAssignmentExpr &expr)
{
- /* First we need to find the corresponding arithmetic or logical operator. */
+ /* First we need to find the corresponding arithmetic or logical operator.
+ */
ArithmeticOrLogicalOperator op;
switch (expr.get_expr_type ())
{
diff --git a/gcc/rust/hir/tree/rust-hir-full-test.cc b/gcc/rust/hir/tree/rust-hir-full-test.cc
index 3ced537..fb5f665 100644
--- a/gcc/rust/hir/tree/rust-hir-full-test.cc
+++ b/gcc/rust/hir/tree/rust-hir-full-test.cc
@@ -1687,10 +1687,10 @@ NegationExpr::as_string () const
switch (expr_type)
{
- case NegationOperator::NEGATE:
+ case NegationOperator::NEGATE:
str = "-";
break;
- case NegationOperator::NOT:
+ case NegationOperator::NOT:
str = "!";
break;
default:
@@ -1748,22 +1748,22 @@ ComparisonExpr::as_string () const
switch (expr_type)
{
- case ComparisonOperator::EQUAL:
+ case ComparisonOperator::EQUAL:
str += " == ";
break;
- case ComparisonOperator::NOT_EQUAL:
+ case ComparisonOperator::NOT_EQUAL:
str += " != ";
break;
- case ComparisonOperator::GREATER_THAN:
+ case ComparisonOperator::GREATER_THAN:
str += " > ";
break;
- case ComparisonOperator::LESS_THAN:
+ case ComparisonOperator::LESS_THAN:
str += " < ";
break;
- case ComparisonOperator::GREATER_OR_EQUAL:
+ case ComparisonOperator::GREATER_OR_EQUAL:
str += " >= ";
break;
- case ComparisonOperator::LESS_OR_EQUAL:
+ case ComparisonOperator::LESS_OR_EQUAL:
str += " <= ";
break;
default:
@@ -1832,10 +1832,10 @@ LazyBooleanExpr::as_string () const
switch (expr_type)
{
- case LazyBooleanOperator::LOGICAL_OR:
+ case LazyBooleanOperator::LOGICAL_OR:
str += " || ";
break;
- case LazyBooleanOperator::LOGICAL_AND:
+ case LazyBooleanOperator::LOGICAL_AND:
str += " && ";
break;
default:
@@ -2000,34 +2000,34 @@ ArithmeticOrLogicalExpr::as_string () const
// get operator string
switch (expr_type)
{
- case ArithmeticOrLogicalOperator::ADD:
+ case ArithmeticOrLogicalOperator::ADD:
operator_str = "+";
break;
- case ArithmeticOrLogicalOperator::SUBTRACT:
+ case ArithmeticOrLogicalOperator::SUBTRACT:
operator_str = "-";
break;
- case ArithmeticOrLogicalOperator::MULTIPLY:
+ case ArithmeticOrLogicalOperator::MULTIPLY:
operator_str = "*";
break;
- case ArithmeticOrLogicalOperator::DIVIDE:
+ case ArithmeticOrLogicalOperator::DIVIDE:
operator_str = "/";
break;
- case ArithmeticOrLogicalOperator::MODULUS:
+ case ArithmeticOrLogicalOperator::MODULUS:
operator_str = "%";
break;
- case ArithmeticOrLogicalOperator::BITWISE_AND:
+ case ArithmeticOrLogicalOperator::BITWISE_AND:
operator_str = "&";
break;
- case ArithmeticOrLogicalOperator::BITWISE_OR:
+ case ArithmeticOrLogicalOperator::BITWISE_OR:
operator_str = "|";
break;
- case ArithmeticOrLogicalOperator::BITWISE_XOR:
+ case ArithmeticOrLogicalOperator::BITWISE_XOR:
operator_str = "^";
break;
- case ArithmeticOrLogicalOperator::LEFT_SHIFT:
+ case ArithmeticOrLogicalOperator::LEFT_SHIFT:
operator_str = "<<";
break;
- case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
+ case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
operator_str = ">>";
break;
default:
diff --git a/gcc/rust/parse/rust-parse-impl.h b/gcc/rust/parse/rust-parse-impl.h
index 0125649..5cbd8a5 100644
--- a/gcc/rust/parse/rust-parse-impl.h
+++ b/gcc/rust/parse/rust-parse-impl.h
@@ -12528,9 +12528,10 @@ Parser<ManagedTokenSource>::left_denotation (
// sum expression - binary infix
/*return parse_binary_plus_expr (tok, std::move (left),
std::move (outer_attrs), restrictions);*/
- return parse_arithmetic_or_logical_expr (
- tok, std::move (left), std::move (outer_attrs),
- ArithmeticOrLogicalOperator::ADD, restrictions);
+ return parse_arithmetic_or_logical_expr (tok, std::move (left),
+ std::move (outer_attrs),
+ ArithmeticOrLogicalOperator::ADD,
+ restrictions);
case MINUS:
// difference expression - binary infix
/*return parse_binary_minus_expr (tok, std::move (left),
@@ -12600,8 +12601,7 @@ Parser<ManagedTokenSource>::left_denotation (
std::move (outer_attrs), restrictions);*/
return parse_comparison_expr (tok, std::move (left),
std::move (outer_attrs),
- ComparisonOperator::EQUAL,
- restrictions);
+ ComparisonOperator::EQUAL, restrictions);
case NOT_EQUAL:
// not equal to expression - binary infix (no associativity)
/*return parse_binary_not_equal_expr (tok, std::move (left),
@@ -12634,17 +12634,19 @@ Parser<ManagedTokenSource>::left_denotation (
/*return parse_binary_greater_equal_expr (tok, std::move (left),
std::move (outer_attrs),
restrictions);*/
- return parse_comparison_expr (
- tok, std::move (left), std::move (outer_attrs),
- ComparisonOperator::GREATER_OR_EQUAL, restrictions);
+ return parse_comparison_expr (tok, std::move (left),
+ std::move (outer_attrs),
+ ComparisonOperator::GREATER_OR_EQUAL,
+ restrictions);
case LESS_OR_EQUAL:
// less than or equal to expression - binary infix (no associativity)
/*return parse_binary_less_equal_expr (tok, std::move (left),
std::move (outer_attrs),
restrictions);*/
- return parse_comparison_expr (
- tok, std::move (left), std::move (outer_attrs),
- ComparisonOperator::LESS_OR_EQUAL, restrictions);
+ return parse_comparison_expr (tok, std::move (left),
+ std::move (outer_attrs),
+ ComparisonOperator::LESS_OR_EQUAL,
+ restrictions);
case OR:
// lazy logical or expression - binary infix
return parse_lazy_or_expr (tok, std::move (left), std::move (outer_attrs),
@@ -12692,9 +12694,10 @@ Parser<ManagedTokenSource>::left_denotation (
* associativity) */
/*return parse_div_assig_expr (tok, std::move (left),
std::move (outer_attrs), restrictions);*/
- return parse_compound_assignment_expr (
- tok, std::move (left), std::move (outer_attrs),
- CompoundAssignmentOperator::DIVIDE, restrictions);
+ return parse_compound_assignment_expr (tok, std::move (left),
+ std::move (outer_attrs),
+ CompoundAssignmentOperator::DIVIDE,
+ restrictions);
case PERCENT_EQ:
/* modulo-assignment expression - binary infix (note right-to-left
* associativity) */
@@ -12901,8 +12904,7 @@ Parser<ManagedTokenSource>::parse_binary_plus_expr (
return std::unique_ptr<AST::ArithmeticOrLogicalExpr> (
new AST::ArithmeticOrLogicalExpr (std::move (left), std::move (right),
- ArithmeticOrLogicalOperator::ADD,
- locus));
+ ArithmeticOrLogicalOperator::ADD, locus));
}
// Parses a binary subtraction expression (with Pratt parsing).
diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h
index cca341d..183f41a 100644
--- a/gcc/rust/rust-backend.h
+++ b/gcc/rust/rust-backend.h
@@ -379,8 +379,8 @@ public:
// Return an expression for the operation LEFT OP RIGHT.
// Supported values of OP are enumerated in ComparisonOperator.
virtual Bexpression *comparison_expression (ComparisonOperator op,
- Bexpression *left,
- Bexpression *right, Location)
+ Bexpression *left,
+ Bexpression *right, Location)
= 0;
// Return an expression for the operation LEFT OP RIGHT.
diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc
index a19ddae..f8033af 100644
--- a/gcc/rust/rust-gcc.cc
+++ b/gcc/rust/rust-gcc.cc
@@ -300,9 +300,8 @@ public:
Bexpression *left,
Bexpression *right, Location);
- Bexpression *comparison_expression (ComparisonOperator op,
- Bexpression *left, Bexpression *right,
- Location);
+ Bexpression *comparison_expression (ComparisonOperator op, Bexpression *left,
+ Bexpression *right, Location);
Bexpression *lazy_boolean_expression (LazyBooleanOperator op,
Bexpression *left, Bexpression *right,
@@ -1812,7 +1811,7 @@ Gcc_backend::arithmetic_or_logical_expression (ArithmeticOrLogicalOperator op,
// Return an expression for the comparison operation LEFT OP RIGHT.
Bexpression *
Gcc_backend::comparison_expression (ComparisonOperator op, Bexpression *left,
- Bexpression *right, Location location)
+ Bexpression *right, Location location)
{
/* Check if either expression is an error, in which case we return an error
expression. */