34 applyUpdatesImpl<
true>();
37 applyUpdatesImpl<
false>();
39bool DomTreeUpdater::forceFlushDeletedBB() {
48 assert(BB->size() == 1 && isa<UnreachableInst>(BB->getTerminator()) &&
49 "DelBB has been modified while awaiting deletion.");
51 BB->eraseFromParent();
64 validateDeleteBB(DelBB);
65 if (
Strategy == UpdateStrategy::Lazy) {
76 validateDeleteBB(DelBB);
77 if (
Strategy == UpdateStrategy::Lazy) {
78 Callbacks.push_back(CallBackOnDeletion(DelBB, Callback));
89void DomTreeUpdater::validateDeleteBB(
BasicBlock *DelBB) {
90 assert(DelBB &&
"Invalid push_back of nullptr DelBB.");
93 while (!DelBB->
empty()) {
102 new UnreachableInst(DelBB->
getContext(), DelBB);
108#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
110 OS <<
"Pending Callbacks:\n";
112 for (
const auto &BB : Callbacks) {
116 OS << BB->getName() <<
"(";
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
#define LLVM_DUMP_METHOD
Mark debug helper function definitions like dump() that should not be stripped from debug builds.
#define LLVM_EXPORT_TEMPLATE
This file contains the declarations for the subclasses of Constant, which represent the different fla...
This file defines a set of templates that efficiently compute a dominator tree over a generic graph.
LLVM Basic Block Representation.
LLVM_ABI void removeFromParent()
Unlink 'this' from the containing function, but do not delete it.
LLVM_ABI SymbolTableList< BasicBlock >::iterator eraseFromParent()
Unlink 'this' from the containing function and delete it.
LLVM_ABI LLVMContext & getContext() const
Get the context in which this basic block lives.
const Instruction & back() const
LLVM_ABI LLVM_DUMP_METHOD void dump() const
Debug method to help view the internal state of this class.
LLVM_ABI void callbackDeleteBB(BasicBlock *DelBB, std::function< void(BasicBlock *)> Callback)
Delete DelBB.
LLVM_ABI void deleteBB(BasicBlock *DelBB)
Delete DelBB.
Concrete subclass of DominatorTreeBase that is used to compute a normal dominator tree.
SmallPtrSet< BasicBlockT *, 8 > DeletedBBs
void eraseDelBBNode(BasicBlockT *DelBB)
Erase Basic Block node before it is unlinked from Function in the DomTree and PostDomTree.
const UpdateStrategy Strategy
LLVM_DUMP_METHOD void dump() const
Debug method to help view the internal state of this class.
LLVM_ABI InstListType::iterator eraseFromParent()
This method unlinks 'this' from the containing basic block and deletes it.
static LLVM_ABI PoisonValue * get(Type *T)
Static factory methods - Return an 'poison' object of the specified type.
PostDominatorTree Class - Concrete subclass of DominatorTree that is used to compute the post-dominat...
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
LLVM_ABI raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
bool pred_empty(const BasicBlock *BB)