[PATCH] An attempt to make the search algorithm easier to understand.

Daniel Jasper djasper at google.com
Wed Feb 13 01:47:57 PST 2013



================
Comment at: lib/Format/Format.cpp:718
@@ +717,3 @@
+
+  void apply(LineState &State, StateEdge *Current) {
+    if (Current->Previous == NULL)
----------------
Manuel Klimek wrote:
> Daniel Jasper wrote:
> > apply seems a very generic name. How about useEdge?
> useEdge seems misleading, as it's not only applying a single edge, it's replaying the whole sequence. Perhaps reconstructPath, or applyPath, or generateEditsForPath?
reconstructPath appeals to me :-). Also, do we really want this recursive despite wasting stack resources?

================
Comment at: lib/Format/Format.cpp:644
@@ +643,3 @@
+    }
+    LineState State;
+    bool NewLine;
----------------
Manuel Klimek wrote:
> Daniel Jasper wrote:
> > Might be nice to reflect in the name that this is the node that this edge leads to. Maybe "NextState"?
> Interesting view. I actually see this as a node with an *incoming* edge :) (that's why the link is called Previous)
That few makes sense except then this would be a StateNode and not a StateEdge, right?


http://llvm-reviews.chandlerc.com/D398

BRANCH
  format-penalty

ARCANIST PROJECT
  clang



More information about the cfe-commits mailing list