llvm-project/clang/lib/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
..
AffectedRangeManager.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
AffectedRangeManager.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
BreakableToken.cpp clang-format: [JS] don't break comments before any '{' 2018-08-03 13:58:33 +00:00
BreakableToken.h [clang-format] Silence -Wdocumentation warnings 2018-07-30 12:22:41 +00:00
CMakeLists.txt Reland "Move #include manipulation code to new lib/Tooling/Inclusions." 2018-06-04 09:04:12 +00:00
ContinuationIndenter.cpp [clang-Format] Fix indentation of member call after block 2018-09-17 07:46:20 +00:00
ContinuationIndenter.h Remove trailing space 2018-07-30 19:24:48 +00:00
Encoding.h NFC: Add the emacs c++ mode hint "-*- C++ -*-" to the headers that don't have it 2018-07-24 00:07:49 +00:00
Format.cpp clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
FormatInternal.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
FormatToken.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
FormatToken.h clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
FormatTokenLexer.cpp clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
FormatTokenLexer.h clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
NamespaceEndCommentsFixer.cpp clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier 2018-09-05 07:44:02 +00:00
NamespaceEndCommentsFixer.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
SortJavaScriptImports.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
SortJavaScriptImports.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
TokenAnalyzer.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
TokenAnalyzer.h Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet 2018-05-09 21:35:52 +00:00
TokenAnnotator.cpp clang-format: [JS] conditional types. 2018-09-27 06:48:13 +00:00
TokenAnnotator.h clang-format: Fix formatting C++ namespaces with preceding 'inline' or 'export' specifier 2018-09-05 07:44:02 +00:00
UnwrappedLineFormatter.cpp [clang-format] Do not merge short case labels if followed by a block. 2018-09-21 03:46:36 +00:00
UnwrappedLineFormatter.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
UnwrappedLineParser.cpp clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
UnwrappedLineParser.h clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
UsingDeclarationsSorter.cpp [clang] Update uses of DEBUG macro to LLVM_DEBUG. 2018-05-15 13:30:56 +00:00
UsingDeclarationsSorter.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
WhitespaceManager.cpp llvm::sort(C.begin(), C.end(), ...) -> llvm::sort(C, ...) 2018-09-26 22:16:28 +00:00
WhitespaceManager.h Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00