Skip to content

Commit 8a72566

Browse files
P-E-PCohenArthur
authored andcommitted
Change singleton returned type to a reference
We do not need a raw pointer for this singleton, nor we need having it on the heap through a smart pointer. gcc/rust/ChangeLog: * ast/rust-ast.h: Change dereference from a pointer to a reference accessor. * ast/rust-expr.h: Likewise. * ast/rust-item.h: Likewise. * ast/rust-macro.h: Likewise. * ast/rust-path.h: Likewise. * ast/rust-pattern.h: Likewise. * ast/rust-type.h: Likewise. * backend/rust-compile-base.cc (HIRCompileBase::resolve_method_address): Likewise. * backend/rust-compile-context.h: Likewise. * backend/rust-compile-expr.cc (CompileExpr::visit): Likewise. (CompileExpr::generate_closure_function): Likewise. * backend/rust-compile-extern.h: Likewise. * backend/rust-compile-implitem.cc (CompileTraitItem::visit): Likewise. * backend/rust-compile-intrinsic.cc (Intrinsics::compile): Likewise. * backend/rust-compile-item.cc (CompileItem::visit): Likewise. * backend/rust-compile-resolve-path.cc (ResolvePathRef::resolve): Likewise. (HIRCompileBase::query_compile): Likewise. * backend/rust-compile-type.cc (TyTyResolveCompile::visit): Likewise. (TyTyResolveCompile::create_dyn_obj_record): Likewise. * backend/rust-compile.cc (HIRCompileBase::coerce_to_dyn_object): Likewise. * backend/rust-mangle-v0.cc (v0_path): Likewise. (v0_mangle_item): Likewise. * checks/errors/borrowck/rust-borrow-checker.cc (BorrowChecker::go): Likewise. * checks/errors/privacy/rust-privacy-check.cc (Resolver::resolve): Likewise. * checks/errors/rust-const-checker.cc (ConstChecker::ConstChecker): Likewise. * checks/errors/rust-unsafe-checker.cc (UnsafeChecker::UnsafeChecker): Likewise. * checks/lints/rust-lint-marklive-base.h: Likewise. * checks/lints/rust-lint-marklive.cc (MarkLive::go): Likewise. (MarkLive::visit): Likewise. (MarkLive::visit_path_segment): Likewise. * checks/lints/rust-lint-marklive.h: Likewise. * checks/lints/rust-lint-scan-deadcode.h: Likewise. * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Likewise. * expand/rust-macro-expand.h (struct MacroExpander): Change mapping from pointer to a reference. * expand/rust-proc-macro.cc (BangProcMacro::BangProcMacro): Replace pointer accessor with reference accessor. (AttributeProcMacro::AttributeProcMacro): Likewise. (CustomDeriveProcMacro::CustomDeriveProcMacro): Likewise. * hir/rust-ast-lower-base.cc (ASTLoweringBase::lower_lifetime): Likewise. (ASTLoweringBase::lower_loop_label): Likewise. (ASTLoweringBase::lower_path_expr_seg): Likewise. (ASTLoweringBase::lower_self): Likewise. (ASTLoweringBase::handle_lang_item_attribute): Likewise. (ASTLoweringBase::lower_extern_block): Likewise. (ASTLoweringBase::lower_macro_definition): Likewise. * hir/rust-ast-lower-base.h: Likewise. * hir/rust-ast-lower-block.h: Likewise. * hir/rust-ast-lower-enumitem.h: Likewise. * hir/rust-ast-lower-expr.cc (ASTLoweringExpr::translate): Likewise. (ASTLoweringExpr::visit): Likewise. * hir/rust-ast-lower-extern.h: Likewise. * hir/rust-ast-lower-implitem.cc (ASTLowerImplItem::translate): Likewise. (ASTLowerImplItem::visit): Likewise. (ASTLowerTraitItem::translate): Likewise. (ASTLowerTraitItem::visit): Likewise. * hir/rust-ast-lower-item.cc (ASTLoweringItem::translate): Likewise. (ASTLoweringItem::visit): Likewise. (ASTLoweringSimplePath::lower): Likewise. * hir/rust-ast-lower-pattern.cc (ASTLoweringPattern::translate): Likewise. (ASTLoweringPattern::visit): Likewise. * hir/rust-ast-lower-stmt.cc (ASTLoweringStmt::translate): Likewise. (ASTLoweringStmt::visit): Likewise. * hir/rust-ast-lower-struct-field-expr.h: Likewise. * hir/rust-ast-lower-type.cc (ASTLowerTypePath::visit): Likewise. (ASTLowerQualifiedPathInType::visit): Likewise. (ASTLoweringType::translate): Likewise. (ASTLoweringType::visit): Likewise. (ASTLowerGenericParam::translate): Likewise. (ASTLowerGenericParam::visit): Likewise. (ASTLoweringTypeBounds::translate): Likewise. (ASTLoweringTypeBounds::visit): Likewise. (ASTLowerWhereClauseItem::translate): Likewise. (ASTLowerWhereClauseItem::visit): Likewise. * hir/rust-ast-lower.cc (ASTLowering::go): Likewise. (ASTLoweringBlock::visit): Likewise. (ASTLoweringIfBlock::visit): Likewise. (ASTLoweringIfLetBlock::visit): Likewise. (ASTLowerStructExprField::visit): Likewise. (ASTLoweringExprWithBlock::visit): Likewise. (ASTLowerPathInExpression::visit): Likewise. (ASTLoweringBase::lower_qual_path_type): Likewise. (ASTLowerQualPathInExpression::visit): Likewise. * metadata/rust-export-metadata.cc (ExportContext::emit_trait): Likewise. (ExportContext::emit_function): Likewise. (ExportContext::emit_macro): Likewise. (PublicInterface::PublicInterface): Likewise. (PublicInterface::expected_metadata_filename): Likewise. * metadata/rust-export-metadata.h: Likewise. * resolve/rust-ast-resolve-base.h: Likewise. * resolve/rust-ast-resolve-implitem.h: Likewise. * resolve/rust-ast-resolve-item.cc (ResolveTraitItems::visit): Likewise. (ResolveItem::visit): Likewise. (ResolveExternItem::visit): Likewise. * resolve/rust-ast-resolve-path.cc (ResolvePath::resolve_path): Likewise. * resolve/rust-ast-resolve-stmt.h: Likewise. * resolve/rust-ast-resolve-toplevel.h: Likewise. * resolve/rust-ast-resolve-type.cc (ResolveRelativeTypePath::go): Likewise. (ResolveTypeToCanonicalPath::visit): Likewise. * resolve/rust-ast-resolve-type.h: Likewise. * resolve/rust-ast-resolve.cc (NameResolution::NameResolution): Likewise. (NameResolution::go): Likewise. * resolve/rust-ast-resolve.h: Likewise. * resolve/rust-early-name-resolver-2.0.cc (Early::visit_attributes): Likewise. * resolve/rust-early-name-resolver.cc (EarlyNameResolver::EarlyNameResolver): Likewise. * resolve/rust-late-name-resolver-2.0.cc (next_node_id): Likewise. (next_hir_id): Likewise. * resolve/rust-name-resolution-context.cc (NameResolutionContext::NameResolutionContext): Likewise. * resolve/rust-name-resolver.cc (Resolver::Resolver): Likewise. (Resolver::generate_builtins): Likewise. (Resolver::setup_builtin): Likewise. * resolve/rust-name-resolver.h: Likewise. * resolve/rust-toplevel-name-resolver-2.0.cc (TopLevel::visit): Likewise. (TopLevel::handle_use_glob): Likewise. * rust-session-manager.cc (Session::get_instance): Likewise. (Session::handle_input_files): Likewise. (Session::handle_crate_name): Likewise. (Session::compile_crate): Likewise. (Session::load_extern_crate): Likewise. * rust-session-manager.h: Likewise. * typecheck/rust-autoderef.cc (Adjuster::try_unsize_type): Likewise. * typecheck/rust-coercion.cc (TypeCoercionRules::do_coercion): Likewise. (TypeCoercionRules::coerce_unsafe_ptr): Likewise. (TypeCoercionRules::coerce_borrowed_pointer): Likewise. (TypeCoercionRules::coerce_unsized): Likewise. * typecheck/rust-coercion.h: Likewise. * typecheck/rust-hir-dot-operator.cc (MethodResolver::select): Likewise. * typecheck/rust-hir-inherent-impl-overlap.h: Likewise. * typecheck/rust-hir-path-probe.cc (PathProbeType::process_enum_item_for_candiates): Likewise. (PathProbeType::process_impl_items_for_candidates): Likewise. (PathProbeImplTrait::process_trait_impl_items_for_candidates): Likewise. * typecheck/rust-hir-trait-resolve.cc (TraitResolver::resolve_path_to_trait): Likewise. (TraitItemReference::get_parent_trait_mappings): Likewise. * typecheck/rust-hir-type-check-base.cc (TypeCheckBase::resolve_literal): Likewise. (TypeCheckBase::get_marker_predicate): Likewise. * typecheck/rust-hir-type-check-base.h: Likewise. * typecheck/rust-hir-type-check-enumitem.cc (TypeCheckEnumItem::visit): Likewise. * typecheck/rust-hir-type-check-expr.cc (TypeCheckExpr::visit): Likewise. (TypeCheckExpr::resolve_operator_overload): Likewise. (TypeCheckExpr::resolve_fn_trait_call): Likewise. * typecheck/rust-hir-type-check-implitem.cc (TypeCheckTopLevelExternItem::visit): Likewise. (TypeCheckImplItem::visit): Likewise. * typecheck/rust-hir-type-check-item.cc (TypeCheckItem::visit): Likewise. * typecheck/rust-hir-type-check-path.cc (TypeCheckExpr::resolve_root_path): Likewise. (TypeCheckExpr::resolve_segments): Likewise. * typecheck/rust-hir-type-check-pattern.cc (TypeCheckPattern::emit_pattern_size_error): Likewise. (ClosureParamInfer::Resolve): Likewise. * typecheck/rust-hir-type-check-struct.cc (TypeCheckStructExpr::resolve): Likewise. * typecheck/rust-hir-type-check-type.cc (TypeCheckType::visit): Likewise. (TypeCheckType::resolve_root_path): Likewise. (TypeResolveGenericParam::visit): Likewise. (ResolveWhereClauseItem::visit): Likewise. * typecheck/rust-hir-type-check.cc (TraitItemReference::get_type_from_fn): Likewise. * typecheck/rust-type-util.cc (query_type): Likewise. * typecheck/rust-typecheck-context.cc (TypeCheckContext::compute_inference_variables): Likewise. * typecheck/rust-tyty-bounds.cc (TypeBoundsProbe::scan): Likewise. (TypeBoundsProbe::assemble_builtin_candidate): Likewise. (TypeCheckBase::get_predicate_from_bound): Likewise. * typecheck/rust-tyty-call.cc (TypeCheckCallExpr::visit): Likewise. (TypeCheckMethodCallExpr::check): Likewise. * typecheck/rust-tyty-call.h: Likewise. * typecheck/rust-tyty-cmp.h: Likewise. * typecheck/rust-tyty-subst.cc (SubstitutionParamMapping::override_context): Likewise. (SubstitutionRef::monomorphize): Likewise. * typecheck/rust-tyty-util.cc (TyVar::get_implicit_infer_var): Likewise. (TyVar::monomorphized_clone): Likewise. (TyWithLocation::TyWithLocation): Likewise. * typecheck/rust-tyty.cc (BaseType::satisfies_bound): Likewise. (InferType::clone): Likewise. (ADTType::handle_substitions): Likewise. (TupleType::handle_substitions): Likewise. (FnType::handle_substitions): Likewise. (ClosureType::setup_fn_once_output): Likewise. (ArrayType::handle_substitions): Likewise. (SliceType::handle_substitions): Likewise. (ReferenceType::handle_substitions): Likewise. (PointerType::handle_substitions): Likewise. (ParamType::handle_substitions): Likewise. * typecheck/rust-tyty.h: Likewise. * typecheck/rust-unify.cc (UnifyRules::UnifyRules): Likewise. (UnifyRules::commit): Likewise. * util/rust-hir-map.cc: Change getter return type to a reference. * util/rust-hir-map.h: Update function's prototype. Signed-off-by: Pierre-Emmanuel Patry <[email protected]>
1 parent 3a31617 commit 8a72566

