-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Add internal instrumentation API for switch expression arm's expression #43430
Changes from 1 commit
5469157
5f72ae8
a31caa6
305734c
8d9ba66
4d380c5
b21dd7d
ddfa6a8
db9d300
cc5b09b
9b5cbb0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -92,10 +92,7 @@ private BoundExpression LowerSwitchExpression(BoundConvertedSwitchExpression nod | |
sectionBuilder.Add(_factory.Label(arm.Label)); | ||
var loweredValue = _localRewriter.VisitExpression(arm.Value); | ||
if (GenerateSequencePoints) | ||
{ | ||
// Should go through this._localRewriter._instrumenter; see https://github.com/dotnet/roslyn/issues/42810 | ||
loweredValue = new BoundSequencePointExpression(arm.Value.Syntax, loweredValue, loweredValue.Type); | ||
} | ||
loweredValue = this._localRewriter._instrumenter.InstrumentSwitchExpressionArmExpression(arm.Value, loweredValue, _factory); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
It is not clear why instrumentation would be linked to generation of sequence points. #Closed There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you prefer I will rename |
||
|
||
sectionBuilder.Add(_factory.Assignment(_factory.Local(resultTemp), loweredValue)); | ||
sectionBuilder.Add(_factory.Goto(afterSwitchExpression)); | ||
|
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.
If we are going to keep the
if
at the end, consider keeping braces as well. #ClosedThere 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.
All single-line if statements in this source file are without braces. I prefer to maintain that consistency.
In reply to: 410986252 [](ancestors = 410986252)