aboutsummaryrefslogtreecommitdiff
path: root/tools/libclang/CXCompilationDatabase.cpp
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2013-02-01 11:00:45 +0000
committerDaniel Jasper <djasper@google.com>2013-02-01 11:00:45 +0000
commit68ef0df17ed6de26084c3a11a4cabbd69a5a2465 (patch)
tree154021ab7f87cfb0191353e999d44aa1338c30bb /tools/libclang/CXCompilationDatabase.cpp
parent5f838aa9c82c22b6ed2a0cb090969a706c8a1775 (diff)
Revamp of the basic layouting algorithm in clang-format.
In order to end up with good solutions, clang-format needs to try "all" combinations of line breaks, evaluate them and select the best one. Before, we have done this using a DFS with memoization and cut-off conditions. However, this approach is very limited as shown by the huge static initializer in the attachment of llvm.org/PR14959. Instead, this new implementation uses a variant of Dijkstra's algorithm to do a prioritized BFS over the solution space. Some numbers: lib/Format/TokenAnnotator.cpp: 1.5s -> 0.15s Attachment of PR14959: 10min+ (didn't finish) -> 10s No functional changes intended. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@174166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/libclang/CXCompilationDatabase.cpp')
0 files changed, 0 insertions, 0 deletions