]> granicus.if.org Git - clang/commit
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)
commitf57fa8e1d4cb815ab145f01770565f4e4441ca1b
treea10e5e3e405ad9ca14940a10e2a2afc8c60cd701
parent97b5655fa821aba307b6b6027d87d675f221cbc8
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@289428 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Format/Format.h
lib/Format/ContinuationIndenter.cpp
lib/Format/Format.cpp
lib/Format/FormatTokenLexer.cpp
lib/Format/TokenAnnotator.cpp
tools/clang-format/ClangFormat.cpp
unittests/Format/CMakeLists.txt
unittests/Format/FormatTest.cpp
unittests/Format/FormatTestObjC.cpp [new file with mode: 0644]
unittests/Tooling/ReplacementTest.h