aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/expand/rust-macro-builtins.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/rust/expand/rust-macro-builtins.cc')
-rw-r--r--gcc/rust/expand/rust-macro-builtins.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/gcc/rust/expand/rust-macro-builtins.cc b/gcc/rust/expand/rust-macro-builtins.cc
index 9bed3dd..1133440 100644
--- a/gcc/rust/expand/rust-macro-builtins.cc
+++ b/gcc/rust/expand/rust-macro-builtins.cc
@@ -99,7 +99,6 @@ try_extract_string_literal_from_fragment (const Location &parent_locus,
static std::unique_ptr<AST::LiteralExpr>
try_expand_single_string_literal (AST::Expr *input_expr,
- const Location &invoc_locus,
MacroExpander *expander)
{
auto nodes = try_expand_macro_expression (input_expr, expander);
@@ -116,8 +115,8 @@ try_expand_single_string_literal (AST::Expr *input_expr,
static std::vector<std::unique_ptr<AST::Expr>>
try_expand_many_expr (Parser<MacroInvocLexer> &parser,
- const Location &invoc_locus, const TokenId last_token_id,
- MacroExpander *expander, bool &has_error)
+ const TokenId last_token_id, MacroExpander *expander,
+ bool &has_error)
{
auto restrictions = Rust::ParseRestrictions ();
// stop parsing when encountered a braces/brackets
@@ -204,8 +203,7 @@ parse_single_string_literal (AST::DelimTokenTree &invoc_token_tree,
// when the expression does not seem to be a string literal, we then try
// to parse/expand it as macro to see if it expands to a string literal
auto expr = parser.parse_expr ();
- lit_expr
- = try_expand_single_string_literal (expr.get (), invoc_locus, expander);
+ lit_expr = try_expand_single_string_literal (expr.get (), expander);
}
parser.skip_token (last_token_id);
@@ -265,7 +263,7 @@ load_file_bytes (const char *filename)
} // namespace
AST::Fragment
-MacroBuiltin::assert_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::assert_handler (Location, AST::MacroInvocData &)
{
rust_debug ("assert!() called");
@@ -273,7 +271,7 @@ MacroBuiltin::assert_handler (Location invoc_locus, AST::MacroInvocData &invoc)
}
AST::Fragment
-MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &)
{
auto current_file
= Session::get_instance ().linemap->location_file (invoc_locus);
@@ -283,7 +281,7 @@ MacroBuiltin::file_handler (Location invoc_locus, AST::MacroInvocData &invoc)
}
AST::Fragment
-MacroBuiltin::column_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::column_handler (Location invoc_locus, AST::MacroInvocData &)
{
auto current_column
= Session::get_instance ().linemap->location_to_column (invoc_locus);
@@ -401,7 +399,7 @@ MacroBuiltin::concat_handler (Location invoc_locus, AST::MacroInvocData &invoc)
auto last_token_id = macro_end_token (invoc_token_tree, parser);
/* NOTE: concat! could accept no argument, so we don't have any checks here */
- auto expanded_expr = try_expand_many_expr (parser, invoc_locus, last_token_id,
+ auto expanded_expr = try_expand_many_expr (parser, last_token_id,
invoc.get_expander (), has_error);
for (auto &expr : expanded_expr)
{
@@ -451,7 +449,7 @@ MacroBuiltin::env_handler (Location invoc_locus, AST::MacroInvocData &invoc)
std::unique_ptr<AST::LiteralExpr> lit_expr = nullptr;
bool has_error = false;
- auto expanded_expr = try_expand_many_expr (parser, invoc_locus, last_token_id,
+ auto expanded_expr = try_expand_many_expr (parser, last_token_id,
invoc.get_expander (), has_error);
if (has_error)
return AST::Fragment::create_error ();
@@ -591,7 +589,7 @@ MacroBuiltin::include_handler (Location invoc_locus, AST::MacroInvocData &invoc)
}
AST::Fragment
-MacroBuiltin::line_handler (Location invoc_locus, AST::MacroInvocData &invoc)
+MacroBuiltin::line_handler (Location invoc_locus, AST::MacroInvocData &)
{
auto current_line
= Session::get_instance ().linemap->location_to_line (invoc_locus);