Prerequisites
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.
Prerequisites
Engine area
Delphi language support
Improvement description
Delphi 13 has introduced a new
noreturnroutine directive.It indicates to the compiler that "the call is going to raise an exception and not complete regular execution."
Applying the
noreturndirective 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
noreturnroutine is theOutOfMemoryErrorprocedure in the standard library. It unconditionally raises a cachedOutOfMemoryException.We'll need to:
noreturntoken)noreturnroutines like unconditional exception raisesRoutineDirectiveenumSee
noreturnDirectiveRationale
Delphi 13 support.