public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Thomas Schwinge <tschwinge@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org
Subject: [gcc/devel/rust/master] Fix formatting
Date: Wed,  8 Jun 2022 10:39:16 +0000 (GMT)	[thread overview]
Message-ID: <20220608103916.8CAF3383F944@sourceware.org> (raw)

https://gcc.gnu.org/g:6f1035737677dbe38dc6f25f24744fd209d0209c

commit 6f1035737677dbe38dc6f25f24744fd209d0209c
Author: Yizhe <yizhe@pku.edu.cn>
Date:   Fri Feb 26 09:14:16 2021 +0000

    Fix formatting

Diff:
---
 gcc/rust/hir/rust-ast-lower-expr.h      | 19 +++++++++-------
 gcc/rust/hir/tree/rust-hir-full-test.cc | 40 ++++++++++++++++-----------------
 gcc/rust/parse/rust-parse-impl.h        | 34 +++++++++++++++-------------
 gcc/rust/rust-backend.h                 |  4 ++--
 gcc/rust/rust-gcc.cc                    |  7 +++---
 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 6247be09302..7d193709f1a 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 3ced5370be0..fb5f665d436 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 012564936c6..5cbd8a56b65 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 cca341dfa81..183f41a3aa7 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 a19ddae193d..f8033af35f3 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. */


             reply	other threads:[~2022-06-08 10:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-08 10:39 Thomas Schwinge [this message]
2022-06-08 10:44 Thomas Schwinge
2022-06-08 10:46 Thomas Schwinge
2023-03-05 11:40 Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220608103916.8CAF3383F944@sourceware.org \
    --to=tschwinge@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).