An attempt to make the search algorithm easier to understand.
authorManuel Klimek <klimek@google.com>
Wed, 13 Feb 2013 10:46:36 +0000 (10:46 +0000)
committerManuel Klimek <klimek@google.com>
Wed, 13 Feb 2013 10:46:36 +0000 (10:46 +0000)
commit2ef908e4e28ae865e4049c6a325b9e19f29b7227
treeb881e9deab70071ea95e3b304bb97e603b76db4a
parent5992fb56018cefe9ef3ae4dc2c3af0020d2d9b23
An attempt to make the search algorithm easier to understand.

- clear ownership: the SpecificBumpPtrAllocator owns all StateNodes
- this allows us to simplify the memoization data structure into a
  std::set (FIXME: figure out whether we want to use a hash based
  data structure).
- introduces StateNode as recursive data structure, instead of using
  Edge and the Seen-map combined to drill through the graph
- using a count to stabilize the penalty instead of relying on the
  container
- pulled out a method to forward-apply states in the end

This leads to a ~40% runtime decrease on Nico's benchmark.

Main FiXME is that the parameter lists of some function get too long.
I'd vote for either pulling the Queue etc into the Formatter proper,
or creating an inner class just for the search algorithm.

llvm-svn: 175051
clang/lib/Format/Format.cpp