Skip to content

Inline direct calls to enum variant constructors in the frontend #15400

Closed
@pcwalton

Description

@pcwalton

When we see a direct call to an enum variant constructor, we should just inline it in the frontend. This has two important benefits, one obvious and one not-so-obvious: (1) it reduces compilation time; (2) it can often avoid one memcpy, because we can simply write the discriminant and variant payload in place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationI-compiletimeIssue: Problems and improvements with respect to compile times.I-slowIssue: Problems and improvements with respect to performance of generated code.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions