From 6ca387cbcb207abe2a07bbb1b536f099c2e246e7 Mon Sep 17 00:00:00 2001 From: paperchalice Date: Thu, 27 Jun 2024 12:25:18 +0800 Subject: [CodeGen] Introduce `MachineDomTreeUpdater` (#95369) This commit converts most of `DomTreeUpdater` into `GenericDomTreeUpdater` class template, so IR and MIR can reuse some codes. There are some differences between interfaces of `BasicBlock` and `MachineBasicBlock`, so subclasses still need to implement some functions, like `forceFlushDeletedBB`. --- llvm/lib/CodeGen/MachineBasicBlock.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp') diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp index abf43e39ee9a..533ab7cccaeb 100644 --- a/llvm/lib/CodeGen/MachineBasicBlock.cpp +++ b/llvm/lib/CodeGen/MachineBasicBlock.cpp @@ -315,6 +315,12 @@ bool MachineBasicBlock::isLegalToHoistInto() const { return true; } +bool MachineBasicBlock::hasName() const { + if (const BasicBlock *LBB = getBasicBlock()) + return LBB->hasName(); + return false; +} + StringRef MachineBasicBlock::getName() const { if (const BasicBlock *LBB = getBasicBlock()) return LBB->getName(); -- cgit v1.2.3