]> granicus.if.org Git - clang/commit
Various fixes to clang-format's macro handling.
authorManuel Klimek <klimek@google.com>
Fri, 4 Jan 2013 23:34:14 +0000 (23:34 +0000)
committerManuel Klimek <klimek@google.com>
Fri, 4 Jan 2013 23:34:14 +0000 (23:34 +0000)
commitd4397b99e2fcb189002d04410d7c3bf85ab4bba3
tree3ffd5f59e669477f4d6fadf7b49e6bdaedc20ff4
parent7a77f1994bdbe67db361b851a0907cf49fddfd91
Various fixes to clang-format's macro handling.

Some of this is still pretty rough (note the load of FIXMEs), but it is
strictly an improvement and fixes various bugs that were related to
macro processing but are also imporant in non-macro use cases.

Specific fixes:
- correctly puts espaced newlines at the end of the line
- fixes counting of white space before a token when escaped newlines are
  present
- fixes parsing of "trailing" tokens when eof() is hit
- puts macro parsing orthogonal to parsing other structure
- general support for parsing of macro definitions

Due to the fix to format trailing tokens, this change also includes a
bunch of fixes to the c-index tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171556 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Format/Format.cpp
lib/Format/UnwrappedLineParser.cpp
lib/Format/UnwrappedLineParser.h
test/Index/comment-c-decls.c
test/Index/comment-objc-decls.m
test/Index/comment-to-html-xml-conversion.cpp
test/Index/format-comment-cdecls.c
test/Index/overriding-ftemplate-comments.cpp
unittests/Format/FormatTest.cpp