From: Pierre-Emmanuel Patry Date: Wed, 18 Oct 2023 13:04:58 +0000 (+0200) Subject: gccrs: Add a function to check if a function is variadic X-Git-Tag: basepoints/gcc-15~2012 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51;p=thirdparty%2Fgcc.git gccrs: Add a function to check if a function is variadic This function provides an easy way to check for a function's varidicity. gcc/rust/ChangeLog: * ast/rust-item.h: Add a getter to check if a given function is variadic. Signed-off-by: Pierre-Emmanuel Patry --- diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 38d8b53a43ca..109680a1d78d 100644 --- a/gcc/rust/ast/rust-item.h +++ b/gcc/rust/ast/rust-item.h @@ -1682,6 +1682,12 @@ public: void accept_vis (ASTVisitor &vis) override; + bool is_variadic () const + { + return function_params.size () != 0 + && function_params.back ().is_variadic (); + } + // Invalid if block is null, so base stripping on that. void mark_for_strip () override { function_body = nullptr; } bool is_marked_for_strip () const override