File tree

94 files changed

+923
-941
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+923
-941
lines changed

gcc/rust/ast/rust-ast.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ class SimplePathSegment : public PathSegment
374374
// TODO: put checks in constructor to enforce this rule?
375375
SimplePathSegment (std::string segment_name, location_t locus)
376376
: segment_name (std::move (segment_name)), locus (locus),
377-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
377+
node_id (Analysis::Mappings::get ().get_next_node_id ())
378378
{}
379379

380380
/* Returns whether simple path segment is in an invalid state (currently, if
@@ -425,14 +425,14 @@ class SimplePath
425425
location_t locus = UNDEF_LOCATION)
426426
: opening_scope_resolution (has_opening_scope_resolution),
427427
segments (std::move (path_segments)), locus (locus),
428-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
428+
node_id (Analysis::Mappings::get ().get_next_node_id ())
429429
{}
430430

431431
SimplePath (Identifier ident)
432432
: opening_scope_resolution (false),
433433
segments ({SimplePathSegment (ident.as_string (), ident.get_locus ())}),
434434
locus (ident.get_locus ()),
435-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
435+
node_id (Analysis::Mappings::get ().get_next_node_id ())
436436
{}
437437

438438
// Creates an empty SimplePath.
@@ -1127,7 +1127,7 @@ class Stmt : public Node
11271127
virtual void add_semicolon () {}
11281128

11291129
protected:
1130-
Stmt () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
1130+
Stmt () : node_id (Analysis::Mappings::get ().get_next_node_id ()) {}
11311131

11321132
// Clone function implementation as pure virtual method
11331133
virtual Stmt *clone_stmt_impl () const = 0;
@@ -1264,7 +1264,7 @@ class Expr : public Node
12641264

12651265
protected:
12661266
// Constructor
1267-
Expr () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
1267+
Expr () : node_id (Analysis::Mappings::get ().get_next_node_id ()) {}
12681268

12691269
// Clone function implementation as pure virtual method
12701270
virtual Expr *clone_expr_impl () const = 0;
@@ -1437,7 +1437,7 @@ class Type : public Node
14371437
NodeId get_node_id () const { return node_id; }
14381438

14391439
protected:
1440-
Type () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
1440+
Type () : node_id (Analysis::Mappings::get ().get_next_node_id ()) {}
14411441

14421442
// Clone function implementation as pure virtual method
14431443
virtual Type *clone_type_impl () const = 0;
@@ -1519,7 +1519,7 @@ class Lifetime : public TypeParamBound
15191519
// Constructor
15201520
Lifetime (LifetimeType type, std::string name = std::string (),
15211521
location_t locus = UNDEF_LOCATION)
1522-
: TypeParamBound (Analysis::Mappings::get ()->get_next_node_id ()),
1522+
: TypeParamBound (Analysis::Mappings::get ().get_next_node_id ()),
15231523
lifetime_type (type), lifetime_name (std::move (name)), locus (locus)
15241524
{}
15251525

@@ -1588,7 +1588,7 @@ class GenericParam : public Visitable
15881588
NodeId get_node_id () { return node_id; }
15891589

15901590
protected:
1591-
GenericParam () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
1591+
GenericParam () : node_id (Analysis::Mappings::get ().get_next_node_id ()) {}
15921592
GenericParam (NodeId node_id) : node_id (node_id) {}
15931593

15941594
// Clone function implementation as pure virtual method
@@ -1682,12 +1682,12 @@ class TraitItem : public AssociatedItem
16821682
{
16831683
protected:
16841684
TraitItem (location_t locus)
1685-
: node_id (Analysis::Mappings::get ()->get_next_node_id ()),
1685+
: node_id (Analysis::Mappings::get ().get_next_node_id ()),
16861686
vis (Visibility::create_private ()), locus (locus)
16871687
{}
16881688

16891689
TraitItem (Visibility vis, location_t locus)
1690-
: node_id (Analysis::Mappings::get ()->get_next_node_id ()), vis (vis),
1690+
: node_id (Analysis::Mappings::get ().get_next_node_id ()), vis (vis),
16911691
locus (locus)
16921692
{}
16931693

@@ -1713,7 +1713,7 @@ class TraitItem : public AssociatedItem
17131713
class ExternalItem : public Visitable
17141714
{
17151715
public:
1716-
ExternalItem () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
1716+
ExternalItem () : node_id (Analysis::Mappings::get ().get_next_node_id ()) {}
17171717

17181718
ExternalItem (NodeId node_id) : node_id (node_id) {}
17191719

@@ -1987,7 +1987,7 @@ struct Crate
19871987
Crate (std::vector<std::unique_ptr<Item>> items,
19881988
std::vector<Attribute> inner_attrs)
19891989
: inner_attrs (std::move (inner_attrs)), items (std::move (items)),
1990-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
1990+
node_id (Analysis::Mappings::get ().get_next_node_id ())
19911991
{}
19921992

19931993
// Copy constructor with vector clone

gcc/rust/ast/rust-expr.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class LoopLabel /*: public Node*/
2626

