diff options
author | Philip Herron <philip.herron@embecosm.com> | 2021-01-16 18:26:36 +0000 |
---|---|---|
committer | Philip Herron <herron.philip@googlemail.com> | 2021-01-17 14:21:59 +0000 |
commit | 7066c0eca18f99aca3e88a08b2aaf71d970d0ab6 (patch) | |
tree | 6a7626091cb903a168937d15138e998ed5b79d78 /gcc/rust/backend | |
parent | a79e3b31be51d16c6dcc87722d35fe8cc3227355 (diff) | |
download | gcc-7066c0eca18f99aca3e88a08b2aaf71d970d0ab6.zip gcc-7066c0eca18f99aca3e88a08b2aaf71d970d0ab6.tar.gz gcc-7066c0eca18f99aca3e88a08b2aaf71d970d0ab6.tar.bz2 |
Support GroupedExpr's
This makes the expression handling support exprs within parens. Such as:
x = (2*a) + 3;
Diffstat (limited to 'gcc/rust/backend')
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.h b/gcc/rust/backend/rust-compile-expr.h index 0d3d9e8..682ff79 100644 --- a/gcc/rust/backend/rust-compile-expr.h +++ b/gcc/rust/backend/rust-compile-expr.h @@ -428,6 +428,11 @@ public: struct_expr.get_locus ()); } + void visit (HIR::GroupedExpr &expr) + { + translated = CompileExpr::Compile (expr.get_expr_in_parens ().get (), ctx); + } + private: CompileExpr (Context *ctx) : HIRCompileBase (ctx), translated (nullptr) {} |