clang-format: Make include sorting's main include detection configurable.
authorDaniel Jasper <djasper@google.com>
Mon, 21 Mar 2016 14:11:27 +0000 (14:11 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 21 Mar 2016 14:11:27 +0000 (14:11 +0000)
commit9c8ff3551ace965a3232fc4a1b53a75015a706cf
treeb79665461141afc99d5bf130a71991d5ac645aaa
parent4aeab5fbf241a06fbd8fef719b94466da7f2f6d4
clang-format: Make include sorting's main include detection configurable.

This patch adds a regular expression to configure suffixes of an
included file to check whether it is the "main" include of the current
file. Previously, clang-format has allowed arbitrary suffixes on the
formatted file, which is still the case when no IncludeMainRegex is
specified.

llvm-svn: 263943
clang/docs/ClangFormatStyleOptions.rst
clang/include/clang/Format/Format.h
clang/lib/Format/Format.cpp
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/SortIncludesTest.cpp