llvm-project/clang/unittests/Format
Francois Ferrand 6f40e21a16 clang-format: better handle statement macros
Summary:
Some macros are used in the body of function, and actually contain the trailing semicolon: they should thus be automatically followed by a new line, and not get merged with the next line. This is for example the case with Qt's Q_UNUSED macro:

  void foo(int a, int b) {
    Q_UNUSED(a)
    return b;
  }

This patch deals with these cases by introducing a new option to specify list of statement macros. This re-uses the system already in place for foreach macros, to ensure there is no impact on performance.

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: acoomans, mgrang, alexfh, klimek, cfe-commits

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

llvm-svn: 343602
2018-10-02 16:37:51 +00:00
..
CMakeLists.txt [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
CleanupTest.cpp [Tooling] Pull #include manipulation code from clangFormat into libToolingCore. 2018-05-14 20:17:53 +00:00
FormatTest.cpp clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
FormatTestComments.cpp clang-format: fix a crash in comment wraps. 2018-08-02 11:52:08 +00:00
FormatTestJS.cpp clang-format: [JS] conditional types. 2018-09-27 06:48:13 +00:00
FormatTestJava.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
FormatTestObjC.cpp [clang-format/ObjC] Put ObjC method arguments into one line when they fit 2018-07-09 07:08:45 +00:00
FormatTestProto.cpp clang-format: Change Google style wrt. the formatting of empty messages. 2018-08-15 19:07:55 +00:00
FormatTestRawStrings.cpp [clang-format] Do not format raw string literals inside a recognized function with a non-recognized delimiter 2018-06-28 16:58:24 +00:00
FormatTestSelective.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
FormatTestTextProto.cpp [clang-format] Fix comment, NFC 2018-08-13 14:32:29 +00:00
FormatTestUtils.h clang-format: Add preprocessor directive indentation 2017-08-30 14:34:57 +00:00
NamespaceEndCommentsFixerTest.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
SortImportsTestJS.cpp clang-format: [JS] support default imports. 2017-08-01 15:54:43 +00:00
SortIncludesTest.cpp [clang-format] Move #include related style to libToolingCore 2018-05-14 19:51:33 +00:00
UsingDeclarationsSorterTest.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00