[PATCH] D129548: [clang][dataflow] Generate readable form of input and output of satisfiability checking for debugging purposes.

Dmitri Gribenko via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 06:21:41 PDT 2022


gribozavr2 added inline comments.


================
Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:143
+
+    return formatv("{0:$[\n]}", llvm::make_range(Lines.begin(), Lines.end()));
+  }
----------------
I appreciate the table, but it looks quite bulky... Could we switch to a simple `atom=value\natom2=value2\n` format?


================
Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:147-156
+  std::string debugString(Solver::Result::Assignment &Assignment) {
+    switch (Assignment) {
+    case Solver::Result::Assignment::AssignedFalse:
+      return "False";
+    case Solver::Result::Assignment::AssignedTrue:
+      return "True";
+    default:
----------------
We put the llvm_unreachable after the switch, so that clang can warn us if we add a new enumerator but forget to update the switch. Please apply everywhere in this patch stack.


================
Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:159
+  /// Returns a string representation of the result status of a SAT check.
+  std::string debugString(enum Solver::Result::Status Status) {
+    switch (Status) {
----------------



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D129548/new/

https://reviews.llvm.org/D129548



More information about the cfe-commits mailing list