}
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;
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;
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
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)
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)
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_ ()
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 *);
// 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_;
};
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 ())
// 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;
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);
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
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;
// 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)
{}
// 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;
// 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));
}
// 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>>
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 (); }
// 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.
{
std::string name;
tree type;
- Location location;
+ location_t location;
typed_identifier () : name (), type (NULL_TREE), location (UNKNOWN_LOCATION)
{}
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.
// 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
// 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,
// *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.
}
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 ())
}
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;
}
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;
};
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);
}
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;
}
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;
}
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;
}
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;
}
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;
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;
}
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);
}
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);
#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)
// 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;
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);
// 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;
// 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);
}
// 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;
// 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;
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;
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)
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)
// 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;
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)
// 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. */
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. */
// 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
// 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. */
// 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. */
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;
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;
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)
// 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;
// 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;
// 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;
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)
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)
// 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;
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 ();
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 ();
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 ();
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 ();
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
// 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 ())
// 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);
}
// 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;
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)
{
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)
// 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;
}
static ProcMacro::Span
-convert (Location location)
+convert (location_t location)
{
return ProcMacro::Span::make_span (location, 0);
}