diff options
author | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-06-12 18:24:02 +0000 |
---|---|---|
committer | Csaba Dabis <dabis.csaba98@gmail.com> | 2019-06-12 18:24:02 +0000 |
commit | fa880e6114c37a11bfe6cd1b600f2ba392c4fac8 (patch) | |
tree | 09e088f91c18b3b7d8ba48fc11f5f75c1f0e4298 | |
parent | 245b5ba3448b9d3f6de5962066557e253a6bc9a4 (diff) | |
download | bcm5719-llvm-fa880e6114c37a11bfe6cd1b600f2ba392c4fac8.tar.gz bcm5719-llvm-fa880e6114c37a11bfe6cd1b600f2ba392c4fac8.zip |
[analyzer] ProgramPoint: more explicit printJson()
Summary: Now we print out every possible kinds of ProgramPoints.
Reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, Szelethus
Reviewed By: NoQ
Subscribers: szepet, rnkovacs, a.sidorin, mikhail.ramalho, donat.nagy,
dkrupp, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D62946
llvm-svn: 363187
-rw-r--r-- | clang/lib/Analysis/ProgramPoint.cpp | 43 |
1 files changed, 26 insertions, 17 deletions
diff --git a/clang/lib/Analysis/ProgramPoint.cpp b/clang/lib/Analysis/ProgramPoint.cpp index 7e05706e487..45f165677f9 100644 --- a/clang/lib/Analysis/ProgramPoint.cpp +++ b/clang/lib/Analysis/ProgramPoint.cpp @@ -99,12 +99,6 @@ void ProgramPoint::printJson(llvm::raw_ostream &Out, const char *NL) const { case ProgramPoint::CallExitEndKind: Out << "CallExitEnd\""; break; - case ProgramPoint::PostStmtPurgeDeadSymbolsKind: - Out << "PostStmtPurgeDeadSymbols\""; - break; - case ProgramPoint::PreStmtPurgeDeadSymbolsKind: - Out << "PreStmtPurgeDeadSymbols\""; - break; case ProgramPoint::EpsilonKind: Out << "EpsilonPoint\""; break; @@ -210,20 +204,35 @@ void ProgramPoint::printJson(llvm::raw_ostream &Out, const char *NL) const { Out << ", "; printLocJson(Out, S->getBeginLoc(), SM); - Out << ", \"stmt_point_kind\": "; - if (getAs<PreStmt>()) - Out << "\"PreStmt\""; + Out << ", \"stmt_point_kind\": \""; + if (getAs<PreLoad>()) + Out << "PreLoad"; + else if (getAs<PreStore>()) + Out << "PreStore"; + else if (getAs<PostAllocatorCall>()) + Out << "PostAllocatorCall"; + else if (getAs<PostCondition>()) + Out << "PostCondition"; else if (getAs<PostLoad>()) - Out << "\"PostLoad\""; - else if (getAs<PostStore>()) - Out << "\"PostStore\""; + Out << "PostLoad"; else if (getAs<PostLValue>()) - Out << "\"PostLValue\""; - else if (getAs<PostAllocatorCall>()) - Out << "\"PostAllocatorCall\""; - else - Out << "null"; + Out << "PostLValue"; + else if (getAs<PostStore>()) + Out << "PostStore"; + else if (getAs<PostStmt>()) + Out << "PostStmt"; + else if (getAs<PostStmtPurgeDeadSymbols>()) + Out << "PostStmtPurgeDeadSymbols"; + else if (getAs<PreStmtPurgeDeadSymbols>()) + Out << "PreStmtPurgeDeadSymbols"; + else if (getAs<PreStmt>()) + Out << "PreStmt"; + else { + Out << "\nKind: '" << getKind(); + llvm_unreachable("' is unhandled StmtPoint kind!"); + } + Out << '\"'; break; } } |