aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp
diff options
context:
space:
mode:
authorBen Hamilton <benhamilton@google.com>2018-03-22 17:37:19 +0000
committerBen Hamilton <benhamilton@google.com>2018-03-22 17:37:19 +0000
commit6432afe50c4b3afc4beb99b9392e8a1967bd6838 (patch)
tree4c11fdf159752d89b2a863964e539f20fc7de009 /llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp
parent36cdfad06236e1f3f348ab68b7ba8083337c81b3 (diff)
downloadllvm-6432afe50c4b3afc4beb99b9392e8a1967bd6838.zip
llvm-6432afe50c4b3afc4beb99b9392e8a1967bd6838.tar.gz
llvm-6432afe50c4b3afc4beb99b9392e8a1967bd6838.tar.bz2
[clang-format] Fix ObjC style guesser to also iterate over child lines
Summary: When I wrote `ObjCHeaderStyleGuesser`, I incorrectly assumed the correct way to iterate over all tokens in `AnnotatedLine` was to iterate over the linked list tokens starting with `AnnotatedLine::First`. However, `AnnotatedLine` also contains a vector `AnnotedLine::Children` with child `AnnotedLine`s which have their own tokens which we need to iterate over. Because I didn't iterate over the tokens in the children lines, the ObjC style guesser would fail on syntax like: #define FOO ({ NSString *s = ... }) as the statement(s) inside { ... } are child lines. This fixes the bug and adds a test. I confirmed the test failed before the fix, and passed after the fix. Test Plan: New tests added. Ran tests with: % make -j12 FormatTests && ./tools/clang/unittests/Format/FormatTests Reviewers: djasper, jolesiak, Wizard Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D44790 llvm-svn: 328220
Diffstat (limited to 'llvm/lib/DebugInfo/CodeView/DebugStringTableSubsection.cpp')
0 files changed, 0 insertions, 0 deletions