[llvm] [NFC][DebugInfo] Deprecate iterator-taking moveBefore and getFirstNonPHI (PR #124290)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 27 07:28:30 PST 2025
================
@@ -280,14 +280,26 @@ class BasicBlock final : public Value, // Basic blocks are data objects also
/// 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_DEPRECATED("Use iterators as instruction positions", "getFirstNonPHIIt")
const Instruction* getFirstNonPHI() const;
+ LLVM_DEPRECATED("Use iterators as instruction positions", "getFirstNonPHIIt")
----------------
OCHyams wrote:
Thoughts on adding "instead" (or "instead of pointers")- IMO improves clarity as an instruction? YMMV.
```suggestion
LLVM_DEPRECATED("Use iterators as instruction positions instead", "getFirstNonPHIIt")
```
https://github.com/llvm/llvm-project/pull/124290
More information about the llvm-commits
mailing list