40#ifndef LLVM_SANDBOXIR_TRACKER_H
41#define LLVM_SANDBOXIR_TRACKER_H
88 Value *OrigV =
nullptr;
93 void revert() final { U.set(OrigV); }
107 struct InstrAndOperands {
120 std::unique_ptr<sandboxir::Value> ErasedIPtr;
129 OS <<
"EraseFromParent";
153 OS <<
"RemoveFromParent";
210 void track(std::unique_ptr<IRChangeBase> &&Change);
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
mir Rename Register Operands
Module.h This file contains the declarations for the Module class.
This file defines the PointerUnion class, which is a discriminated union of pointer types.
This file defines the SmallVector class.
A discriminated union of two or more pointer types, with the discriminator in the low bit of the poin...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
This class implements an extremely fast bulk output stream that can only output to a stream.
void dump(raw_ostream &OS) const final
void accept() final
This runs when changes get accepted.
LLVM_DUMP_METHOD void dump() const final
void revert() final
This runs when changes get reverted.
The base class for IR Change classes.
virtual void revert()=0
This runs when changes get reverted.
void dumpCommon(raw_ostream &OS) const
virtual LLVM_DUMP_METHOD void dump() const =0
unsigned getIdx() const
\Returns the index of this change by iterating over all changes in the tracker.
friend raw_ostream & operator<<(raw_ostream &OS, const IRChangeBase &C)
virtual ~IRChangeBase()=default
virtual void accept()=0
This runs when changes get accepted.
virtual void dump(raw_ostream &OS) const =0
A sandboxir::User with operands, opcode and linked with previous/next instructions in an instruction ...
LLVM_DUMP_METHOD void dump() const final
void accept() final
This runs when changes get accepted.
void revert() final
This runs when changes get reverted.
void dump(raw_ostream &OS) const final
void dump(raw_ostream &OS) const final
void revert() final
This runs when changes get reverted.
Instruction * getInstruction() const
void accept() final
This runs when changes get accepted.
LLVM_DUMP_METHOD void dump() const final
The tracker collects all the change objects and implements the main API for saving / reverting / acce...
@ Record
ā€¨Tracking is disabled
void revert()
Stops tracking and reverts to saved state.
TrackerState getState() const
\Returns the current state of the tracker.
friend raw_ostream & operator<<(raw_ostream &OS, const Tracker &Tracker)
void dump(raw_ostream &OS) const
bool isTracking() const
\Returns true if the tracker is recording changes.
void save()
Turns on IR tracking.
bool InMiddleOfCreatingChange
Helps catch bugs where we are creating new change objects while in the middle of creating other chang...
Context & getContext() const
void track(std::unique_ptr< IRChangeBase > &&Change)
Record Change and take ownership.
void accept()
Stops tracking and accept changes.
LLVM_DUMP_METHOD void dump() const
Tracks the change of the source Value of a sandboxir::Use.
UseSet(const Use &U, Tracker &Tracker)
void dump(raw_ostream &OS) const final
void accept() final
This runs when changes get accepted.
LLVM_DUMP_METHOD void dump() const final
void revert() final
This runs when changes get reverted.
Represents a Def-use/Use-def edge in SandboxIR.
A SandboxIR Value has users. This is the base class.
@ C
The default llvm calling convention, compatible with C.
@ BasicBlock
Various leaf nodes.
decltype(auto) get(const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)