aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/BasicBlockSections.cpp
diff options
context:
space:
mode:
authorDaniel Hoekwater <hoekwater@google.com>2023-08-18 18:43:17 +0000
committerDaniel Hoekwater <hoekwater@google.com>2023-08-18 19:40:11 +0000
commitca72b0a70923ebb59a114ce497794d58f31457a3 (patch)
tree2d87a172b108614a5d3d7858459834e495394724 /llvm/lib/CodeGen/BasicBlockSections.cpp
parent67b71ad04a7487331972ec522291c310c6429150 (diff)
downloadllvm-ca72b0a70923ebb59a114ce497794d58f31457a3.zip
llvm-ca72b0a70923ebb59a114ce497794d58f31457a3.tar.gz
llvm-ca72b0a70923ebb59a114ce497794d58f31457a3.tar.bz2
[CodeGen] Use the TII hook for Noop insertion in BBSections (NFC)
Refactor BasicBlockSections to use the target-specific noop insertion hook from TargetInstrInfo instead of building it ourselves. Using the TII hook is both cleaner and makes it easier to extend BBSections to non-X86 targets. Differential Revision: https://reviews.llvm.org/D158303
Diffstat (limited to 'llvm/lib/CodeGen/BasicBlockSections.cpp')
-rw-r--r--llvm/lib/CodeGen/BasicBlockSections.cpp4
1 files changed, 1 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/BasicBlockSections.cpp b/llvm/lib/CodeGen/BasicBlockSections.cpp
index 6967ca5..76fe1d9 100644
--- a/llvm/lib/CodeGen/BasicBlockSections.cpp
+++ b/llvm/lib/CodeGen/BasicBlockSections.cpp
@@ -285,9 +285,7 @@ void llvm::avoidZeroOffsetLandingPad(MachineFunction &MF) {
MachineBasicBlock::iterator MI = MBB.begin();
while (!MI->isEHLabel())
++MI;
- MCInst Nop = MF.getSubtarget().getInstrInfo()->getNop();
- BuildMI(MBB, MI, DebugLoc(),
- MF.getSubtarget().getInstrInfo()->get(Nop.getOpcode()));
+ MF.getSubtarget().getInstrInfo()->insertNoop(MBB, MI);
}
}
}