[llvm] [IR] Remove deprecated BasicBlock::getFirstNonPHI (PR #213926)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 4 05:48:37 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-ir
Author: Marc Auberer (marcauberer)
<details>
<summary>Changes</summary>
All in-tree callers already migrated to getFirstNonPHIIt(), which preserves debug-info placement. No remaining users of the deprecated overloads exist in the codebase.
---
Full diff: https://github.com/llvm/llvm-project/pull/213926.diff
2 Files Affected:
- (modified) llvm/include/llvm/IR/BasicBlock.h (-15)
- (modified) llvm/lib/IR/BasicBlock.cpp (-14)
``````````diff
diff --git a/llvm/include/llvm/IR/BasicBlock.h b/llvm/include/llvm/IR/BasicBlock.h
index 1c5fea7183ad1..00436b2981f13 100644
--- a/llvm/include/llvm/IR/BasicBlock.h
+++ b/llvm/include/llvm/IR/BasicBlock.h
@@ -280,21 +280,6 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
static_cast<const BasicBlock *>(this)->getTerminatingMustTailCall());
}
- /// Returns a pointer to the first instruction in this block that is not a
- /// PHINode instruction.
- ///
- /// When adding instructions to the beginning of the basic block, they should
- /// be added before the returned value, not before the first instruction,
- /// which might be PHI. Returns 0 is there's no non-PHI instruction.
- ///
- /// Deprecated in favour of getFirstNonPHIIt, which returns an iterator that
- /// preserves some debugging information.
- LLVM_ABI LLVM_DEPRECATED("Use iterators as instruction positions",
- "getFirstNonPHIIt") const
- Instruction *getFirstNonPHI() const;
- LLVM_ABI LLVM_DEPRECATED("Use iterators as instruction positions instead",
- "getFirstNonPHIIt") Instruction *getFirstNonPHI();
-
/// Returns an iterator to the first instruction in this block that is not a
/// PHINode instruction.
///
diff --git a/llvm/lib/IR/BasicBlock.cpp b/llvm/lib/IR/BasicBlock.cpp
index 03e38b3b89061..8be8e5401f912 100644
--- a/llvm/lib/IR/BasicBlock.cpp
+++ b/llvm/lib/IR/BasicBlock.cpp
@@ -284,20 +284,6 @@ const Instruction *BasicBlock::getFirstMayFaultInst() const {
return nullptr;
}
-const Instruction* BasicBlock::getFirstNonPHI() const {
- for (const Instruction &I : *this)
- if (!isa<PHINode>(I))
- return &I;
- return nullptr;
-}
-
-Instruction *BasicBlock::getFirstNonPHI() {
- for (Instruction &I : *this)
- if (!isa<PHINode>(I))
- return &I;
- return nullptr;
-}
-
BasicBlock::const_iterator BasicBlock::getFirstNonPHIIt() const {
for (const Instruction &I : *this) {
if (isa<PHINode>(I))
``````````
</details>
https://github.com/llvm/llvm-project/pull/213926
More information about the llvm-commits
mailing list