diff options
author | Ben Hamilton <benhamilton@google.com> | 2018-05-18 15:27:02 +0000 |
---|---|---|
committer | Ben Hamilton <benhamilton@google.com> | 2018-05-18 15:27:02 +0000 |
commit | 962b911af16ed8226b391f9556c27db691e90dc5 (patch) | |
tree | d48c68d27079c1ebdd508d4cc3f7d1809c83c555 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 56e09c69285df818b42138d44ecd9df9f6b2f46d (diff) | |
download | bcm5719-llvm-962b911af16ed8226b391f9556c27db691e90dc5.tar.gz bcm5719-llvm-962b911af16ed8226b391f9556c27db691e90dc5.zip |
[clang-format/ObjC] Correctly annotate single-component ObjC method invocations
Summary:
Previously, clang-format's parser would fail to annotate the
selector in a single-component Objective-C method invocation with
`TT_SelectorName`. For example, the following:
[foo bar];
would parse `bar` as `TT_Unknown`:
M=0 C=1 T=Unknown S=0 B=0 BK=0 P=140 Name=identifier L=34 PPK=2
FakeLParens= FakeRParens=0 II=0x559d5db51770 Text='bar'
This caused us to fail to insert a space after a closing cast rparen,
so the following:
[((Foo *)foo) bar];
would format as:
[((Foo *)foo)bar];
This diff fixes the issue by ensuring we annotate the selector
in a single-component Objective-C method invocation as
`TT_SelectorName`.
Test Plan: New tests added. Ran tests with:
% make -j16 FormatTests && ./tools/clang/unittests/Format/FormatTests
Reviewers: djasper, jolesiak
Reviewed By: jolesiak
Subscribers: Wizard, klimek, hokein, cfe-commits
Differential Revision: https://reviews.llvm.org/D47028
llvm-svn: 332727
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions