Optionally derive formatting information from the input file.
authorDaniel Jasper <djasper@google.com>
Wed, 6 Feb 2013 14:22:40 +0000 (14:22 +0000)
committerDaniel Jasper <djasper@google.com>
Wed, 6 Feb 2013 14:22:40 +0000 (14:22 +0000)
commit7fce3ab0f2aafde4f89ab286a55b0ce7aa70050c
treefae01218852983c81f22bee3d5caa6621324d13e
parentd1a665926399fc043bf48a69b9c36ba16bd133b1
Optionally derive formatting information from the input file.

With this patch, clang-format can analyze the input file for two
properties:
1. Is "int *a" or "int* a" more common.
2. Are non-C++03 constructs used, e.g. A<A<A>>.

With Google-style, clang-format will now use the more common style for
(1) and format C++03 compatible, unless it finds C++11 constructs in the
input.

llvm-svn: 174504
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/lib/Format/TokenAnnotator.h
clang/unittests/Format/FormatTest.cpp