#include "llvm/SandboxIR/Tracker.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/IR/BasicBlock.h"
#include "llvm/IR/Instruction.h"
#include "llvm/SandboxIR/Instruction.h"
#include <sstream>
usingnamespacellvm::sandboxir;
#ifndef NDEBUG
void UseSet::dump() const {
dump(dbgs());
dbgs() << "\n";
}
void UseSwap::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
PHIRemoveIncoming::PHIRemoveIncoming(PHINode *PHI, unsigned RemovedIdx)
: … { … }
void PHIRemoveIncoming::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void PHIRemoveIncoming::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
PHIAddIncoming::PHIAddIncoming(PHINode *PHI)
: … { … }
void PHIAddIncoming::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void PHIAddIncoming::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
Tracker::~Tracker() { … }
EraseFromParent::EraseFromParent(std::unique_ptr<sandboxir::Value> &&ErasedIPtr)
: … { … }
void EraseFromParent::accept() { … }
void EraseFromParent::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void EraseFromParent::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
RemoveFromParent::RemoveFromParent(Instruction *RemovedI) : … { … }
void RemoveFromParent::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void RemoveFromParent::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
CatchSwitchAddHandler::CatchSwitchAddHandler(CatchSwitchInst *CSI)
: … { … }
void CatchSwitchAddHandler::revert(Tracker &Tracker) { … }
void SwitchRemoveCase::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void SwitchRemoveCase::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
void SwitchAddCase::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void SwitchAddCase::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
MoveInstr::MoveInstr(Instruction *MovedI) : … { … }
void MoveInstr::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void MoveInstr::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
void InsertIntoBB::revert(Tracker &Tracker) { … }
InsertIntoBB::InsertIntoBB(Instruction *InsertedI) : … { … }
#ifndef NDEBUG
void InsertIntoBB::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
void CreateAndInsertInst::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void CreateAndInsertInst::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
ShuffleVectorSetMask::ShuffleVectorSetMask(ShuffleVectorInst *SVI)
: … { … }
void ShuffleVectorSetMask::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void ShuffleVectorSetMask::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
CmpSwapOperands::CmpSwapOperands(CmpInst *Cmp) : … { … }
void CmpSwapOperands::revert(Tracker &Tracker) { … }
#ifndef NDEBUG
void CmpSwapOperands::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif
void Tracker::save() { … }
void Tracker::revert() { … }
void Tracker::accept() { … }
#ifndef NDEBUG
void Tracker::dump(raw_ostream &OS) const {
for (auto [Idx, ChangePtr] : enumerate(Changes)) {
OS << Idx << ". ";
ChangePtr->dump(OS);
OS << "\n";
}
}
void Tracker::dump() const {
dump(dbgs());
dbgs() << "\n";
}
#endif