diff options
author | Philip Herron <philip.herron@embecosm.com> | 2022-04-19 16:32:50 +0100 |
---|---|---|
committer | Philip Herron <philip.herron@embecosm.com> | 2022-04-19 17:00:32 +0100 |
commit | c3a3e1053f41819d1f6ff8fa68bcd4aca9fc5f80 (patch) | |
tree | f8cb8963830aa550b78afaa8e1f285955ae68efc /gcc/rust/resolve/rust-ast-resolve-pattern.h | |
parent | d17e0aa7695ddb383e0a4fc43185e2ab42c81703 (diff) | |
download | gcc-c3a3e1053f41819d1f6ff8fa68bcd4aca9fc5f80.zip gcc-c3a3e1053f41819d1f6ff8fa68bcd4aca9fc5f80.tar.gz gcc-c3a3e1053f41819d1f6ff8fa68bcd4aca9fc5f80.tar.bz2 |
Support pattern bindings within function signitures
This reuses our code to handle match-arams within MatchExpressions, we
resolve the pattern's type's and implicitly create types for that binding.
For code-generation we create a tmp var name for the name of the parameter
which is the base type and for the destructuring we reuse the same match
arm code to generate the implicit bindings to the parts of the structure
```c
__attribute__((cdecl))
i32 test::pattern_as_arg (const struct test::Pattern RSTPRM.0)
{
i32 RUSTTMP.1;
return RSTPRM.0.0;
}
```
Fixes #995
Diffstat (limited to 'gcc/rust/resolve/rust-ast-resolve-pattern.h')
0 files changed, 0 insertions, 0 deletions