public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc/devel/rust/master] Implement AST dump for ArithmeticOrLogicalExpr to fix unreachable
@ 2022-07-15 10:58 Thomas Schwinge
0 siblings, 0 replies; only message in thread
From: Thomas Schwinge @ 2022-07-15 10:58 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:1347d23e09845b854ce50f8f857c062e04a89b60
commit 1347d23e09845b854ce50f8f857c062e04a89b60
Author: Philip Herron <philip.herron@embecosm.com>
Date: Thu Jul 14 14:08:26 2022 +0100
Implement AST dump for ArithmeticOrLogicalExpr to fix unreachable
Diff:
---
gcc/rust/ast/rust-ast-dump.cc | 36 ++++++++++++++++++++++++++++++++++--
1 file changed, 34 insertions(+), 2 deletions(-)
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc
index a06dd72abca..f4bff44ae6d 100644
--- a/gcc/rust/ast/rust-ast-dump.cc
+++ b/gcc/rust/ast/rust-ast-dump.cc
@@ -173,8 +173,40 @@ Dump::visit (ArithmeticOrLogicalExpr &expr)
stream << "+";
break;
- default:
- gcc_unreachable ();
+ case ArithmeticOrLogicalOperator::SUBTRACT:
+ stream << "-";
+ break;
+
+ case ArithmeticOrLogicalOperator::MULTIPLY:
+ stream << "*";
+ break;
+
+ case ArithmeticOrLogicalOperator::DIVIDE:
+ stream << "/";
+ break;
+
+ case ArithmeticOrLogicalOperator::MODULUS:
+ stream << "%";
+ break;
+
+ case ArithmeticOrLogicalOperator::BITWISE_AND:
+ stream << "&";
+ break;
+
+ case ArithmeticOrLogicalOperator::BITWISE_OR:
+ stream << "|";
+ break;
+
+ case ArithmeticOrLogicalOperator::BITWISE_XOR:
+ stream << "^";
+ break;
+
+ case ArithmeticOrLogicalOperator::LEFT_SHIFT:
+ stream << "<<";
+ break;
+
+ case ArithmeticOrLogicalOperator::RIGHT_SHIFT:
+ stream << ">>";
break;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-07-15 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-15 10:58 [gcc/devel/rust/master] Implement AST dump for ArithmeticOrLogicalExpr to fix unreachable Thomas Schwinge
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).