]> granicus.if.org Git - clang/commit
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)
commit32a2fd7631026f2fe248381546c5e6149f4f95ee
tree5fd3bdb030d9168fd9359c5ae9c293665bc77ef7
parent59660c21178b6af518bd4b564e032d5c9cc218cb
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175051 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp