[PATCH] D142618: [ConstraintElimination] Change debug output to display variable names.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 10 07:44:46 PST 2023


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

LGTM, with a few small nits addressed.



================
Comment at: llvm/include/llvm/Analysis/ConstraintSystem.h:37
+  /// get list of variable names from Value2Index map
+  SmallVector<std::string> getVarNamesList() const;
 
----------------
fhahn wrote:
> fhahn wrote:
> > capitalize first letter of sentence and period at end of sentence. Newline before comment
> still needs a newline before the comment.
nit: from *the* Value2Index map.


================
Comment at: llvm/lib/Analysis/ConstraintSystem.cpp:121
+}
+void ConstraintSystem::dump() const {
   if (Constraints.empty())
----------------
nit: add newline here.


================
Comment at: llvm/lib/Analysis/ConstraintSystem.cpp:124
     return;
-
+  auto Names = getVarNamesList();
   for (const auto &Row : Constraints) {
----------------
nit: the coding style recommends using auto sparingly and spell out full types unless they are too big. So here it would probably be better to use SmallVector<std::string>


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142618



More information about the llvm-commits mailing list