llvm-project/clang/unittests
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
..
AST [ASTImporter] Fix import of VarDecl init 2018-09-17 12:04:52 +00:00
ASTMatchers [ASTMatchers] Let isArrow also support UnresolvedMemberExpr, CXXDependentScopeMemberExpr 2018-09-17 18:48:43 +00:00
Analysis [NFC] Declare instead of define non-void functions in unit tests. 2018-09-19 20:27:25 +00:00
Basic [Basic] Update clang tests (really testing sys::fs) that broke with r343460 2018-10-01 16:07:03 +00:00
CodeGen Unit tests for TBAA metadata generation. 2017-12-22 15:22:45 +00:00
CrossTU IWYU for llvm-config.h in clang. See r331124 for details. 2018-04-30 13:52:15 +00:00
Driver [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name 2018-08-06 21:48:20 +00:00
Format clang-format: better handle statement macros 2018-10-02 16:37:51 +00:00
Frontend [Fixed Point Arithmetic] Fix for FixedPointValueToString 2018-08-06 16:05:08 +00:00
Index [Index] Add an option to collect macros from preprocesor. 2018-09-18 08:51:08 +00:00
Lex Reland '[clang] Adding CharacteristicKind to PPCallbacks::InclusionDirective' 2018-05-10 19:05:36 +00:00
Rename Add header guards to some headers that are missing them 2018-09-03 16:26:36 +00:00
Rewrite [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Sema [SemaCodeComplete] Make sure visited contexts are passed to completion results handler. 2018-07-04 10:01:18 +00:00
StaticAnalyzer Fix unittest build with GCC older than 5. 2018-06-28 13:31:36 +00:00
Tooling [Sema] Remove location from implicit capture init expr 2018-09-13 23:28:25 +00:00
libclang Revert r336590 "[libclang] evalute compound statement cursors before trying to evaluate" 2018-07-10 19:49:07 +00:00
CMakeLists.txt [Index] Add an option to collect macros from preprocesor. 2018-09-18 08:51:08 +00:00