diff options
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/backend/rust-compile-base.cc | 4 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-base.h | 2 | ||||
-rw-r--r-- | gcc/rust/backend/rust-compile-expr.cc | 2 | ||||
-rw-r--r-- | gcc/rust/lex/rust-token.h | 10 | ||||
-rw-r--r-- | gcc/rust/metadata/rust-import-archive.cc | 8 | ||||
-rw-r--r-- | gcc/rust/metadata/rust-imports.cc | 12 | ||||
-rw-r--r-- | gcc/rust/metadata/rust-imports.h | 8 | ||||
-rw-r--r-- | gcc/rust/rust-backend.h | 24 | ||||
-rw-r--r-- | gcc/rust/rust-diagnostics.cc | 32 | ||||
-rw-r--r-- | gcc/rust/rust-diagnostics.h | 2 | ||||
-rw-r--r-- | gcc/rust/rust-gcc.cc | 73 | ||||
-rw-r--r-- | gcc/rust/rust-linemap.cc | 2 | ||||
-rw-r--r-- | gcc/rust/util/rust-token-converter.cc | 2 |
13 files changed, 92 insertions, 89 deletions
diff --git a/gcc/rust/backend/rust-compile-base.cc b/gcc/rust/backend/rust-compile-base.cc index 0051d0f..010049e 100644 --- a/gcc/rust/backend/rust-compile-base.cc +++ b/gcc/rust/backend/rust-compile-base.cc @@ -417,7 +417,7 @@ HIRCompileBase::mark_addressable (tree exp, location_t locus) } tree -HIRCompileBase::address_expression (tree expr, Location location) +HIRCompileBase::address_expression (tree expr, location_t location) { if (expr == error_mark_node) return error_mark_node; @@ -748,7 +748,7 @@ HIRCompileBase::compile_constant_item ( tree HIRCompileBase::named_constant_expression (tree type_tree, const std::string &name, - tree const_val, Location location) + tree const_val, location_t location) { if (type_tree == error_mark_node || const_val == error_mark_node) return error_mark_node; diff --git a/gcc/rust/backend/rust-compile-base.h b/gcc/rust/backend/rust-compile-base.h index 086c0c3..d355446 100644 --- a/gcc/rust/backend/rust-compile-base.h +++ b/gcc/rust/backend/rust-compile-base.h @@ -139,7 +139,7 @@ protected: static tree named_constant_expression (tree type_tree, const std::string &name, - tree const_val, Location location); + tree const_val, location_t location); }; } // namespace Compile diff --git a/gcc/rust/backend/rust-compile-expr.cc b/gcc/rust/backend/rust-compile-expr.cc index c06c981..9358ce2 100644 --- a/gcc/rust/backend/rust-compile-expr.cc +++ b/gcc/rust/backend/rust-compile-expr.cc @@ -2070,7 +2070,7 @@ CompileExpr::compile_byte_string_literal (const HIR::LiteralExpr &expr, tree CompileExpr::type_cast_expression (tree type_to_cast_to, tree expr_tree, - Location location) + location_t location) { if (type_to_cast_to == error_mark_node || expr_tree == error_mark_node || TREE_TYPE (expr_tree) == error_mark_node) diff --git a/gcc/rust/lex/rust-token.h b/gcc/rust/lex/rust-token.h index 1783b1e..acbbeb0 100644 --- a/gcc/rust/lex/rust-token.h +++ b/gcc/rust/lex/rust-token.h @@ -252,32 +252,32 @@ private: PrimitiveCoreType type_hint; // Token constructor from token id and location. Has a null string. - Token (TokenId token_id, Location location) + Token (TokenId token_id, location_t location) : token_id (token_id), locus (location), str (nullptr), type_hint (CORETYPE_UNKNOWN) {} // Token constructor from token id, location, and a string. - Token (TokenId token_id, Location location, std::string &¶mStr) + Token (TokenId token_id, location_t location, std::string &¶mStr) : token_id (token_id), locus (location), str (new std::string (std::move (paramStr))), type_hint (CORETYPE_UNKNOWN) {} // Token constructor from token id, location, and a char. - Token (TokenId token_id, Location location, char paramChar) + Token (TokenId token_id, location_t location, char paramChar) : token_id (token_id), locus (location), str (new std::string (1, paramChar)), type_hint (CORETYPE_UNKNOWN) {} // Token constructor from token id, location, and a "codepoint". - Token (TokenId token_id, Location location, Codepoint paramCodepoint) + Token (TokenId token_id, location_t location, Codepoint paramCodepoint) : token_id (token_id), locus (location), str (new std::string (paramCodepoint.as_string ())), type_hint (CORETYPE_UNKNOWN) {} // Token constructor from token id, location, a string, and type hint. - Token (TokenId token_id, Location location, std::string &¶mStr, + Token (TokenId token_id, location_t location, std::string &¶mStr, PrimitiveCoreType parType) : token_id (token_id), locus (location), str (new std::string (std::move (paramStr))), type_hint (parType) 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. diff --git a/gcc/rust/rust-backend.h b/gcc/rust/rust-backend.h index 179bda7..930768e 100644 --- a/gcc/rust/rust-backend.h +++ b/gcc/rust/rust-backend.h @@ -50,7 +50,7 @@ public: { std::string name; tree type; - Location location; + location_t location; typed_identifier () : name (), type (NULL_TREE), location (UNKNOWN_LOCATION) {} @@ -116,19 +116,19 @@ public: virtual tree function_type (const typed_identifier &receiver, const std::vector<typed_identifier> ¶meters, const std::vector<typed_identifier> &results, - tree result_struct, Location location) + tree result_struct, location_t location) = 0; virtual tree function_type_varadic (const typed_identifier &receiver, const std::vector<typed_identifier> ¶meters, const std::vector<typed_identifier> &results, - tree result_struct, Location location) + tree result_struct, location_t location) = 0; virtual tree function_ptr_type (tree result, const std::vector<tree> &praameters, - Location location) + location_t location) = 0; // Get a struct type. @@ -366,10 +366,10 @@ public: // be put into a unique section if possible; this is intended to // permit the linker to garbage collect the variable if it is not // referenced. LOCATION is where the variable was defined. - virtual Bvariable *global_variable (const std::string &name, - const std::string &asm_name, tree btype, - bool is_external, bool is_hidden, - bool in_unique_section, Location location) + virtual Bvariable * + global_variable (const std::string &name, const std::string &asm_name, + tree btype, bool is_external, bool is_hidden, + bool in_unique_section, location_t location) = 0; // A global variable will 1) be initialized to zero, or 2) be @@ -394,20 +394,20 @@ public: // the frontend will call init_statement to set the initial value. virtual Bvariable *local_variable (tree function, const std::string &name, tree type, Bvariable *decl_var, - Location location) + location_t location) = 0; // Create a function parameter. This is an incoming parameter, not // a result parameter (result parameters are treated as local // variables). The arguments are as for local_variable. virtual Bvariable *parameter_variable (tree function, const std::string &name, - tree type, Location location) + tree type, location_t location) = 0; // Create a static chain parameter. This is the closure parameter. virtual Bvariable *static_chain_variable (tree function, const std::string &name, tree type, - Location location) + location_t location) = 0; // Create a temporary variable. A temporary variable has no name, @@ -423,7 +423,7 @@ public: // *PSTATEMENT to a statement which initializes the variable. virtual Bvariable *temporary_variable (tree fndecl, tree bind_tree, tree type, tree init, bool address_is_taken, - Location location, tree *pstatement) + location_t location, tree *pstatement) = 0; // Labels. diff --git a/gcc/rust/rust-diagnostics.cc b/gcc/rust/rust-diagnostics.cc index 26553ce..801bbf0 100644 --- a/gcc/rust/rust-diagnostics.cc +++ b/gcc/rust/rust-diagnostics.cc @@ -157,7 +157,7 @@ rust_close_quote () } void -rust_be_internal_error_at (const Location location, const std::string &errmsg) +rust_be_internal_error_at (const location_t location, const std::string &errmsg) { std::string loc_str = Linemap::location_to_string (location); if (loc_str.empty ()) @@ -167,7 +167,7 @@ rust_be_internal_error_at (const Location location, const std::string &errmsg) } void -rust_internal_error_at (const Location location, const char *fmt, ...) +rust_internal_error_at (const location_t location, const char *fmt, ...) { va_list ap; @@ -177,13 +177,13 @@ rust_internal_error_at (const Location location, const char *fmt, ...) } void -rust_be_error_at (const Location location, const std::string &errmsg) +rust_be_error_at (const location_t location, const std::string &errmsg) { error_at (location, "%s", errmsg.c_str ()); } void -rust_error_at (const Location location, const char *fmt, ...) +rust_error_at (const location_t location, const char *fmt, ...) { va_list ap; @@ -213,7 +213,7 @@ private: }; void -rust_be_error_at (const Location location, const ErrorCode code, +rust_be_error_at (const location_t location, const ErrorCode code, const std::string &errmsg) { rich_location gcc_loc (line_table, location); @@ -224,7 +224,7 @@ rust_be_error_at (const Location location, const ErrorCode code, } void -rust_error_at (const Location location, const ErrorCode code, const char *fmt, +rust_error_at (const location_t location, const ErrorCode code, const char *fmt, ...) { va_list ap; @@ -258,14 +258,14 @@ rust_error_at (const rich_location &location, const ErrorCode code, } void -rust_be_warning_at (const Location location, int opt, +rust_be_warning_at (const location_t location, int opt, const std::string &warningmsg) { warning_at (location, opt, "%s", warningmsg.c_str ()); } void -rust_warning_at (const Location location, int opt, const char *fmt, ...) +rust_warning_at (const location_t location, int opt, const char *fmt, ...) { va_list ap; @@ -275,13 +275,13 @@ rust_warning_at (const Location location, int opt, const char *fmt, ...) } void -rust_be_fatal_error (const Location location, const std::string &fatalmsg) +rust_be_fatal_error (const location_t location, const std::string &fatalmsg) { fatal_error (location, "%s", fatalmsg.c_str ()); } void -rust_fatal_error (const Location location, const char *fmt, ...) +rust_fatal_error (const location_t location, const char *fmt, ...) { va_list ap; @@ -291,13 +291,13 @@ rust_fatal_error (const Location location, const char *fmt, ...) } void -rust_be_inform (const Location location, const std::string &infomsg) +rust_be_inform (const location_t location, const std::string &infomsg) { inform (location, "%s", infomsg.c_str ()); } void -rust_inform (const Location location, const char *fmt, ...) +rust_inform (const location_t location, const char *fmt, ...) { va_list ap; @@ -332,7 +332,7 @@ rust_be_debug_p (void) } void -rust_debug_loc (const Location location, const char *fmt, ...) +rust_debug_loc (const location_t location, const char *fmt, ...) { if (!rust_be_debug_p ()) return; @@ -374,7 +374,7 @@ va_constructor (Error::Kind kind, location_t locus, const char *fmt, return Error (kind, locus, message); } -Error::Error (const Location location, const char *fmt, ...) +Error::Error (const location_t location, const char *fmt, ...) : kind (Kind::Err), locus (location) { va_list ap; @@ -384,7 +384,7 @@ Error::Error (const Location location, const char *fmt, ...) } Error -Error::Hint (const Location location, const char *fmt, ...) +Error::Hint (const location_t location, const char *fmt, ...) { va_list ap; va_start (ap, fmt); @@ -393,7 +393,7 @@ Error::Hint (const Location location, const char *fmt, ...) } Error -Error::Fatal (const Location location, const char *fmt, ...) +Error::Fatal (const location_t location, const char *fmt, ...) { va_list ap; va_start (ap, fmt); diff --git a/gcc/rust/rust-diagnostics.h b/gcc/rust/rust-diagnostics.h index dccdf6d..30874ef 100644 --- a/gcc/rust/rust-diagnostics.h +++ b/gcc/rust/rust-diagnostics.h @@ -213,7 +213,7 @@ struct Error #define rust_sorry_at(location, ...) sorry_at (location, __VA_ARGS__) void -rust_debug_loc (const Location location, const char *fmt, +rust_debug_loc (const location_t location, const char *fmt, ...) ATTRIBUTE_PRINTF_2; #endif // !defined(RUST_DIAGNOSTICS_H) diff --git a/gcc/rust/rust-gcc.cc b/gcc/rust/rust-gcc.cc index 8b6410d..ab9cf49 100644 --- a/gcc/rust/rust-gcc.cc +++ b/gcc/rust/rust-gcc.cc @@ -59,7 +59,7 @@ // zero-sized global, create an expression that refers to the decl but // has zero size. tree -Bvariable::get_tree (Location location) const +Bvariable::get_tree (location_t location) const { if (this->t_ == error_mark_node) return error_mark_node; @@ -242,7 +242,7 @@ public: Bvariable *global_variable (const std::string &var_name, const std::string &asm_name, tree type, bool is_external, bool is_hidden, - bool in_unique_section, Location location); + bool in_unique_section, location_t location); void global_variable_set_init (Bvariable *, tree); @@ -899,7 +899,8 @@ Gcc_backend::fill_in_array (tree fill, tree element_type, tree length_tree) // Return a named version of a type. tree -Gcc_backend::named_type (const std::string &name, tree type, Location location) +Gcc_backend::named_type (const std::string &name, tree type, + location_t location) { if (type == error_mark_node) return error_mark_node; @@ -1000,7 +1001,7 @@ Gcc_backend::zero_expression (tree t) // An expression that references a variable. tree -Gcc_backend::var_expression (Bvariable *var, Location location) +Gcc_backend::var_expression (Bvariable *var, location_t location) { return var->get_tree (location); } @@ -1097,7 +1098,7 @@ Gcc_backend::boolean_constant_expression (bool val) // Return the real part of a complex expression. tree -Gcc_backend::real_part_expression (tree complex_tree, Location location) +Gcc_backend::real_part_expression (tree complex_tree, location_t location) { if (complex_tree == error_mark_node) return error_mark_node; @@ -1111,7 +1112,7 @@ Gcc_backend::real_part_expression (tree complex_tree, Location location) // Return the imaginary part of a complex expression. tree -Gcc_backend::imag_part_expression (tree complex_tree, Location location) +Gcc_backend::imag_part_expression (tree complex_tree, location_t location) { if (complex_tree == error_mark_node) return error_mark_node; @@ -1126,7 +1127,7 @@ Gcc_backend::imag_part_expression (tree complex_tree, Location location) tree Gcc_backend::complex_expression (tree real_tree, tree imag_tree, - Location location) + location_t location) { if (real_tree == error_mark_node || imag_tree == error_mark_node) return error_mark_node; @@ -1143,7 +1144,7 @@ Gcc_backend::complex_expression (tree real_tree, tree imag_tree, tree Gcc_backend::convert_expression (tree type_tree, tree expr_tree, - Location location) + location_t location) { if (type_tree == error_mark_node || expr_tree == error_mark_node || TREE_TYPE (expr_tree) == error_mark_node) @@ -1178,7 +1179,7 @@ Gcc_backend::convert_expression (tree type_tree, tree expr_tree, tree Gcc_backend::struct_field_expression (tree struct_tree, size_t index, - Location location) + location_t location) { if (struct_tree == error_mark_node || TREE_TYPE (struct_tree) == error_mark_node) @@ -1209,7 +1210,7 @@ Gcc_backend::struct_field_expression (tree struct_tree, size_t index, // Return an expression that executes BSTAT before BEXPR. tree -Gcc_backend::compound_expression (tree stat, tree expr, Location location) +Gcc_backend::compound_expression (tree stat, tree expr, location_t location) { if (stat == error_mark_node || expr == error_mark_node) return error_mark_node; @@ -1224,7 +1225,7 @@ Gcc_backend::compound_expression (tree stat, tree expr, Location location) tree Gcc_backend::conditional_expression (tree, tree type_tree, tree cond_expr, tree then_expr, tree else_expr, - Location location) + location_t location) { if (type_tree == error_mark_node || cond_expr == error_mark_node || then_expr == error_mark_node || else_expr == error_mark_node) @@ -1335,7 +1336,7 @@ is_floating_point (tree t) // Return an expression for the negation operation OP EXPR. tree Gcc_backend::negation_expression (NegationOperator op, tree expr_tree, - Location location) + location_t location) { /* Check if the expression is an error, in which case we return an error expression. */ @@ -1372,7 +1373,7 @@ Gcc_backend::negation_expression (NegationOperator op, tree expr_tree, tree Gcc_backend::arithmetic_or_logical_expression (ArithmeticOrLogicalOperator op, tree left, tree right, - Location location) + location_t location) { /* Check if either expression is an error, in which case we return an error expression. */ @@ -1473,7 +1474,7 @@ fetch_overflow_builtins (ArithmeticOrLogicalOperator op) // with overflow checking when possible tree Gcc_backend::arithmetic_or_logical_expression_checked ( - ArithmeticOrLogicalOperator op, tree left, tree right, Location location, + ArithmeticOrLogicalOperator op, tree left, tree right, location_t location, Bvariable *receiver_var) { /* Check if either expression is an error, in which case we return an error @@ -1522,7 +1523,7 @@ Gcc_backend::arithmetic_or_logical_expression_checked ( // Return an expression for the comparison operation LEFT OP RIGHT. tree Gcc_backend::comparison_expression (ComparisonOperator op, tree left_tree, - tree right_tree, Location location) + tree right_tree, location_t location) { /* Check if either expression is an error, in which case we return an error expression. */ @@ -1542,7 +1543,7 @@ Gcc_backend::comparison_expression (ComparisonOperator op, tree left_tree, // Return an expression for the lazy boolean operation LEFT OP RIGHT. tree Gcc_backend::lazy_boolean_expression (LazyBooleanOperator op, tree left_tree, - tree right_tree, Location location) + tree right_tree, location_t location) { /* Check if either expression is an error, in which case we return an error expression. */ @@ -1565,7 +1566,7 @@ Gcc_backend::lazy_boolean_expression (LazyBooleanOperator op, tree left_tree, tree Gcc_backend::constructor_expression (tree type_tree, bool is_variant, const std::vector<tree> &vals, - int union_index, Location location) + int union_index, location_t location) { if (type_tree == error_mark_node) return error_mark_node; @@ -1680,7 +1681,7 @@ Gcc_backend::constructor_expression (tree type_tree, bool is_variant, tree Gcc_backend::array_constructor_expression ( tree type_tree, const std::vector<unsigned long> &indexes, - const std::vector<tree> &vals, Location location) + const std::vector<tree> &vals, location_t location) { if (type_tree == error_mark_node) return error_mark_node; @@ -1804,7 +1805,7 @@ Gcc_backend::array_initializer (tree fndecl, tree block, tree array_type, tree Gcc_backend::array_index_expression (tree array_tree, tree index_tree, - Location location) + location_t location) { if (array_tree == error_mark_node || TREE_TYPE (array_tree) == error_mark_node || index_tree == error_mark_node) @@ -1827,7 +1828,7 @@ Gcc_backend::array_index_expression (tree array_tree, tree index_tree, // Create an expression for a call to FN_EXPR with FN_ARGS. tree Gcc_backend::call_expression (tree fn, const std::vector<tree> &fn_args, - tree chain_expr, Location location) + tree chain_expr, location_t location) { if (fn == error_mark_node || TREE_TYPE (fn) == error_mark_node) return error_mark_node; @@ -1938,7 +1939,7 @@ Gcc_backend::init_statement (tree, Bvariable *var, tree init_tree) // Assignment. tree -Gcc_backend::assignment_statement (tree lhs, tree rhs, Location location) +Gcc_backend::assignment_statement (tree lhs, tree rhs, location_t location) { if (lhs == error_mark_node || rhs == error_mark_node) return error_mark_node; @@ -1963,7 +1964,7 @@ Gcc_backend::assignment_statement (tree lhs, tree rhs, Location location) // Return. tree -Gcc_backend::return_statement (tree fntree, tree val, Location location) +Gcc_backend::return_statement (tree fntree, tree val, location_t location) { if (fntree == error_mark_node) return error_mark_node; @@ -1988,7 +1989,8 @@ Gcc_backend::return_statement (tree fntree, tree val, Location location) tree Gcc_backend::exception_handler_statement (tree try_stmt, tree except_stmt, - tree finally_stmt, Location location) + tree finally_stmt, + location_t location) { if (try_stmt == error_mark_node || except_stmt == error_mark_node || finally_stmt == error_mark_node) @@ -2008,7 +2010,7 @@ Gcc_backend::exception_handler_statement (tree try_stmt, tree except_stmt, tree Gcc_backend::if_statement (tree, tree cond_tree, tree then_tree, tree else_tree, - Location location) + location_t location) { if (cond_tree == error_mark_node || then_tree == error_mark_node || else_tree == error_mark_node) @@ -2220,7 +2222,7 @@ Gcc_backend::non_zero_size_type (tree type) // representations. Make sure this does not confuse the middle-end. tree -Gcc_backend::convert_tree (tree type_tree, tree expr_tree, Location location) +Gcc_backend::convert_tree (tree type_tree, tree expr_tree, location_t location) { if (type_tree == TREE_TYPE (expr_tree)) return expr_tree; @@ -2254,7 +2256,7 @@ Bvariable * Gcc_backend::global_variable (const std::string &var_name, const std::string &asm_name, tree type_tree, bool is_external, bool is_hidden, - bool in_unique_section, Location location) + bool in_unique_section, location_t location) { if (type_tree == error_mark_node) return this->error_variable (); @@ -2319,7 +2321,7 @@ Gcc_backend::global_variable_set_init (Bvariable *var, tree expr_tree) Bvariable * Gcc_backend::local_variable (tree function, const std::string &name, tree type_tree, Bvariable *decl_var, - Location location) + location_t location) { if (type_tree == error_mark_node) return this->error_variable (); @@ -2340,7 +2342,7 @@ Gcc_backend::local_variable (tree function, const std::string &name, Bvariable * Gcc_backend::parameter_variable (tree function, const std::string &name, - tree type_tree, Location location) + tree type_tree, location_t location) { if (type_tree == error_mark_node) return this->error_variable (); @@ -2357,7 +2359,7 @@ Gcc_backend::parameter_variable (tree function, const std::string &name, Bvariable * Gcc_backend::static_chain_variable (tree fndecl, const std::string &name, - tree type_tree, Location location) + tree type_tree, location_t location) { if (type_tree == error_mark_node) return this->error_variable (); @@ -2390,7 +2392,7 @@ Gcc_backend::static_chain_variable (tree fndecl, const std::string &name, Bvariable * Gcc_backend::temporary_variable (tree fndecl, tree bind_tree, tree type_tree, tree init_tree, bool is_address_taken, - Location location, tree *pstatement) + location_t location, tree *pstatement) { gcc_assert (fndecl != NULL_TREE); if (type_tree == error_mark_node || init_tree == error_mark_node @@ -2453,7 +2455,8 @@ Gcc_backend::temporary_variable (tree fndecl, tree bind_tree, tree type_tree, // Make a label. tree -Gcc_backend::label (tree func_tree, const std::string &name, Location location) +Gcc_backend::label (tree func_tree, const std::string &name, + location_t location) { tree decl; if (name.empty ()) @@ -2488,7 +2491,7 @@ Gcc_backend::label_definition_statement (tree label) // Make a goto statement. tree -Gcc_backend::goto_statement (tree label, Location location) +Gcc_backend::goto_statement (tree label, location_t location) { return fold_build1_loc (location, GOTO_EXPR, void_type_node, label); } @@ -2496,7 +2499,7 @@ Gcc_backend::goto_statement (tree label, Location location) // Get the address of a label. tree -Gcc_backend::label_address (tree label, Location location) +Gcc_backend::label_address (tree label, location_t location) { TREE_USED (label) = 1; TREE_ADDRESSABLE (label) = 1; @@ -2510,7 +2513,7 @@ Gcc_backend::label_address (tree label, Location location) tree Gcc_backend::function (tree functype, const std::string &name, const std::string &asm_name, unsigned int flags, - Location location) + location_t location) { if (functype != error_mark_node) { @@ -2554,7 +2557,7 @@ Gcc_backend::function (tree functype, const std::string &name, tree Gcc_backend::function_defer_statement (tree function, tree undefer_tree, - tree defer_tree, Location location) + tree defer_tree, location_t location) { if (undefer_tree == error_mark_node || defer_tree == error_mark_node || function == error_mark_node) diff --git a/gcc/rust/rust-linemap.cc b/gcc/rust/rust-linemap.cc index 9abafd4..fb993b9 100644 --- a/gcc/rust/rust-linemap.cc +++ b/gcc/rust/rust-linemap.cc @@ -36,7 +36,7 @@ Linemap::start_file (const char *file_name, unsigned line_begin) // Stringify a location std::string -Linemap::location_to_string (Location location) +Linemap::location_to_string (location_t location) { const line_map_ordinary *lmo; location_t resolved_location; diff --git a/gcc/rust/util/rust-token-converter.cc b/gcc/rust/util/rust-token-converter.cc index ffda24e..67c1459 100644 --- a/gcc/rust/util/rust-token-converter.cc +++ b/gcc/rust/util/rust-token-converter.cc @@ -52,7 +52,7 @@ pop_group (std::vector<ProcMacro::TokenStream> &streams, } static ProcMacro::Span -convert (Location location) +convert (location_t location) { return ProcMacro::Span::make_span (location, 0); } |