]>
git.ipfire.org Git - thirdparty/gcc.git/commit
gccrs: Implement let statement support for IdentifierPattern's subpatterns
Trimmed GIMPLE code gen for let-identifierpattern-subpattern.rs
...
RUSTTMP.1.__0 = 0;
RUSTTMP.1.__1 = 2;
RUSTTMP.1.__2 = 3;
bar = RUSTTMP.1.__0;
RUSTTMP.2 = RUSTTMP.1.__1;
RUSTTMP.3 = RUSTTMP.1.__2;
foo.__0 = 0;
foo.__1 = 2;
foo.__2 = 3;
ret = 1;
RUSTTMP.5 = foo;
_1 = RUSTTMP.5.__0;
_2 = _1 == 0;
_3 = RUSTTMP.5.__1;
_4 = _3 == 2;
_5 = _2 & _4;
_6 = RUSTTMP.5.__2;
_7 = _6 == 3;
_8 = _5 & _7;
if (_8 != 0) goto <D.143>; else goto <D.144>;
<D.143>:
{
{
ret = bar;
}
goto <D.137>;
}
...
gcc/rust/ChangeLog:
* backend/rust-compile-pattern.cc(CompilePatternLet::visit(IdentifierPattern)):
Add support for subpatterns.
* backend/rust-compile-var-decl.h(CompileVarDecl::visit(IdentifierPattern)):
Implement compilation for subpatterns.
Signed-off-by: Yap Zhi Heng <yapzhhg@gmail.com>