[Format] Improve ObjC header guessing heuristic
authorBen Hamilton <benhamilton@google.com>
Wed, 17 Jan 2018 17:33:08 +0000 (17:33 +0000)
committerBen Hamilton <benhamilton@google.com>
Wed, 17 Jan 2018 17:33:08 +0000 (17:33 +0000)
commite2e3e67cf1a7c2fda14f76200d665662b1fdfaa5
tree4cd7fc84d17d55b50d3d2522296f97bf5d75a994
parent68bc4bd6e519ee8d82ee7a3882821b4a165662e1
[Format] Improve ObjC header guessing heuristic

Summary:
This improves upon the previous Objective-C header guessing heuristic
from rC320479.

Now, we run the lexer on C++ header files and look for Objective-C
keywords and syntax. We also look for Foundation types.

Test Plan: make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests

Reviewers: jolesiak, krasimir

Reviewed By: jolesiak

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D42135

llvm-svn: 322690
clang/lib/Format/Format.cpp
clang/unittests/Format/FormatTestObjC.cpp