diff options
author | Marc Poulhiès <dkm@kataplop.net> | 2023-05-28 22:10:35 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:49:29 +0100 |
commit | 96065850ce78f2689c2a3c3d4816c7a7043d062b (patch) | |
tree | 4466d0f1968a4cc04476b638e4446e8a6ae2fa70 /gcc/rust/backend/rust-compile-struct-field-expr.cc | |
parent | fae1e3bcef1a24321c720ed14011363a7aae06fd (diff) | |
download | gcc-96065850ce78f2689c2a3c3d4816c7a7043d062b.zip gcc-96065850ce78f2689c2a3c3d4816c7a7043d062b.tar.gz gcc-96065850ce78f2689c2a3c3d4816c7a7043d062b.tar.bz2 |
gccrs: cleanup getters to return &unique_ptr instead of pointer
Make all getter methods in HIR classes return a unique_ptr reference
instead of a pointer and adjust all callers.
gcc/rust/ChangeLog:
* hir/tree/rust-hir-type.h (ArrayType::get_element_type): Returns
unique_ptr.
* hir/tree/rust-hir-expr.h (ArithmeticOrLogicalExpr::get_lhs)
(ArithmeticOrLogicalExpr::get_rhs): Likewise.
(ComparisonExpr::get_lhs, ComparisonExpr::get_rhs): Likewise.
(LazyBooleanExpr::get_lhs, LazyBooleanExpr::get_rhs): Likewise.
(AssignmentExpr::get_lhs, AssignmentExpr::get_rhs): Likewise.
(ArrayExpr::get_internal_elements): Likewise.
(ArrayIndexExpr::get_index_expr, ArrayIndexExpr::get_array_expr):
Likewise.
(StructExprFieldWithVal::get_value): Likewise.
(IfExpr::get_if_condition, IfExpr::get_if_block): Likewise.
(ExprWithBlock::get_else_block): Likewise.
* hir/tree/rust-hir-item.h (FunctionParam::get_param_name)
(FunctionParam::get_type): Likewise.
(ConstantItem::get_type, ConstantItem::get_expr): Likewise.
(StaticItem::get_expr, StaticItem::get_type): Likewise.
* typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit):
Adjust for previous change.
* backend/rust-compile-block.cc (CompileConditionalBlocks::visit):
Likewise.
* backend/rust-compile-expr.cc (CompileExpr::visit): Likewise.
* backend/rust-compile-item.cc (CompileItem::visit): Likewise.
* backend/rust-compile-struct-field-expr.cc
(CompileStructExprField::visit): Likewise.
* checks/errors/privacy/rust-privacy-reporter.cc
(PrivacyReporter::visit): Likewise.
* typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit):
Likewise.
* typecheck/rust-hir-type-check-implitem.cc
(TypeCheckImplItem::visit): Likewise.
* typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit):
Likewise.
* typecheck/rust-hir-type-check-stmt.cc (TypeCheckStmt::visit):
Likewise.
* typecheck/rust-hir-type-check-struct.cc
(TypeCheckStructExpr::visit): Likewise.
* typecheck/rust-hir-type-check.cc
(TraitItemReference::get_type_from_fn): Likewise.
Signed-off-by: Marc Poulhiès <dkm@kataplop.net>
Diffstat (limited to 'gcc/rust/backend/rust-compile-struct-field-expr.cc')
-rw-r--r-- | gcc/rust/backend/rust-compile-struct-field-expr.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/rust/backend/rust-compile-struct-field-expr.cc b/gcc/rust/backend/rust-compile-struct-field-expr.cc index ca14bff..d642e28 100644 --- a/gcc/rust/backend/rust-compile-struct-field-expr.cc +++ b/gcc/rust/backend/rust-compile-struct-field-expr.cc @@ -51,13 +51,13 @@ CompileStructExprField::Compile (HIR::StructExprField *field, Context *ctx) void CompileStructExprField::visit (HIR::StructExprFieldIdentifierValue &field) { - translated = CompileExpr::Compile (field.get_value (), ctx); + translated = CompileExpr::Compile (field.get_value ().get (), ctx); } void CompileStructExprField::visit (HIR::StructExprFieldIndexValue &field) { - translated = CompileExpr::Compile (field.get_value (), ctx); + translated = CompileExpr::Compile (field.get_value ().get (), ctx); } void |