diff options
author | Jakub Dupak <dev@jakubdupak.com> | 2023-10-17 16:21:56 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:09:24 +0100 |
commit | 68397d0c9baa3d7c8f20e7d132bba8804a55bbc4 (patch) | |
tree | 1e79d2309153c923392847b87abe008a498b34de | |
parent | a45f93039ad201cbdf5d9e0caf4068d39221a220 (diff) | |
download | gcc-68397d0c9baa3d7c8f20e7d132bba8804a55bbc4.zip gcc-68397d0c9baa3d7c8f20e7d132bba8804a55bbc4.tar.gz gcc-68397d0c9baa3d7c8f20e7d132bba8804a55bbc4.tar.bz2 |
gccrs: hir: Rename ComoundAssignment getters
Use more a consistent name.
gcc/rust/ChangeLog:
* backend/rust-compile-expr.cc (CompileExpr::visit): Rename method.
* checks/errors/privacy/rust-privacy-reporter.cc (PrivacyReporter::visit): Rename method.
* checks/errors/rust-const-checker.cc (ConstChecker::visit): Rename method.
* checks/errors/rust-unsafe-checker.cc (UnsafeChecker::visit): Rename method.
* hir/rust-hir-dump.cc (Dump::visit): Rename method.
* hir/tree/rust-hir-expr.h: Rename method.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Rename method.
* typecheck/rust-tyty.h: Rename method.
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 8 | ||||
-rw-r--r-- | gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc | 4 | ||||
-rw-r--r-- | gcc/rust/checks/errors/rust-const-checker.cc | 4 | ||||
-rw-r--r-- | gcc/rust/checks/errors/rust-unsafe-checker.cc | 4 | ||||
-rw-r--r-- | gcc/rust/hir/rust-hir-dump.cc | 2 | ||||
-rw-r--r-- | gcc/rust/hir/tree/rust-hir-expr.h | 4 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-hir-type-check-expr.cc | 10 | ||||
-rw-r--r-- | gcc/rust/typecheck/rust-tyty.h | 2 |
8 files changed, 19 insertions, 19 deletions
diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index b61b46a..acec57d 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -184,8 +184,8 @@ void CompileExpr::visit (HIR::CompoundAssignmentExpr &expr) { auto op = expr.get_expr_type (); - auto lhs = CompileExpr::Compile (expr.get_left_expr ().get (), ctx); - auto rhs = CompileExpr::Compile (expr.get_right_expr ().get (), ctx); + auto lhs = CompileExpr::Compile (expr.get_lhs ().get (), ctx); + auto rhs = CompileExpr::Compile (expr.get_rhs ().get (), ctx); // this might be an operator overload situation lets check TyTy::FnType *fntype; @@ -198,8 +198,8 @@ CompileExpr::visit (HIR::CompoundAssignmentExpr &expr) expr.get_expr_type ()); auto compound_assignment = resolve_operator_overload (lang_item_type, expr, lhs, rhs, - expr.get_left_expr ().get (), - expr.get_right_expr ().get ()); + expr.get_lhs ().get (), + expr.get_rhs ().get ()); ctx->add_statement (compound_assignment); return; diff --git a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc index a6b4477..a4e18cc 100644 --- a/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc +++ b/gcc/rust/checks/errors/privacy/rust-privacy-reporter.cc @@ -375,8 +375,8 @@ PrivacyReporter::visit (HIR::AssignmentExpr &expr) void PrivacyReporter::visit (HIR::CompoundAssignmentExpr &expr) { - expr.get_left_expr ()->accept_vis (*this); - expr.get_right_expr ()->accept_vis (*this); + expr.get_lhs ()->accept_vis (*this); + expr.get_rhs ()->accept_vis (*this); } void diff --git a/gcc/rust/checks/errors/rust-const-checker.cc b/gcc/rust/checks/errors/rust-const-checker.cc index cee5c75..aaf8fc0 100644 --- a/gcc/rust/checks/errors/rust-const-checker.cc +++ b/gcc/rust/checks/errors/rust-const-checker.cc @@ -214,8 +214,8 @@ ConstChecker::visit (AssignmentExpr &expr) void ConstChecker::visit (CompoundAssignmentExpr &expr) { - expr.get_left_expr ()->accept_vis (*this); - expr.get_right_expr ()->accept_vis (*this); + expr.get_lhs ()->accept_vis (*this); + expr.get_rhs ()->accept_vis (*this); } void diff --git a/gcc/rust/checks/errors/rust-unsafe-checker.cc b/gcc/rust/checks/errors/rust-unsafe-checker.cc index 2d106e3..4bad20b 100644 --- a/gcc/rust/checks/errors/rust-unsafe-checker.cc +++ b/gcc/rust/checks/errors/rust-unsafe-checker.cc @@ -327,8 +327,8 @@ UnsafeChecker::visit (AssignmentExpr &expr) void UnsafeChecker::visit (CompoundAssignmentExpr &expr) { - expr.get_left_expr ()->accept_vis (*this); - expr.get_right_expr ()->accept_vis (*this); + expr.get_lhs ()->accept_vis (*this); + expr.get_rhs ()->accept_vis (*this); } void diff --git a/gcc/rust/hir/rust-hir-dump.cc b/gcc/rust/hir/rust-hir-dump.cc index 45729b9..4ce8f33 100644 --- a/gcc/rust/hir/rust-hir-dump.cc +++ b/gcc/rust/hir/rust-hir-dump.cc @@ -983,7 +983,7 @@ Dump::visit (CompoundAssignmentExpr &e) begin ("CompoundAssignmentExpr"); do_operatorexpr (e); - visit_field ("right_expr", *e.get_right_expr ()); + visit_field ("right_expr", *e.get_rhs ()); std::string str; diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h index 645e5db..4c49d94 100644 --- a/gcc/rust/hir/tree/rust-hir-expr.h +++ b/gcc/rust/hir/tree/rust-hir-expr.h @@ -762,9 +762,9 @@ public: void accept_vis (HIRFullVisitor &vis) override; void accept_vis (HIRExpressionVisitor &vis) override; - std::unique_ptr<Expr> &get_left_expr () { return main_or_left_expr; } + std::unique_ptr<Expr> &get_lhs () { return main_or_left_expr; } - std::unique_ptr<Expr> &get_right_expr () { return right_expr; } + std::unique_ptr<Expr> &get_rhs () { return right_expr; } void visit_lhs (HIRFullVisitor &vis) { main_or_left_expr->accept_vis (vis); } void visit_rhs (HIRFullVisitor &vis) { right_expr->accept_vis (vis); } diff --git a/gcc/rust/typecheck/rust-hir-type-check-expr.cc b/gcc/rust/typecheck/rust-hir-type-check-expr.cc index 7bcd87e..9dbf657 100644 --- a/gcc/rust/typecheck/rust-hir-type-check-expr.cc +++ b/gcc/rust/typecheck/rust-hir-type-check-expr.cc @@ -249,16 +249,14 @@ TypeCheckExpr::visit (HIR::CompoundAssignmentExpr &expr) { infered = TyTy::TupleType::get_unit_type (expr.get_mappings ().get_hirid ()); - auto lhs = TypeCheckExpr::Resolve (expr.get_left_expr ().get ()); - auto rhs = TypeCheckExpr::Resolve (expr.get_right_expr ().get ()); + auto lhs = TypeCheckExpr::Resolve (expr.get_lhs ().get ()); + auto rhs = TypeCheckExpr::Resolve (expr.get_rhs ().get ()); // we dont care about the result of the unify from a compound assignment // since this is a unit-type expr coercion_site (expr.get_mappings ().get_hirid (), - TyTy::TyWithLocation (lhs, - expr.get_left_expr ()->get_locus ()), - TyTy::TyWithLocation (rhs, - expr.get_right_expr ()->get_locus ()), + TyTy::TyWithLocation (lhs, expr.get_lhs ()->get_locus ()), + TyTy::TyWithLocation (rhs, expr.get_rhs ()->get_locus ()), expr.get_locus ()); auto lang_item_type diff --git a/gcc/rust/typecheck/rust-tyty.h b/gcc/rust/typecheck/rust-tyty.h index 0858502..8bfa83d 100644 --- a/gcc/rust/typecheck/rust-tyty.h +++ b/gcc/rust/typecheck/rust-tyty.h @@ -1012,6 +1012,8 @@ public: private: TyVar element_type; + // FIXME: I dont think this should be in tyty - tyty should already be const + // evaluated HIR::Expr &capacity_expr; }; |