/// Find the next valid DebugLoc starting at MBBI, skipping any DBG_VALUE /// instructions. Return UnknownLoc if there is none. DebugLoc MachineBasicBlock::findDebugLoc(instr_iterator MBBI) { // Skip debug declarations, we don't want a DebugLoc from them. MBBI = skipDebugInstructionsForward(MBBI, instr_end()); if (MBBI != instr_end()) return MBBI->getDebugLoc(); return {}; }
/// findDebugLoc - find the next valid DebugLoc starting at MBBI, skipping /// any DBG_VALUE instructions. Return UnknownLoc if there is none. DebugLoc MachineBasicBlock::findDebugLoc(instr_iterator MBBI) { DebugLoc DL; instr_iterator E = instr_end(); if (MBBI == E) return DL; // Skip debug declarations, we don't want a DebugLoc from them. while (MBBI != E && MBBI->isDebugValue()) MBBI++; if (MBBI != E) DL = MBBI->getDebugLoc(); return DL; }