aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/backend/rust-compile-expr.cc
diff options
context:
space:
mode:
authorArthur Cohen <arthur.cohen@embecosm.com>2025-04-15 13:34:38 +0200
committerCohenArthur <arthur.cohen@embecosm.com>2025-05-27 11:18:07 +0000
commit70fab4b0ce318ca7de67f5f26726ff5d403025f3 (patch)
tree747db6bc35e9b21906edad33ce71192b1fe96744 /gcc/rust/backend/rust-compile-expr.cc
parent01b433d67a6774007b81258c89b11c2b6c84aaab (diff)
downloadgcc-70fab4b0ce318ca7de67f5f26726ff5d403025f3.zip
gcc-70fab4b0ce318ca7de67f5f26726ff5d403025f3.tar.gz
gcc-70fab4b0ce318ca7de67f5f26726ff5d403025f3.tar.bz2
hir: Add const blocks
gcc/rust/ChangeLog: * hir/tree/rust-hir-expr.h: New classes. * hir/tree/rust-hir-full-decls.h: Likewise. * hir/tree/rust-hir.cc: Handle AnonConst and ConstBlock. * backend/rust-compile-block.cc: Likewise. * backend/rust-compile-block.h: Likewise. * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. * backend/rust-compile-expr.h: Likewise. * checks/errors/borrowck/rust-bir-builder-expr-stmt.cc (ExprStmtBuilder::visit): Likewise. * checks/errors/borrowck/rust-bir-builder-expr-stmt.h: Likewise. * checks/errors/borrowck/rust-bir-builder-lazyboolexpr.h: Likewise. * checks/errors/borrowck/rust-bir-builder-struct.h: Likewise. * checks/errors/borrowck/rust-function-collector.h: Likewise. * checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Likewise. * checks/errors/privacy/rust-privacy-reporter.h: Likewise. * checks/errors/rust-const-checker.cc (ConstChecker::visit): Likewise. * checks/errors/rust-const-checker.h: Likewise. * checks/errors/rust-hir-pattern-analysis.cc (PatternChecker::visit): Likewise. * checks/errors/rust-hir-pattern-analysis.h: Likewise. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Likewise. * checks/errors/rust-unsafe-checker.h: Likewise. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::visit): Likewise. (translate_operand_out): Likewise. (translate_operand_inout): Likewise. (translate_operand_const): Likewise. * hir/rust-ast-lower-expr.h: Likewise. * hir/rust-hir-dump.cc (Dump::visit): Likewise. * hir/rust-hir-dump.h: Likewise. * hir/tree/rust-hir-expr-abstract.h: Likewise. * hir/tree/rust-hir-expr.cc (AnonConst::AnonConst): Likewise. (AnonConst::operator=): Likewise. (ConstBlock::ConstBlock): Likewise. (ConstBlock::operator=): Likewise. * hir/tree/rust-hir-visitor.h: * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise. (typecheck_inline_asm_operand): Likewise. * typecheck/rust-hir-type-check-expr.h: Likewise.
Diffstat (limited to 'gcc/rust/backend/rust-compile-expr.cc')
-rw-r--r--gcc/rust/backend/rust-compile-expr.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc
index 339317d..0f63310 100644
--- a/gcc/rust/backend/rust-compile-expr.cc
+++ b/gcc/rust/backend/rust-compile-expr.cc
@@ -30,6 +30,7 @@
#include "realmpfr.h"
#include "convert.h"
#include "print-tree.h"
+#include "rust-hir-expr.h"
#include "rust-system.h"
#include "rust-tyty.h"
@@ -441,6 +442,18 @@ CompileExpr::visit (HIR::BlockExpr &expr)
}
void
+CompileExpr::visit (HIR::AnonConst &expr)
+{
+ expr.get_inner_expr ().accept_vis (*this);
+}
+
+void
+CompileExpr::visit (HIR::ConstBlock &expr)
+{
+ expr.get_const_expr ().accept_vis (*this);
+}
+
+void
CompileExpr::visit (HIR::UnsafeBlockExpr &expr)
{
expr.get_block_expr ().accept_vis (*this);