SIL: Check for leaked instructions in the SILVerifier and in the SILModule destructor.

This commit is contained in:
Erik Eckstein
2020-09-10 14:54:23 +02:00
parent 61f2e7b793
commit 56c857afa9
4 changed files with 65 additions and 2 deletions

View File

@@ -650,6 +650,19 @@ public:
/// invariants.
void verify() const;
/// Check if there are any leaking instructions.
///
/// Aborts with an error if more instructions are allocated than contained in
/// the module.
void checkForLeaks() const;
/// Check if there are any leaking instructions after the SILModule is
/// destructed.
///
/// The SILModule destructor already calls checkForLeaks(). This function is
/// useful to check if the destructor itself destroys all data structures.
static void checkForLeaksAfterDestruction();
/// Pretty-print the module.
void dump(bool Verbose = false) const;