-
Notifications
You must be signed in to change notification settings - Fork 1.6k
generator refactoring #1373
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
Merged
StephanTLavavej
merged 4 commits into
microsoft:master
from
CaseyCarter:generator-cleanup
Oct 17, 2020
Merged
generator refactoring #1373
StephanTLavavej
merged 4 commits into
microsoft:master
from
CaseyCarter:generator-cleanup
Oct 17, 2020
Conversation
This file contains hidden or 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
Restore kernel mode operation by defining `unhandled_exception` only when `_KERNEL_MODE` is not defined. (When `unhandled_exception` is defined, the compiler will wrap the coroutine body in a `try...catch` as depicted in [dcl.fct.def.coroutine]/5, which it then diagnoses as ill-formed when unwinding is disabled as in `/kernel`.) Fixes microsoft#1323. Some cleanup while we're here: * Use STL style: * Prefer not to deduce simple return types * `const` west * introduce template type parameters with `class` * Annotate functions that don't throw exceptions `noexcept` * remove excess empy lines * Use `_Capital_snake` names for non-template-parameters * `generator::promise_type` only has members `_Exception` and `_Rethrow_if_exception` to "delay" exception delivery so as to avoid triggering VSO-1172852. They aren't needed in kernel mode. * `generator::iterator` should have _explicit_ conversion from `coroutine_handle` rather than implicit for good design hygiene. The conversion from `nullptr_t` is unnecessary. Note that the story for `/EHs-` without `/kernel` is less clear and currently not supported.
CaseyCarter
commented
Oct 14, 2020
GorNishanov
approved these changes
Oct 14, 2020
GorNishanov
left a comment
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.
LGTM!
joemmett
approved these changes
Oct 14, 2020
cbezault
approved these changes
Oct 14, 2020
Co-authored-by: Curtis J Bezault <curtbezault@gmail.com>
StephanTLavavej
approved these changes
Oct 15, 2020
StephanTLavavej
approved these changes
Oct 16, 2020
Member
|
Thanks for fixing this regression! I was unable to think of a clever pun involving |
Contributor
Author
|
It was Colonel 🍿, in the conservatory, with the lead pipe! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Restore kernel mode operation by defining
unhandled_exceptiononly when_KERNEL_MODEis not defined. (Whenunhandled_exceptionis defined, the compiler will wrap the coroutine body in atry...catchas depicted in [dcl.fct.def.coroutine]/5, which it then diagnoses as ill-formed when unwinding is disabled as in/kernel.)Fixes #1323.
Some cleanup while we're here:
constwestclassnoexcept_Capital_snakenames for non-template-parametersgenerator::promise_typeonly has members_Exceptionand_Rethrow_if_exceptionto "delay" exception delivery so as to avoid triggering VSO-1172852. They aren't needed in kernel mode.generator::iteratorshould have explicit conversion fromcoroutine_handlerather than implicit for good design hygiene. The conversion fromnullptr_tis unnecessary.Note that the story for
/EHs-without/kernelis less clear and currently not supported.