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

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 12 09:21:31 PDT 2022


xazax.hun accepted this revision.
xazax.hun added a comment.
This revision is now accepted and ready to land.

Some nits inline, but looks good to me.



================
Comment at: clang/lib/Analysis/FlowSensitive/DebugSupport.cpp:119-133
+    std::vector<std::pair<std::string, std::string>> LinesData;
+    for (auto &AtomAssignment : AtomAssignments) {
+      auto Name = getAtomName(AtomAssignment.first);
+      MaxNameLength = std::max(MaxNameLength, Name.size());
+      LinesData.push_back({Name, debugString(AtomAssignment.second)});
+    }
+    llvm::sort(LinesData.begin(), LinesData.end());
----------------
In its current form, I think you could create the final strings in one step and sort those strings instead of the pairs. Or do we expect alignment to mess up the order in that case?


================
Comment at: clang/unittests/Analysis/FlowSensitive/DebugSupportTest.cpp:417
+------------
+Satisfiable.
+
----------------
I don't see a test case for `Unsatisfiable` constraints.


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