aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineBasicBlock.cpp
diff options
context:
space:
mode:
authorpaperchalice <liujunchang97@outlook.com>2024-06-27 12:25:18 +0800
committerGitHub <noreply@github.com>2024-06-27 12:25:18 +0800
commit6ca387cbcb207abe2a07bbb1b536f099c2e246e7 (patch)
treeacbc250554cd55f07dd2ece2b217ad98e5738a47 /llvm/lib/CodeGen/MachineBasicBlock.cpp
parentc791d86eab13634ec372196977eeac8f3e9f4805 (diff)
downloadllvm-6ca387cbcb207abe2a07bbb1b536f099c2e246e7.zip
llvm-6ca387cbcb207abe2a07bbb1b536f099c2e246e7.tar.gz
llvm-6ca387cbcb207abe2a07bbb1b536f099c2e246e7.tar.bz2
[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`.
Diffstat (limited to 'llvm/lib/CodeGen/MachineBasicBlock.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index abf43e3..533ab7c 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();