Charusso created this revision.
Charusso added reviewers: NoQ, xazax.hun, ravikandhadai, baloghadamsoftware, 
Szelethus.
Charusso added a project: clang.
Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, 
a.sidorin, rnkovacs, szepet.

Now we print out every possible kinds of ProgramPoints.


Repository:
  rC Clang

https://reviews.llvm.org/D62946

Files:
  clang/lib/Analysis/ProgramPoint.cpp


Index: clang/lib/Analysis/ProgramPoint.cpp
===================================================================
--- clang/lib/Analysis/ProgramPoint.cpp
+++ clang/lib/Analysis/ProgramPoint.cpp
@@ -99,12 +99,6 @@
   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 @@
     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;
   }
   }


Index: clang/lib/Analysis/ProgramPoint.cpp
===================================================================
--- clang/lib/Analysis/ProgramPoint.cpp
+++ clang/lib/Analysis/ProgramPoint.cpp
@@ -99,12 +99,6 @@
   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 @@
     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;
   }
   }
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to