improve try-finally handling of nofallthru#8171
Conversation
|
Thanks for your pull request, @WalterBright! Bugzilla referencesYour PR doesn't reference any Bugzilla issue. If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog. Testing this PR locallyIf you don't have a local development environment setup, you can use Digger to test this PR: dub fetch digger
dub run digger -- build "master + dmd#8171" |
|
Important to pull this because it makes my keynote presentation look better :-) |
564c7e6 to
c73dcae
Compare
|
On windows 32 and 64: Doesn't seem to have anything to do with this change? |
c73dcae to
0d0168b
Compare
0d0168b to
3e36500
Compare
|
Removing auto-merge tag to de-prioritize the build. The windows platforms are failing consistently. There isn't a systemic windows platform failing on any other builds, which points strongly to this pull being broken in some way still. |
| Statement _body; | ||
| Statement finalbody; | ||
|
|
||
| bool bodyFallsThru; // true if _body falls through to finally |
There was a problem hiding this comment.
Note that this is very similar in spirit to #5501, which was promptly shot down back then without offering an alternative solution.
Both add extra fields for metadata that can totally be inferred from the after-semantic AST, but is more convenient to collect during semantic analysis, and that is used by one particular backend implementation.
@ibuclaw, time to get on your soapbox again and settle this debate once and for all?
There was a problem hiding this comment.
Indeed this field does look pretty pointless.
There was a problem hiding this comment.
There should ideally be a region that's reserved for per compiler specific information. For arguments sake, let's give it a void pointer type in the frontend. Here is stored information that can be read or set by the backend before, in-between, or after the semantic passes. In the case of LDC, I'd be surprised if you couldn't add your own PGO pass to achieve the same result - just at the slight cost of compile time.
There was at the time, but now it is clear that there is something wrong with this PR. |
3e36500 to
e6512c6
Compare
e6512c6 to
227f035
Compare
If the try-body does not fall-through to the finally-body, we can improve the code generation by marking that block as an exit node (treated as a does-not-get-here node). Saves a few instructions in generated code.