-
Notifications
You must be signed in to change notification settings - Fork 10.5k
[SILVerifier] Add a flag to not abort upon verification failure. #12519
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
Conversation
lib/SIL/SILVerifier.cpp
Outdated
@@ -139,7 +142,10 @@ class SILVerifier : public SILVerifierBase<SILVerifier> { | |||
F.print(llvm::dbgs()); | |||
} | |||
|
|||
abort(); | |||
if (AbortOnFailure) |
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.
Just change this to use exit(1).
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.
Terrific, I'll do it early tomorrow and update the pull request.
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.
Do you happen to know why the behaviour was to abort (probably historical reasons)?
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.
I looked before I wrote that ; ). It is really really old (from revision < 10k IIRC). I think it was just someone working quickly.
@swift-ci please test |
@dcci I was talking with some other people and they pointed out that abort is important for crashing in the debugger. So can you add the option back (sorry!) |
Oh, sure, no worries. Mind if I add a comment to explain the behaviour? |
@swift-ci please test |
Build failed |
Build failed |
This matches what LLVM does, and makes testing/fuzzing easier. It's also slightly more friendly in case the user violates an assumption. It can't be turned on by default (yet) because it's important to crash on verification failures, when running swiftc in a debugger.
The build was failing yesterday for unrelated reasons, rebased. |
@swift-ci please smoke test |
@eeckstein what do you think about this one? I can put on hold and have this patch locally for now if you want to discuss further the whole abort VS exit in the verifier. |
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
Exit somewhat carefully instead. This matches what LLVM does,
and makes testing/fuzzing easier. It's also slightly more friendly
in case the user violates an assumption.
I'd prefer to have the compiler never aborting on user input (in particular, something text based), but this seems an OK middle-ground. I'll be happy to change the default altogether if people like it.