[gcc r14-8127] gccrs: Add a function to check if a function is variadic
Arthur Cohen
cohenarthur@gcc.gnu.org
Tue Jan 16 18:15:55 GMT 2024
https://gcc.gnu.org/g:41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51
commit r14-8127-g41f480d16d3c6cc1e901d2ae3fcd4a9b5706aa51
Author: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Date: Wed Oct 18 15:04:58 2023 +0200
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>
Diff:
---
gcc/rust/ast/rust-item.h | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/gcc/rust/ast/rust-item.h b/gcc/rust/ast/rust-item.h
index 38d8b53a43c..109680a1d78 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
More information about the Gcc-cvs
mailing list