-
Notifications
You must be signed in to change notification settings - Fork 753
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
In-lining Resources and Modules when assigned to a variable #4069
In-lining Resources and Modules when assigned to a variable #4069
Conversation
1005ac7
to
a8fefd1
Compare
…lid-variable-1545
if (this.currentDeclaration is not null) | ||
{ | ||
this.shouldInlineCache[this.currentDeclaration] = !shouldNotInline; | ||
if (shouldNotInline) | ||
{ | ||
this.shouldNotInlineCache.Add(this.currentDeclaration); | ||
} | ||
} |
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'm assuming this logic is to differentiate the default (don't inline) from an explicit decision not to inline. Rather than introducing 2 caches, would it be possible to modify to use a single cache with an enum - e.g. values to indicate "NotEvaluated", "Inline", "DoNotInline"?
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.
+1
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 added enum with NotInline
, Inline
and SkipInline
values.
// referencing a module directly should be blocked at an earlier stage - there is nothing great we can codegen here. | ||
Debug.Fail("Found direct module variable access"); |
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've created #4320 just to make sure we keep track of the original problem.
…lid-variable-1545
…lid-variable-1545
…lid-variable-1545
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.
Looks great!
Fixes #1545
Fixes #4331
Contributing a feature