diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-10-18 15:04:58 +0200 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2023-11-09 15:39:45 +0000 |
commit | 56d6246dbbbaf7566d31f94654c96dc5a4681e49 (patch) | |
tree | 5d47738e8e7483d0a5b19ca3a4a9a2137e17d2fa /gcc | |
parent | afb8e75e08526cdde7a513a56050046dc0ba0368 (diff) | |
download | gcc-56d6246dbbbaf7566d31f94654c96dc5a4681e49.zip gcc-56d6246dbbbaf7566d31f94654c96dc5a4681e49.tar.gz gcc-56d6246dbbbaf7566d31f94654c96dc5a4681e49.tar.bz2 |
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/rust/ast/rust-item.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h index 74dd8c1..c4653d9 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 |