[llvm] [NFC][DebugInfo] Deprecate iterator-taking moveBefore and getFirstNonPHI (PR #124290)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 06:55:55 PST 2025


================
@@ -280,14 +280,27 @@ 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.
-  const Instruction* getFirstNonPHI() const;
-  Instruction* getFirstNonPHI() {
+  ///
+  /// 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 instead",
----------------
jmorse wrote:

Indeed -- I've been mopping them up for a while and didn't expect anything in-tree to hit this. Will root around for buildbot failures...

https://github.com/llvm/llvm-project/pull/124290


More information about the llvm-commits mailing list