2727
LoopLabel (Lifetime loop_label, location_t locus = UNDEF_LOCATION)
2828
: label (std::move (loop_label)), locus (locus),
29-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
29+
node_id (Analysis::Mappings::get ().get_next_node_id ())
3030
{}
3131

3232
// Returns whether the LoopLabel is in an error state.
@@ -1113,7 +1113,7 @@ class ArrayElems
11131113
NodeId get_node_id () const { return node_id; }
11141114

11151115
protected:
1116-
ArrayElems () : node_id (Analysis::Mappings::get ()->get_next_node_id ()) {}
1116+
ArrayElems () : node_id (Analysis::Mappings::get ().get_next_node_id ()) {}
11171117

11181118
// pure virtual clone implementation
11191119
virtual ArrayElems *clone_array_elems_impl () const = 0;
@@ -1762,7 +1762,7 @@ class StructExprField
17621762
// pure virtual clone implementation
17631763
virtual StructExprField *clone_struct_expr_field_impl () const = 0;
17641764

1765-
StructExprField () : node_id (Analysis::Mappings::get ()->get_next_node_id ())
1765+
StructExprField () : node_id (Analysis::Mappings::get ().get_next_node_id ())
17661766
{}
17671767

17681768
NodeId node_id;
@@ -4298,7 +4298,7 @@ struct MatchCase
42984298
public:
42994299
MatchCase (MatchArm arm, std::unique_ptr<Expr> expr)
43004300
: arm (std::move (arm)), expr (std::move (expr)),
4301-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
4301+
node_id (Analysis::Mappings::get ().get_next_node_id ())
43024302
{}
43034303

