-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[sil][debug-info] Refactor SILInstruction SILLocation verification out of SILVerifier onto a helper/use to verify in SILBuilder #37468
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
[sil][debug-info] Refactor SILInstruction SILLocation verification out of SILVerifier onto a helper/use to verify in SILBuilder #37468
Conversation
070bc44
to
7d60941
Compare
@swift-ci test |
Build failed |
Build failed |
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
@@ -95,7 +95,7 @@ class SILDebugScope : public SILAllocated<SILDebugScope> { | |||
}; | |||
|
|||
/// Determine whether an instruction may not have a SILDebugScope. | |||
bool maybeScopeless(SILInstruction &I); | |||
bool maybeScopeless(const SILInstruction &inst); |
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.
Weird API name. It should be requiresDebugScope
7d60941
to
38e6c6f
Compare
@swift-ci test |
Build failed |
Build failed |
…gument. This function only uses the reference in a const way, so nothing changes functionally, we can just pass it into contexts where we have a const reference without fighting the compiler.
…on of debug info on SILInstructions into a method on SILInstruction. The verifier just invokes this method, so we aren't losing any verification in the SILVerifier itself. The reason why I am extracting this information into a helper is that often times one hits these structural assertions in the verifier making one have to track down where in a pass the bad location was actually inserted. To make these easier to find, I am going to change the SILBuilder to invoke these structural comparisons so that we can catch these problems at the call site making it easier to fix code.
…tructurally with the provided SILLocation. These checks used to be in the SILVerifier only so one had to drop down into the debugger to figure out where a pass actually introduced the bad location. With this change, we abort immediately in the place in the code where the problem happens allowing for one to quickly fix the problems.
38e6c6f
to
e88134b
Compare
@swift-ci test |
@swift-ci test windows platform |
This will ensure that we catch these issues earlier when they are introduced rather than after a pass that introduced the problem finished running (and we run the verifier).