================
@@ -383,20 +383,24 @@ BasicBlock::const_iterator BasicBlock::getFirstNonPHIIt() 
const {
   return It;
 }
 
-const Instruction *BasicBlock::getFirstNonPHIOrDbg(bool SkipPseudoOp) const {
+BasicBlock::const_iterator
+BasicBlock::getFirstNonPHIOrDbg(bool SkipPseudoOp) const {
   for (const Instruction &I : *this) {
     if (isa<PHINode>(I) || isa<DbgInfoIntrinsic>(I))
       continue;
 
     if (SkipPseudoOp && isa<PseudoProbeInst>(I))
       continue;
 
-    return &I;
+    BasicBlock::const_iterator It = I.getIterator();
+    // Signal that this comes after any debug records.
+    It.setHeadBit(false);
----------------
OCHyams wrote:

When does `Instruction::getIterator` return an iterator with head bit set? Can 
this be an assert (that it's not set) instead? 

https://github.com/llvm/llvm-project/pull/124287
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to