43044304
MatchCase (const MatchCase &other)

gcc/rust/ast/rust-item.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class TypeParam : public GenericParam
8686
= std::vector<std::unique_ptr<TypeParamBound>> (),
8787
std::unique_ptr<Type> type = nullptr,
8888
Attribute outer_attr = Attribute::create_empty ())
89-
: GenericParam (Analysis::Mappings::get ()->get_next_node_id ()),
89+
: GenericParam (Analysis::Mappings::get ().get_next_node_id ()),
9090
outer_attr (std::move (outer_attr)),
9191
type_representation (std::move (type_representation)),
9292
type_param_bounds (std::move (type_param_bounds)),
@@ -210,7 +210,7 @@ class LifetimeWhereClauseItem : public WhereClauseItem
210210
location_t locus)
211211
: lifetime (std::move (lifetime)),
212212
lifetime_bounds (std::move (lifetime_bounds)), locus (locus),
213-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
213+
node_id (Analysis::Mappings::get ().get_next_node_id ())
214214
{}
215215

216216
std::string as_string () const override;
@@ -258,7 +258,7 @@ class TypeBoundWhereClauseItem : public WhereClauseItem
258258
: for_lifetimes (std::move (for_lifetimes)),
259259
bound_type (std::move (bound_type)),
260260
type_param_bounds (std::move (type_param_bounds)),
261-
node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus)
261+
node_id (Analysis::Mappings::get ().get_next_node_id ()), locus (locus)
262262
{}
263263

