- // A dbgstoppoint's information is valid until we encounter a new one.
- const DbgStopPointInst *LastDSP = DSI;
- bool printed = DSI != 0;
- for (BasicBlock::const_iterator i = BB->begin(), e = BB->end(); i != e; ++i) {
- if (isa<DbgInfoIntrinsic>(i)) {
- if ((DSI = dyn_cast<DbgStopPointInst>(i))) {
-
- if (DSI->getContext() == LastDSP->getContext() &&
- DSI->getLineValue() == LastDSP->getLineValue() &&
- DSI->getColumnValue() == LastDSP->getColumnValue()) {
- // Don't print same location twice.
- continue;
- }
- LastDSP = cast<DbgStopPointInst>(i);
- // Don't print consecutive stoppoints, use a flag
- // to know which one we printed.
- printed = false;
-
- } else if (const DbgFuncStartInst *FS = dyn_cast<DbgFuncStartInst>(i)) {
- printFuncStart(FS);
- }
- } else {
- if (!printed && LastDSP) {
- Out << "; ";
- printStopPoint(LastDSP);
- Out << "\n";
- printed = true;
- }
- Out << *i;