Skip to content

Commit

Permalink
Replace some more usages of Location with location_t
Browse files Browse the repository at this point in the history
gcc/rust/ChangeLog:

	* ast/rust-ast.h: Replace Location with location_t.
	* 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-stmt.h: Likewise.
	* ast/rust-type.h: Likewise.
	* hir/rust-ast-lower-base.h: Likewise.
	* hir/tree/rust-hir-expr.h: Likewise.
	* hir/tree/rust-hir-item.h: Likewise.
	* hir/tree/rust-hir-path.h: Likewise.
	* hir/tree/rust-hir-pattern.h: Likewise.
	* hir/tree/rust-hir-stmt.h: Likewise.
	* hir/tree/rust-hir-type.h: Likewise.
	* hir/tree/rust-hir.h: Likewise.
	* lex/rust-token.h: Likewise.
	* resolve/rust-ast-resolve-pattern.h: Likewise.
	* typecheck/rust-hir-trait-reference.h: Likewise.
	* typecheck/rust-tyty-bounds.h: Likewise.
	* typecheck/rust-tyty-call.h: Likewise.
	* typecheck/rust-tyty-subst.h: Likewise.
	* typecheck/rust-tyty-util.h: Likewise.
	* typecheck/rust-tyty.h: Likewise.

Signed-off-by: Owen Avery <[email protected]>
  • Loading branch information
powerboat9 authored and philberty committed Jul 18, 2023
1 parent 9cf8b77 commit 0e7f04a
Show file tree
Hide file tree
Showing 24 changed files with 240 additions and 240 deletions.
34 changes: 17 additions & 17 deletions gcc/rust/ast/rust-ast.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Identifier
Identifier &operator= (Identifier &&) = default;

NodeId get_node_id () const { return node_id; }
Location get_locus () const { return loc; }
location_t get_locus () const { return loc; }
const std::string &as_string () const { return ident; }

bool empty () const { return ident.empty (); }
Expand Down Expand Up @@ -274,7 +274,7 @@ class Token : public TokenTree, public MacroMatch
TokenId get_id () const { return tok_ref->get_id (); }
const std::string &get_str () const { return tok_ref->get_str (); }

Location get_locus () const { return tok_ref->get_locus (); }
location_t get_locus () const { return tok_ref->get_locus (); }

PrimitiveCoreType get_type_hint () const { return tok_ref->get_type_hint (); }

Expand Down Expand Up @@ -393,7 +393,7 @@ class SimplePathSegment : public PathSegment

std::string as_string () const override;

Location get_locus () const { return locus; }
location_t get_locus () const { return locus; }
NodeId get_node_id () const { return node_id; }
const std::string &get_segment_name () const { return segment_name; }
bool is_super_path_seg () const
Expand Down Expand Up @@ -442,7 +442,7 @@ class SimplePath
return opening_scope_resolution;
}

Location get_locus () const { return locus; }
location_t get_locus () const { return locus; }
NodeId get_node_id () const { return node_id; }

// does this need visitor if not polymorphic? probably not
Expand Down Expand Up @@ -543,7 +543,7 @@ struct Attribute
// Returns whether the attribute is considered an "empty" attribute.
bool is_empty () const { return attr_input == nullptr && path.is_empty (); }

Location get_locus () const { return locus; }
location_t get_locus () const { return locus; }

AttrInput &get_attr_input () const { return *attr_input; }

Expand Down Expand Up @@ -689,7 +689,7 @@ class MetaItemInner : public Visitable

virtual ~MetaItemInner ();

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;

virtual std::string as_string () const = 0;

Expand Down Expand Up @@ -945,7 +945,7 @@ class Stmt : public Node

virtual std::string as_string () const = 0;

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;

virtual void mark_for_strip () = 0;
virtual bool is_marked_for_strip () const = 0;
Expand Down Expand Up @@ -1027,7 +1027,7 @@ class Expr : public Node

virtual ~Expr () {}

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;

virtual bool is_literal () const { return false; }

Expand Down Expand Up @@ -1102,7 +1102,7 @@ class IdentifierExpr : public ExprWithoutBlock

std::string as_string () const override { return ident.as_string (); }

Location get_locus () const override final { return locus; }
location_t get_locus () const override final { return locus; }

Identifier get_ident () const { return ident; }

Expand Down Expand Up @@ -1161,7 +1161,7 @@ class Pattern : public Visitable
virtual void mark_for_strip () {}
virtual bool is_marked_for_strip () const { return false; }

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;
virtual NodeId get_pattern_node_id () const = 0;

protected:
Expand Down Expand Up @@ -1197,7 +1197,7 @@ class Type : public Node
virtual void mark_for_strip () {}
virtual bool is_marked_for_strip () const { return false; }

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;

NodeId get_node_id () const { return node_id; }

Expand Down Expand Up @@ -1252,7 +1252,7 @@ class TypeParamBound : public Visitable

NodeId get_node_id () const { return node_id; }

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;

protected:
// Clone function implementation as pure virtual method
Expand Down Expand Up @@ -1309,7 +1309,7 @@ class Lifetime : public TypeParamBound

LifetimeType get_lifetime_type () { return lifetime_type; }

Location get_locus () const override final { return locus; }
location_t get_locus () const override final { return locus; }

std::string get_lifetime_name () const { return lifetime_name; }

Expand Down Expand Up @@ -1344,7 +1344,7 @@ class GenericParam : public Visitable

virtual std::string as_string () const = 0;

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;

virtual Kind get_kind () const = 0;

Expand Down Expand Up @@ -1401,7 +1401,7 @@ class LifetimeParam : public GenericParam

void accept_vis (ASTVisitor &vis) override;

Location get_locus () const override final { return locus; }
location_t get_locus () const override final { return locus; }

Kind get_kind () const override final { return Kind::Lifetime; }

Expand Down Expand Up @@ -1443,7 +1443,7 @@ class TraitItem : public Visitable
virtual bool is_marked_for_strip () const = 0;

NodeId get_node_id () const { return node_id; }
Location get_locus () const { return locus; }
location_t get_locus () const { return locus; }
};

/* Abstract base class for items used within an inherent impl block (the impl
Expand All @@ -1468,7 +1468,7 @@ class InherentImplItem : public Visitable
virtual void mark_for_strip () = 0;
virtual bool is_marked_for_strip () const = 0;

virtual Location get_locus () const = 0;
virtual location_t get_locus () const = 0;
};

// Abstract base class for items used in a trait impl
Expand Down
Loading

0 comments on commit 0e7f04a

Please sign in to comment.