264264
// Copy constructor requires clone
@@ -339,7 +339,7 @@ class WhereClause
339339
public:
340340
WhereClause (std::vector<std::unique_ptr<WhereClauseItem>> where_clause_items)
341341
: where_clause_items (std::move (where_clause_items)),
342-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
342+
node_id (Analysis::Mappings::get ().get_next_node_id ())
343343
{}
344344

345345
// copy constructor with vector clone
@@ -396,7 +396,7 @@ class Param : public Visitable
396396
public:
397397
Param (std::vector<Attribute> outer_attrs, location_t locus)
398398
: outer_attrs (std::move (outer_attrs)), locus (locus),
399-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
399+
node_id (Analysis::Mappings::get ().get_next_node_id ())
400400
{}
401401

402402
virtual ~Param () = default;
@@ -1018,7 +1018,7 @@ class UseTree
10181018
virtual UseTree *clone_use_tree_impl () const = 0;
10191019

10201020
UseTree (location_t locus)
1021-
: locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ())
1021+
: locus (locus), node_id (Analysis::Mappings::get ().get_next_node_id ())
10221022
{}
10231023
};
10241024

@@ -1718,7 +1718,7 @@ class StructField
17181718
std::vector<Attribute> outer_attrs = std::vector<Attribute> ())
17191719
: outer_attrs (std::move (outer_attrs)), visibility (std::move (vis)),
17201720
field_name (std::move (field_name)), field_type (std::move (field_type)),
1721-
node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus)
1721+
node_id (Analysis::Mappings::get ().get_next_node_id ()), locus (locus)
17221722
{}
17231723

