LLVM 22.0.0git
llvm::sandboxir::IRSnapshotChecker Class Reference

A class that saves hashes and textual IR snapshots of functions in a SandboxIR Context, and does hash comparison when expectNoDiff is called. More...

#include "llvm/SandboxIR/Tracker.h"

Public Member Functions

 IRSnapshotChecker (Context &Ctx)
void save ()
 Saves a snapshot of the current state.
void expectNoDiff ()
 Checks current state against saved state, crashes if different.

Detailed Description

A class that saves hashes and textual IR snapshots of functions in a SandboxIR Context, and does hash comparison when expectNoDiff is called.

If hashes differ, it prints textual IR for both old and new versions to aid debugging.

This is used as an additional debug check when reverting changes to SandboxIR, to verify the reverted state matches the initial state.

Definition at line 79 of file Tracker.h.

Constructor & Destructor Documentation

◆ IRSnapshotChecker()

llvm::sandboxir::IRSnapshotChecker::IRSnapshotChecker ( Context & Ctx)
inline

Definition at line 106 of file Tracker.h.

Member Function Documentation

◆ expectNoDiff()

void IRSnapshotChecker::expectNoDiff ( )

Checks current state against saved state, crashes if different.

Definition at line 72 of file Tracker.cpp.

References llvm_unreachable.

◆ save()

void IRSnapshotChecker::save ( )

Saves a snapshot of the current state.

If there was any previous snapshot, it will be replaced with the new one.

Definition at line 70 of file Tracker.cpp.


The documentation for this class was generated from the following files: