Skip to content

Support noreturn routine directive #410

@cirras

Description

@cirras

Prerequisites

  • This improvement has not already been suggested.
  • This improvement would be generally useful, not specific to my code or setup.

Engine area

Delphi language support

Improvement description

Delphi 13 has introduced a new noreturn routine directive.

It indicates to the compiler that "the call is going to raise an exception and not complete regular execution."

Applying the noreturn directive tells the compiler that it can make some optimizations and skip some warnings at the callsite (like W1035) since regular execution will not continue after the call.

A good example of a noreturn routine is the OutOfMemoryError procedure in the standard library. It unconditionally raises a cached OutOfMemoryException.

We'll need to:

  • parse the new syntax (noreturn token)
  • extend the CFG to treat calls to noreturn routines like unconditional exception raises
  • API: extend the RoutineDirective enum

See

Rationale

Delphi 13 support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    engineImprovements to the core engineenhancementImprovements to an existing feature

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions