Skip to content

Commit aa0b8b1

Browse files
committed
dfmc-optimization: Warn when inline-only inlining fails
* sources/dfmc/optimization/check.dylan (check-optimized-reference on <&function>, check-optimized-reference on <&cache-header-engine-node>): Emit a warning when an IEP has to be constructed for a function declared as inline-only.
1 parent 2b8d4ed commit aa0b8b1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

sources/dfmc/optimization/check.dylan

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ define method check-optimized-reference
5959
(c :: <computation>, ref :: <object-reference>, f :: <&function>,
6060
check-forward-refs? :: <boolean>) => ()
6161
if (model-compile-stage-only?(f) | inlined-inline-only-function?(f))
62+
note(<calling-inline-only-function-out-of-line>,
63+
source-location: dfm-source-location(c),
64+
context-id: dfm-context-id(c),
65+
inline-only-function: f);
6266
let copy = find-inline-copy(current-compilation-record(), f);
6367
reference-value(ref) := copy
6468
end;
@@ -77,6 +81,10 @@ define method check-optimized-reference
7781
// format-out(">>> check-optimized-reference CHEN (%=) %= %= %=\n", object-class(c), c, ref, e);
7882
let f :: <&generic-function> = ^cache-header-engine-node-parent(e);
7983
if (model-compile-stage-only?(f) | inlined-inline-only-function?(f))
84+
note(<calling-inline-only-function-out-of-line>,
85+
source-location: dfm-source-location(c),
86+
context-id: dfm-context-id(c),
87+
inline-only-function: f);
8088
let copy = find-inline-copy(current-compilation-record(), f);
8189
^cache-header-engine-node-parent(e) := copy;
8290
end;

0 commit comments

Comments
 (0)