
INLINE
The INLINE directive lets you selectively
prevent the compiler
from considering procedures eligible for inlining. Specifying >>INLINE
OFF prevents the compiler from inlining procedures referenced by PERFORM
statements. If the NOINLINE
compiler option is in
effect, all INLINE directives are ignored. The relative location of
an INLINE directive to the definition of a procedure name is important
for determining the inlining behavior for that procedure.
- ON
Specifies that the compiler determines if the procedures within the scope of the directive are inlined in a specific PERFORM statement when
OPTIMIZE(1)
orOPTIMIZE(2)
is in effect.- OFF
Specifies that procedures within the scope of the directive will not be inlined when referenced by PERFORM statements, no matter which optimization level setting is in effect.



Syntax and general rules
You must specify >>INLINE ON or >>INLINE OFF on a line by itself, in either Area A or Area B.
- Within a COPY or REPLACE statement
- Between the lines of a continued character string
- In the middle of a COBOL statement
The >>INLINE ON or >>INLINE OFF specification is limited to the current compilation unit.


Inlining eligibility of procedures for PERFORM statements
- This INLINE
directive appears before the definition of the procedure
name
- and
- There are no other intervening INLINE directives between the definition of the procedure name and this particular INLINE directive
- The procedure is in the scope of an INLINE
ON directive
- or
- The INLINE compiler option is in effect and the procedure is not in the scope of an INLINE OFF directive
For a section that contains paragraphs, it is possible that this section is under the scope of one INLINE directive while some of its paragraphs are under the scope of another INLINE directive.

Example
Following is an example of the effect of the inlining directive on a section that is comprised of one or more paragraphs:
>>INLINE ON
MY-SUBROUTINE SECTION.
MY-PARAGRAPH-ONE.
.
.
>>INLINE OFF
MY-PARAGRAPH-TWO.
.
.
MY-PARAGRAPH-THREE.
.
.
EXIT.
- Procedure MY-SUBROUTINE will be eligible for inlining in any statements that PERFORM it.
- Procedure MY-PARAGRAPH-ONE will be eligible for inlining in any statements that PERFORM it.
- Procedure MY-PARAGRAPH-TWO will not be eligible for inlining in any statements that PERFORM it.
- Procedure MY-PARAGRAPH-THREE will not be eligible for inlining in any statements that PERFORM it.
- Procedures MY-PARAGRAPH-ONE through MY-PARAGRAPH-THREE will be eligible for inlining in any statements that PERFORM "MY-PARAGRAPH-ONE THRU MY-PARAGRAPH-THREE", because MY-PARAGRAPH-ONE is eligible for inlining in a PERFORM statement.

