You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor CompileDrop to keep Context as a member
instead of passing it to each method.
Move the drop candidate note/peek operations from
Context to DropBuilder. This keeps the drop-specific
API off the compile Context.
gcc/rust/ChangeLog:
* Make-lang.in: Add rust-compile-drop-builder.o.
* backend/rust-compile-base.cc
(HIRCompileBase::compile_function_body):
Update CompileDrop calls.
* backend/rust-compile-block.cc (CompileBlock::visit):
Update CompileDrop calls.
* backend/rust-compile-context.h (Context): Allow
DropBuilder to access drop candidate storage and move
drop candidate APIs to DropBuilder.
* backend/rust-compile-drop.cc (CompileDrop::CompileDrop):
Add constructor.
(CompileDrop::type_has_drop_impl): Use stored Context member.
(CompileDrop::compile_drop_call): Likewise.
(CompileDrop::emit_current_scope_drop_calls): Use stored
Context member and get drop candidates from DropBuilder.
* backend/rust-compile-drop.h: Store Context as a member.
* backend/rust-compile-pattern.cc (CompilePatternLet::visit):
Use DropBuilder and update CompileDrop calls.
* backend/rust-compile-drop-builder.cc: New file.
* backend/rust-compile-drop-builder.h: New file.
Signed-off-by: Lishin <lishin1008@gmail.com>
0 commit comments