forked from OSchip/llvm-project
BugReporter: Construct path-related PathDiagnosticPieces with kind "ControlFlow".
llvm-svn: 65876
This commit is contained in:
parent
592ca2c4ab
commit
c7b663120e
|
@ -641,7 +641,8 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
|
||||||
os << "Control jumps to line "
|
os << "Control jumps to line "
|
||||||
<< SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n";
|
<< SMgr.getInstantiationLineNumber(S->getLocStart()) << ".\n";
|
||||||
|
|
||||||
PD.push_front(new PathDiagnosticPiece(L, os.str()));
|
PD.push_front(new PathDiagnosticPiece(L, os.str(),
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -709,7 +710,8 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
|
||||||
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
||||||
}
|
}
|
||||||
|
|
||||||
PD.push_front(new PathDiagnosticPiece(L, os.str()));
|
PD.push_front(new PathDiagnosticPiece(L, os.str(),
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -718,7 +720,8 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
|
||||||
std::string sbuf;
|
std::string sbuf;
|
||||||
llvm::raw_string_ostream os(sbuf);
|
llvm::raw_string_ostream os(sbuf);
|
||||||
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
||||||
PD.push_front(new PathDiagnosticPiece(L, os.str()));
|
PD.push_front(new PathDiagnosticPiece(L, os.str(),
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -732,7 +735,8 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
|
||||||
else
|
else
|
||||||
os << "true.";
|
os << "true.";
|
||||||
|
|
||||||
PD.push_front(new PathDiagnosticPiece(L, os.str()));
|
PD.push_front(new PathDiagnosticPiece(L, os.str(),
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -745,11 +749,13 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
|
||||||
os << "Loop condition is true. ";
|
os << "Loop condition is true. ";
|
||||||
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
||||||
|
|
||||||
PD.push_front(new PathDiagnosticPiece(L, os.str()));
|
PD.push_front(new PathDiagnosticPiece(L, os.str(),
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
PD.push_front(new PathDiagnosticPiece(L,
|
PD.push_front(new PathDiagnosticPiece(L,
|
||||||
"Loop condition is false. Exiting loop."));
|
"Loop condition is false. Exiting loop.",
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -764,20 +770,24 @@ void GRBugReporter::GeneratePathDiagnostic(PathDiagnostic& PD,
|
||||||
os << "Loop condition is false. ";
|
os << "Loop condition is false. ";
|
||||||
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
ExecutionContinues(os, SMgr, N, getStateManager().getCodeDecl());
|
||||||
|
|
||||||
PD.push_front(new PathDiagnosticPiece(L, os.str()));
|
PD.push_front(new PathDiagnosticPiece(L, os.str(),
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
PD.push_front(new PathDiagnosticPiece(L,
|
PD.push_front(new PathDiagnosticPiece(L,
|
||||||
"Loop condition is true. Entering loop body."));
|
"Loop condition is true. Entering loop body.",
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case Stmt::IfStmtClass: {
|
case Stmt::IfStmtClass: {
|
||||||
if (*(Src->succ_begin()+1) == Dst)
|
if (*(Src->succ_begin()+1) == Dst)
|
||||||
PD.push_front(new PathDiagnosticPiece(L, "Taking false branch."));
|
PD.push_front(new PathDiagnosticPiece(L, "Taking false branch.",
|
||||||
else
|
PathDiagnosticPiece::ControlFlow));
|
||||||
PD.push_front(new PathDiagnosticPiece(L, "Taking true branch."));
|
else
|
||||||
|
PD.push_front(new PathDiagnosticPiece(L, "Taking true branch.",
|
||||||
|
PathDiagnosticPiece::ControlFlow));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue