clang-format: Separate out a language kind for ObjC.
authorDaniel Jasper <djasper@google.com>
Mon, 12 Dec 2016 12:42:29 +0000 (12:42 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 12 Dec 2016 12:42:29 +0000 (12:42 +0000)
commit03a04fe95ffbf54ce54957e378c36a520f0b19d3
treec31f3b7d87665e954448af4a4c26d53748977200
parentd2396b642514cdfa94de6bafd07f30645910ee73
clang-format: Separate out a language kind for ObjC.

While C(++) and ObjC are generally formatted the same way and can be
mixed, people might want to choose different styles based on the
language. This patch recognizes .m and .mm files as ObjC and also
implements a very crude detection of whether or not a .h file contains
ObjC code. This can be improved over time.

Also move most of the ObjC tests into their own test file to keep file
size maintainable.

llvm-svn: 289428
clang/include/clang/Format/Format.h
clang/lib/Format/ContinuationIndenter.cpp
clang/lib/Format/Format.cpp
clang/lib/Format/FormatTokenLexer.cpp
clang/lib/Format/TokenAnnotator.cpp
clang/tools/clang-format/ClangFormat.cpp
clang/unittests/Format/CMakeLists.txt
clang/unittests/Format/FormatTest.cpp
clang/unittests/Format/FormatTestObjC.cpp [new file with mode: 0644]
clang/unittests/Tooling/ReplacementTest.h