aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/metadata
diff options
context:
space:
mode:
authorOwen Avery <powerboat9.gamer@gmail.com>2023-07-10 16:06:27 -0400
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 18:55:59 +0100
commitdd15fff38562ab8c3160190366f1e755c033425b (patch)
treea0e1d0a8c8f483df5d1fdb88c555f18628ffa654 /gcc/rust/metadata
parente99e565e0aa866cdec407f851d651096fb190f7f (diff)
downloadgcc-dd15fff38562ab8c3160190366f1e755c033425b.zip
gcc-dd15fff38562ab8c3160190366f1e755c033425b.tar.gz
gcc-dd15fff38562ab8c3160190366f1e755c033425b.tar.bz2
gccrs: Continue to replace usages of Location with location_t
gcc/rust/ChangeLog: * backend/rust-compile-base.cc: Replace Location with location_t. * backend/rust-compile-base.h: Likewise. * backend/rust-compile-expr.cc: Likewise. * lex/rust-token.h: Likewise. * metadata/rust-import-archive.cc: Likewise. * metadata/rust-imports.cc: Likewise. * metadata/rust-imports.h: Likewise. * rust-backend.h: Likewise. * rust-diagnostics.cc: Likewise. * rust-diagnostics.h: Likewise. * rust-gcc.cc: Likewise. * rust-linemap.cc: Likewise. * util/rust-token-converter.cc: Likewise. Signed-off-by: Owen Avery <powerboat9.gamer@gmail.com>
Diffstat (limited to 'gcc/rust/metadata')
-rw-r--r--gcc/rust/metadata/rust-import-archive.cc8
-rw-r--r--gcc/rust/metadata/rust-imports.cc12
-rw-r--r--gcc/rust/metadata/rust-imports.h8
3 files changed, 14 insertions, 14 deletions
diff --git a/gcc/rust/metadata/rust-import-archive.cc b/gcc/rust/metadata/rust-import-archive.cc
index b9fc0e4..6c392b0 100644
--- a/gcc/rust/metadata/rust-import-archive.cc
+++ b/gcc/rust/metadata/rust-import-archive.cc
@@ -103,7 +103,7 @@ Import::is_archive_magic (const char *bytes)
class Archive_file
{
public:
- Archive_file (const std::string &filename, int fd, Location location)
+ Archive_file (const std::string &filename, int fd, location_t location)
: filename_ (filename), fd_ (fd), filesize_ (-1), first_member_offset_ (0),
extended_names_ (), is_thin_archive_ (false), is_big_archive_ (false),
location_ (location), nested_archives_ ()
@@ -128,7 +128,7 @@ public:
bool is_big_archive () const { return this->is_big_archive_; }
// Return the location of the import statement.
- Location location () const { return this->location_; }
+ location_t location () const { return this->location_; }
// Read bytes.
bool read (off_t offset, off_t size, char *);
@@ -188,7 +188,7 @@ private:
// Whether this is a big archive.
bool is_big_archive_;
// The location of the import statements.
- Location location_;
+ location_t location_;
// Table of nested archives.
Nested_archive_table nested_archives_;
};
@@ -838,7 +838,7 @@ Stream_concatenate::do_advance (size_t skip)
std::unique_ptr<Import::Stream>
Import::find_archive_export_data (const std::string &filename, int fd,
- Location location)
+ location_t location)
{
Archive_file afile (filename, fd, location);
if (!afile.initialize ())
diff --git a/gcc/rust/metadata/rust-imports.cc b/gcc/rust/metadata/rust-imports.cc
index 78b27ea..fc6bcdb 100644
--- a/gcc/rust/metadata/rust-imports.cc
+++ b/gcc/rust/metadata/rust-imports.cc
@@ -64,7 +64,7 @@ add_search_path (const std::string &path)
// later in the search path.
std::pair<std::unique_ptr<Import::Stream>, std::vector<ProcMacro::Procmacro>>
-Import::open_package (const std::string &filename, Location location,
+Import::open_package (const std::string &filename, location_t location,
const std::string &relative_import_path)
{
bool is_local;
@@ -138,7 +138,7 @@ Import::open_package (const std::string &filename, Location location,
std::pair<std::unique_ptr<Import::Stream>, std::vector<ProcMacro::Procmacro>>
Import::try_package_in_directory (const std::string &filename,
- Location location)
+ location_t location)
{
std::string found_filename = filename;
int fd = open (found_filename.c_str (), O_RDONLY | O_BINARY);
@@ -229,7 +229,7 @@ Import::try_suffixes (std::string *pfilename)
std::unique_ptr<Import::Stream>
Import::find_export_data (const std::string &filename, int fd,
- Location location)
+ location_t location)
{
// See if we can read this as an object file.
std::unique_ptr<Import::Stream> stream
@@ -271,7 +271,7 @@ Import::find_export_data (const std::string &filename, int fd,
std::unique_ptr<Import::Stream>
Import::find_object_export_data (const std::string &filename, int fd,
- off_t offset, Location location)
+ off_t offset, location_t location)
{
char *buf;
size_t len;
@@ -298,7 +298,7 @@ Import::find_object_export_data (const std::string &filename, int fd,
// Construct an Import object. We make the builtin_types_ vector
// large enough to hold all the builtin types.
-Import::Import (std::unique_ptr<Stream> stream, Location location)
+Import::Import (std::unique_ptr<Stream> stream, location_t location)
: stream_ (std::move (stream)), location_ (location)
{}
@@ -358,7 +358,7 @@ Import::Stream::match_bytes (const char *bytes, size_t length)
// Require that the next LENGTH bytes from the stream match BYTES.
void
-Import::Stream::require_bytes (Location location, const char *bytes,
+Import::Stream::require_bytes (location_t location, const char *bytes,
size_t length)
{
const char *read;
diff --git a/gcc/rust/metadata/rust-imports.h b/gcc/rust/metadata/rust-imports.h
index 9707a78..6645c77 100644
--- a/gcc/rust/metadata/rust-imports.h
+++ b/gcc/rust/metadata/rust-imports.h
@@ -69,7 +69,7 @@ public:
// Give an error if the next bytes do not match STR. Advance the
// read position by the length of STR.
- void require_c_string (Location location, const char *str)
+ void require_c_string (location_t location, const char *str)
{
this->require_bytes (location, str, strlen (str));
}
@@ -111,7 +111,7 @@ public:
// exports. LOCATION is the location of the import statement.
// RELATIVE_IMPORT_PATH is used as a prefix for a relative import.
static std::pair<std::unique_ptr<Stream>, std::vector<ProcMacro::Procmacro>>
- open_package (const std::string &filename, Location location,
+ open_package (const std::string &filename, location_t location,
const std::string &relative_import_path);
static std::pair<std::unique_ptr<Stream>, std::vector<ProcMacro::Procmacro>>
@@ -121,7 +121,7 @@ public:
Import (std::unique_ptr<Stream>, Location);
// The location of the import statement.
- Location location () const { return this->location_; }
+ location_t location () const { return this->location_; }
// Return the next character.
int peek_char () { return this->stream_->peek_char (); }
@@ -175,7 +175,7 @@ private:
// The stream from which to read import data.
std::unique_ptr<Stream> stream_;
// The location of the import statement we are processing.
- Location location_;
+ location_t location_;
};
// Read import data from a string.