[sil-verifier] Split SILVerifier verificationFailure into separate functions for Instructions, Arguments, and add a variant for Values.

This also required me to change how we handled which instruction/argument we
emit an error about in the verifier. Previously we were using two global
variables that we made nullptr to control which thing we emitted an error about.
This was unnecessary. Instead I added a little helper struct that internally
controls what we will emit an error about and an external "guard" RAII struct
that makes sure we push/pop the instruction/argument we are erroring upon
correctly.
This commit is contained in:
Michael Gottesman
2025-11-20 13:03:18 -08:00
parent b6dfb30f1e
commit c876c1ee88
8 changed files with 294 additions and 63 deletions

View File

@@ -22,7 +22,7 @@ private func require(_ condition: Bool, _ message: @autoclosure () -> String, at
if !condition {
let msg = message()
msg._withBridgedStringRef { stringRef in
BridgedVerifier.verifierError(stringRef, atInstruction.bridged, Optional<Argument>.none.bridged)
BridgedVerifier.verifierError(stringRef, atInstruction.bridged)
}
}
}