Skip to content

Move creation and initialization of strings into a rt helper #3403

Closed
@nikomatsakis

Description

@nikomatsakis

As part of the trans refactoring, the initialization of new strings was moved from an upcall (upcall_str_new_uniq) into inlined LLVM. This is a consolidated code path, which is nice, and also potentially very efficient (especially for short strings). However, @brson @graydon and I were thinking that the ideal thing is probably to code up these kinds of repeated loops and other helpers into inlined functions in core::rt and invoke those. This way LLVM can do the inlining when it seems most appropriate. An alternative might be to generate the helpers in trans in a special way instead, though coding up the functions in Rust is probably easier and nicer overall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions