diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-10-18 15:04:58 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 19:13:12 +0100 |
commit | 41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51 (patch) | |
tree | 62aed0930a520409dfcfac3fbe93b29190703557 /gcc/rust/ast | |
parent | 6ac7d47338bb8c34f3751be77be05fa9ca456921 (diff) | |
download | gcc-41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51.zip gcc-41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51.tar.gz gcc-41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51.tar.bz2 |
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 <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/rust/ast')
-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 38d8b53..109680a 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 |