-
-
Notifications
You must be signed in to change notification settings - Fork 40
Pragma to force function inlining #462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
src/rewriter.fs
Outdated
forceInlineNextFunction <- None | ||
Some tl | ||
| tl -> Some tl | ||
let li = li |> List.choose processPragmas |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not let needed: li |> List.choose processPragmas |>
src/rewriter.fs
Outdated
let mutable forceInlineNextFunction = None | ||
let processPragmas tl = | ||
match tl with | ||
| TLDirective ["#pragma function inline"] -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
String matching is very restricted and will fail if there's any extra whitespace.
In theory, we could parse the pragmas in the parser.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll accept multiple spaces. But I'm not so sure that the parser is the best place to process a format that's specific to minifier rather than specific to the language.
| None -> () | ||
forceInlineNextFunction <- None | ||
Some tl | ||
| tl -> Some tl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if #pragma function inline
is not followed by a function?
Do we want to handle that case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could emit a warning for unused function inline pragmas.
No description provided.