17241724
// Copy constructor
@@ -1878,7 +1878,7 @@ class TupleField
18781878
std::vector<Attribute> outer_attrs = std::vector<Attribute> ())
18791879
: outer_attrs (std::move (outer_attrs)), visibility (std::move (vis)),
18801880
field_type (std::move (field_type)),
1881-
node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus)
1881+
node_id (Analysis::Mappings::get ().get_next_node_id ()), locus (locus)
18821882
{}
18831883

18841884
// Copy constructor with clone
@@ -3573,21 +3573,21 @@ class NamedFunctionParam
35733573
std::vector<Attribute> outer_attrs, location_t locus)
35743574
: name (std::move (name)), param_type (std::move (param_type)),
35753575
outer_attrs (std::move (outer_attrs)),
3576-
node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus),
3576+
node_id (Analysis::Mappings::get ().get_next_node_id ()), locus (locus),
35773577
variadic (false)
35783578
{}
35793579

35803580
NamedFunctionParam (std::string name, std::vector<Attribute> outer_attrs,
35813581
location_t locus)
35823582
: name (std::move (name)), param_type (nullptr),
35833583
outer_attrs (std::move (outer_attrs)),
3584-
node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus),
3584+
node_id (Analysis::Mappings::get ().get_next_node_id ()), locus (locus),
35853585
variadic (true)
35863586
{}
35873587

35883588
NamedFunctionParam (std::vector<Attribute> outer_attrs, location_t locus)
35893589
: name (""), param_type (nullptr), outer_attrs (std::move (outer_attrs)),
3590-
node_id (Analysis::Mappings::get ()->get_next_node_id ()), locus (locus),
3590+
node_id (Analysis::Mappings::get ().get_next_node_id ()), locus (locus),
35913591
variadic (true)
35923592
{}
35933593

