diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-07-14 14:08:26 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-07-14 14:50:42 +0100 |
commit | 1347d23e09845b854ce50f8f857c062e04a89b60 (patch) | |
tree | da8647b196c4978fafc48370892356f56ab45e53 /gcc | |
parent | ab9f7f287ef0a775ac6a504d743e20c2f5488f6f (diff) | |
download | gcc-1347d23e09845b854ce50f8f857c062e04a89b60.zip gcc-1347d23e09845b854ce50f8f857c062e04a89b60.tar.gz gcc-1347d23e09845b854ce50f8f857c062e04a89b60.tar.bz2 |
Implement AST dump for ArithmeticOrLogicalExpr to fix unreachable
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-ast-dump.cc | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/gcc/rust/ast/rust-ast-dump.cc b/gcc/rust/ast/rust-ast-dump.cc index a06dd72..f4bff44 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; } |