llvm-project/clang/lib/Format
Manuel Klimek 2ef908e4e2 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
2013-02-13 10:46:36 +00:00
..
CMakeLists.txt Move the token annotator into separate files. 2013-01-29 21:01:14 +00:00
Format.cpp An attempt to make the search algorithm easier to understand. 2013-02-13 10:46:36 +00:00
Makefile
TokenAnnotator.cpp Formatter: Refactor the cast detection code to be a bit more readable. 2013-02-13 04:13:13 +00:00
TokenAnnotator.h Formatter: Detect ObjC message expressions after 'in' in loop 2013-02-11 15:32:15 +00:00
UnwrappedLineParser.cpp Fix crash for incomplete labels in macros. 2013-02-12 20:17:17 +00:00
UnwrappedLineParser.h Move the token annotator into separate files. 2013-01-29 21:01:14 +00:00