gcc/rust/ast/rust-macro.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -720,7 +720,7 @@ class MacroInvocation : public TypeNoBounds,
720720
location_t locus, bool is_semi_coloned,
721721
std::vector<std::unique_ptr<MacroInvocation>> &&pending_eager_invocs)
722722
: TraitItem (locus), outer_attrs (std::move (outer_attrs)), locus (locus),
723-
node_id (Analysis::Mappings::get ()->get_next_node_id ()),
723+
node_id (Analysis::Mappings::get ().get_next_node_id ()),
724724
invoc_data (std::move (invoc_data)), is_semi_coloned (is_semi_coloned),
725725
kind (kind), builtin_kind (builtin_kind),
726726
pending_eager_invocs (std::move (pending_eager_invocs))

gcc/rust/ast/rust-path.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,7 @@ class PathExprSegment
506506
GenericArgs generic_args = GenericArgs::create_empty ())
507507
: segment_name (std::move (segment_name)),
508508
generic_args (std::move (generic_args)), locus (locus),
509-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
509+
node_id (Analysis::Mappings::get ().get_next_node_id ())
510510
{}
511511

512512
/* Constructor for segment with generic arguments (from segment name and all
@@ -519,7 +519,7 @@ class PathExprSegment
519519
generic_args (GenericArgs (std::move (lifetime_args),
520520
std::move (generic_args),
521521
std::move (binding_args))),
522-
locus (locus), node_id (Analysis::Mappings::get ()->get_next_node_id ())
522+
locus (locus), node_id (Analysis::Mappings::get ().get_next_node_id ())
523523
{}
524524

525525
// Returns whether path expression segment is in an error state.
@@ -621,7 +621,7 @@ class PathInExpression : public PathPattern, public PathExpr
621621
: PathPattern (std::move (path_segments)),
622622
outer_attrs (std::move (outer_attrs)),
623623
has_opening_scope_resolution (has_opening_scope_resolution),
624-
locus (locus), _node_id (Analysis::Mappings::get ()->get_next_node_id ())
624+
locus (locus), _node_id (Analysis::Mappings::get ().get_next_node_id ())
625625
{}
626626

627627
// Creates an error state path in expression.
@@ -743,15 +743,15 @@ class TypePathSegment
743743
bool has_separating_scope_resolution, location_t locus)
744744
: ident_segment (std::move (ident_segment)), locus (locus),
745745
has_separating_scope_resolution (has_separating_scope_resolution),
746-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
746+
node_id (Analysis::Mappings::get ().get_next_node_id ())
747747
{}
748748

749749
TypePathSegment (std::string segment_name,
750750
bool has_separating_scope_resolution, location_t locus)
751751
: ident_segment (PathIdentSegment (std::move (segment_name), locus)),
752752
locus (locus),
753753
has_separating_scope_resolution (has_separating_scope_resolution),
754-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
754+
node_id (Analysis::Mappings::get ().get_next_node_id ())
755755
{}
756756

757757
TypePathSegment (TypePathSegment const &other)
@@ -1149,7 +1149,7 @@ struct QualifiedPathType
11491149
TypePath trait_path = TypePath::create_error ())
11501150
: type_to_invoke_on (std::move (invoke_on_type)),
11511151
trait_path (std::move (trait_path)), locus (locus),
1152-
node_id (Analysis::Mappings::get ()->get_next_node_id ())
1152+
node_id (Analysis::Mappings::get ().get_next_node_id ())
11531153
{}
11541154

11551155
// Copy constructor uses custom deep copy for Type to preserve polymorphism
@@ -1243,7 +1243,7 @@ class QualifiedPathInExpression : public PathPattern, public PathExpr
12431243
: PathPattern (std::move (path_segments)),
12441244
outer_attrs (std::move (outer_attrs)),
12451245
path_type (std::move (qual_path_type)), locus (locus),
1246-
_node_id (Analysis::Mappings::get ()->get_next_node_id ())
1246+
_node_id (Analysis::Mappings::get ().get_next_node_id ())
12471247
{}
12481248

12491249
/* TODO: maybe make a shortcut constructor that has QualifiedPathType

0 commit comments

Comments
 (0)