SILVerifier - option to verify with or without linear lifetime check

Add a separate 'verifyOwnership()' entry point so it's possible
to check OSSA lifetimes at various points.

Move SILGenCleanup into a SILGen pass pipeline.

After SILGen, verify incomplete OSSA.

After SILGenCleanup, verify ownership.
This commit is contained in:
Andrew Trick
2023-03-01 18:58:53 -08:00
parent 103a6fefb8
commit c588c657f5
10 changed files with 115 additions and 37 deletions

View File

@@ -904,7 +904,17 @@ public:
/// Run the SIL verifier to make sure that all Functions follow
/// invariants.
void verify() const;
void verify(bool isCompleteOSSA = true,
bool checkLinearLifetime = true) const;
/// Run the SIL verifier without assuming OSSA lifetimes end at dead end
/// blocks.
void verifyIncompleteOSSA() const {
verify(/*isCompleteOSSA=*/false);
}
/// Check linear OSSA lifetimes, assuming complete OSSA.
void verifyOwnership() const;
/// Check if there are any leaking instructions.
///