-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Remove remaining prototype comments #19392
Merged
TyOverby
merged 7 commits into
dotnet:features/async-main
from
TyOverby:async-main-cleanup-2
May 11, 2017
+328
−52
Merged
Changes from 4 commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
a6a0f43
remove remaining prototype comments, add extension method tests
TyOverby 229e33e
fix old test, address review feedback
TyOverby a54e0ce
ReturnType implemented on each subclass
TyOverby a38527d
added more tests on non-async task returning mains
TyOverby 7aaf3f8
add obsolete tests
TyOverby be56ee9
autoformat
TyOverby 8fe23ca
add better tests for successful task overrides
TyOverby File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -221,13 +221,44 @@ private static MethodSymbol GetEntryPoint(CSharpCompilation compilation, PEModul | |
!hasDeclarationErrors && | ||
!diagnostics.HasAnyErrors()) | ||
{ | ||
var body = synthesizedEntryPoint.CreateBody(); | ||
BoundStatement body = synthesizedEntryPoint.CreateBody(); | ||
|
||
var dynamicAnalysisSpans = ImmutableArray<SourceSpan>.Empty; | ||
VariableSlotAllocator lazyVariableSlotAllocator = null; | ||
var lambdaDebugInfoBuilder = ArrayBuilder<LambdaDebugInfo>.GetInstance(); | ||
var closureDebugInfoBuilder = ArrayBuilder<ClosureDebugInfo>.GetInstance(); | ||
StateMachineTypeSymbol stateMachineTypeOpt = null; | ||
const int methodOrdinal = -1; | ||
|
||
var loweredBody = LowerBodyOrInitializer( | ||
synthesizedEntryPoint, | ||
methodOrdinal, | ||
body, | ||
null, | ||
new TypeCompilationState(synthesizedEntryPoint.ContainingType, compilation, moduleBeingBuilt), | ||
false , | ||
null, | ||
ref dynamicAnalysisSpans, | ||
diagnostics, | ||
ref lazyVariableSlotAllocator, | ||
lambdaDebugInfoBuilder, | ||
closureDebugInfoBuilder, | ||
out stateMachineTypeOpt); | ||
|
||
Debug.Assert((object)lazyVariableSlotAllocator == null); | ||
Debug.Assert((object)stateMachineTypeOpt == null); | ||
Debug.Assert(dynamicAnalysisSpans.IsEmpty); | ||
Debug.Assert(lambdaDebugInfoBuilder.IsEmpty()); | ||
Debug.Assert(closureDebugInfoBuilder.IsEmpty()); | ||
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.
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. Fixed. |
||
|
||
lambdaDebugInfoBuilder.Free(); | ||
closureDebugInfoBuilder.Free(); | ||
|
||
var emittedBody = GenerateMethodBody( | ||
moduleBeingBuilt, | ||
synthesizedEntryPoint, | ||
methodOrdinal, | ||
body, | ||
loweredBody, | ||
ImmutableArray<LambdaDebugInfo>.Empty, | ||
ImmutableArray<ClosureDebugInfo>.Empty, | ||
stateMachineTypeOpt: null, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Could we call
LocalRewriter.Rewrite()
instead?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.
@cston are you talking about this method?
http://source.roslyn.io/#Microsoft.CodeAnalysis.CSharp/Lowering/LocalRewriter/LocalRewriter.cs,64
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.
Yes, the same method that
LowerBodyOrInitializer
calls. It looks likeLowerBodyOrInitializer
handles extra cases (await
, local functions, iterators) that are not needed here.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.
My understanding is that
LowerBodyOrInitializer
is the main entrypoint to lowering a method body, so even though all of its functionality isn't used.