aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/hir
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2023-07-03 11:54:19 -0400
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:49:34 +0100
commit1678cdd3aac83c3e255e4395c12a9d7dff350a70 (patch)
tree11264b9115ca4a301098a48b403a0a6fa8a9e122 /gcc/rust/hir
parent030786a9680b0206480ebda372c1fb5d2aa19a59 (diff)
downloadgcc-1678cdd3aac83c3e255e4395c12a9d7dff350a70.zip
gcc-1678cdd3aac83c3e255e4395c12a9d7dff350a70.tar.gz
gcc-1678cdd3aac83c3e255e4395c12a9d7dff350a70.tar.bz2
gccrs: Replace value initialization of Location with UNDEF_LOCATION
gcc/rust/ChangeLog: * rust-location.h (UNDEF_LOCATION): New. * ast/rust-ast-collector.cc: Replace Location () with UNDEF_LOCATION. * ast/rust-ast-fragment.cc: Likewise. * ast/rust-ast.h: Likewise. * ast/rust-expr.h: Likewise. * ast/rust-item.h: Likewise. * ast/rust-macro.h: Likewise. * ast/rust-path.h: Likewise. * ast/rust-type.h: Likewise. * backend/rust-compile-expr.cc: Likewise. * backend/rust-compile-extern.h: Likewise. * backend/rust-compile-implitem.h: Likewise. * backend/rust-compile-intrinsic.cc: Likewise. * backend/rust-compile-item.h: Likewise. * backend/rust-compile.cc: Likewise. * backend/rust-constexpr.cc: Likewise. * expand/rust-expand-visitor.cc: Likewise. * expand/rust-macro-expand.cc: Likewise. * expand/rust-macro-expand.h: Likewise. * expand/rust-macro-invoc-lexer.cc: Likewise. * expand/rust-proc-macro-invoc-lexer.cc: Likewise. * expand/rust-proc-macro.cc: 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-type.h: Likewise. * hir/tree/rust-hir.h: Likewise. * lex/rust-lex.cc: Likewise. * metadata/rust-export-metadata.cc: Likewise. * parse/rust-parse-impl.h: Likewise. * resolve/rust-ast-resolve-item.cc: Likewise. * resolve/rust-ast-resolve.cc: Likewise. * rust-diagnostics.h: Likewise. * rust-session-manager.cc: Likewise. * typecheck/rust-autoderef.cc: Likewise. * typecheck/rust-coercion.cc: Likewise. * typecheck/rust-hir-dot-operator.cc: Likewise. * typecheck/rust-hir-path-probe.cc: Likewise. * typecheck/rust-hir-trait-reference.cc: Likewise. * typecheck/rust-hir-trait-reference.h: Likewise. * typecheck/rust-hir-type-check-expr.cc: Likewise. * typecheck/rust-hir-type-check-implitem.cc: Likewise. * typecheck/rust-hir-type-check-type.cc: Likewise. * typecheck/rust-hir-type-check.cc: Likewise. * typecheck/rust-tyty-bounds.cc: Likewise. * typecheck/rust-tyty-subst.cc: Likewise. * typecheck/rust-tyty.cc: Likewise. * util/rust-hir-map.cc: Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/hir')
-rw-r--r--gcc/rust/hir/tree/rust-hir-expr.h2
-rw-r--r--gcc/rust/hir/tree/rust-hir-item.h4
-rw-r--r--gcc/rust/hir/tree/rust-hir-path.h14
-rw-r--r--gcc/rust/hir/tree/rust-hir-type.h2
-rw-r--r--gcc/rust/hir/tree/rust-hir.h4
5 files changed, 13 insertions, 13 deletions
diff --git a/gcc/rust/hir/tree/rust-hir-expr.h b/gcc/rust/hir/tree/rust-hir-expr.h
index 7dc7735..98d71dd 100644
--- a/gcc/rust/hir/tree/rust-hir-expr.h
+++ b/gcc/rust/hir/tree/rust-hir-expr.h
@@ -3582,7 +3582,7 @@ public:
// Creates a match arm in an error state.
static MatchArm create_error ()
{
- Location locus = Location ();
+ Location locus = UNDEF_LOCATION;
return MatchArm (std::vector<std::unique_ptr<Pattern> > (), locus);
}
diff --git a/gcc/rust/hir/tree/rust-hir-item.h b/gcc/rust/hir/tree/rust-hir-item.h
index 0d5a319..b361190 100644
--- a/gcc/rust/hir/tree/rust-hir-item.h
+++ b/gcc/rust/hir/tree/rust-hir-item.h
@@ -62,7 +62,7 @@ public:
AST::Attribute &get_outer_attribute () { return outer_attr; }
TypeParam (Analysis::NodeMapping mappings, Identifier type_representation,
- Location locus = Location (),
+ Location locus = UNDEF_LOCATION,
std::vector<std::unique_ptr<TypeParamBound>> type_param_bounds
= std::vector<std::unique_ptr<TypeParamBound>> (),
std::unique_ptr<Type> type = nullptr,
@@ -581,7 +581,7 @@ private:
public:
Visibility (VisType vis_type,
HIR::SimplePath path = HIR::SimplePath::create_empty (),
- Location locus = Location ())
+ Location locus = UNDEF_LOCATION)
: vis_type (vis_type), path (std::move (path)), locus (locus)
{}
diff --git a/gcc/rust/hir/tree/rust-hir-path.h b/gcc/rust/hir/tree/rust-hir-path.h
index b005e71..35dbcd6 100644
--- a/gcc/rust/hir/tree/rust-hir-path.h
+++ b/gcc/rust/hir/tree/rust-hir-path.h
@@ -76,7 +76,7 @@ public:
// Pointer type for type in constructor to enable polymorphism
GenericArgsBinding (Identifier ident, std::unique_ptr<Type> type_ptr,
- Location locus = Location ())
+ Location locus = UNDEF_LOCATION)
: identifier (std::move (ident)), type (std::move (type_ptr)), locus (locus)
{}
@@ -202,7 +202,7 @@ public:
GenericArgs &operator= (GenericArgs &&other) = default;
// Creates an empty GenericArgs (no arguments)
- static GenericArgs create_empty (Location locus = Location ())
+ static GenericArgs create_empty (Location locus = UNDEF_LOCATION)
{
return GenericArgs ({}, {}, {}, {}, locus);
}
@@ -340,7 +340,7 @@ public:
// Constructor
PathInExpression (Analysis::NodeMapping mappings,
std::vector<PathExprSegment> path_segments,
- Location locus = Location (),
+ Location locus = UNDEF_LOCATION,
bool has_opening_scope_resolution = false,
std::vector<AST::Attribute> outer_attrs
= std::vector<AST::Attribute> ())
@@ -694,7 +694,7 @@ public:
{
return TypePath (Analysis::NodeMapping::get_error (),
std::vector<std::unique_ptr<TypePathSegment> > (),
- Location ());
+ UNDEF_LOCATION);
}
// Constructor
@@ -856,7 +856,7 @@ public:
QualifiedPathInExpression (Analysis::NodeMapping mappings,
QualifiedPathType qual_path_type,
std::vector<PathExprSegment> path_segments,
- Location locus = Location (),
+ Location locus = UNDEF_LOCATION,
std::vector<AST::Attribute> outer_attrs
= std::vector<AST::Attribute> ())
: PathPattern (std::move (path_segments)),
@@ -923,7 +923,7 @@ public:
Analysis::NodeMapping mappings, QualifiedPathType qual_path_type,
std::unique_ptr<TypePathSegment> associated_segment,
std::vector<std::unique_ptr<TypePathSegment> > path_segments,
- Location locus = Location ())
+ Location locus = UNDEF_LOCATION)
: TypeNoBounds (mappings, locus), path_type (std::move (qual_path_type)),
associated_segment (std::move (associated_segment)),
segments (std::move (path_segments))
@@ -1005,7 +1005,7 @@ public:
static HIR::SimplePath create_empty ()
{
return HIR::SimplePath ({}, Analysis::NodeMapping::get_error (),
- Location ());
+ UNDEF_LOCATION);
}
bool is_error () const { return segments.empty (); }
diff --git a/gcc/rust/hir/tree/rust-hir-type.h b/gcc/rust/hir/tree/rust-hir-type.h
index 71f4cd2..3d1f8de 100644
--- a/gcc/rust/hir/tree/rust-hir-type.h
+++ b/gcc/rust/hir/tree/rust-hir-type.h
@@ -737,7 +737,7 @@ public:
// Creates an error state param.
static MaybeNamedParam create_error ()
{
- return MaybeNamedParam ({""}, UNNAMED, nullptr, Location ());
+ return MaybeNamedParam ({""}, UNNAMED, nullptr, UNDEF_LOCATION);
}
Location get_locus () const { return locus; }
diff --git a/gcc/rust/hir/tree/rust-hir.h b/gcc/rust/hir/tree/rust-hir.h
index 0c77572..4e00385 100644
--- a/gcc/rust/hir/tree/rust-hir.h
+++ b/gcc/rust/hir/tree/rust-hir.h
@@ -565,7 +565,7 @@ public:
static Lifetime error ()
{
return Lifetime (Analysis::NodeMapping::get_error (),
- AST::Lifetime::LifetimeType::NAMED, "", Location ());
+ AST::Lifetime::LifetimeType::NAMED, "", UNDEF_LOCATION);
}
std::string as_string () const override;
@@ -670,7 +670,7 @@ public:
// Constructor
LifetimeParam (Analysis::NodeMapping mappings, Lifetime lifetime,
- Location locus = Location (),
+ Location locus = UNDEF_LOCATION,
std::vector<Lifetime> lifetime_bounds
= std::vector<Lifetime> (),
AST::Attribute outer_attr = AST::Attribute::create_empty ())