llvm-project/clang/unittests
Mark Zeren d2b2ac6886 [clang-format] Align preprocessor comments with #
Summary:
r312125, which introduced preprocessor indentation, shipped with a known
issue where "indentation of comments immediately before indented
preprocessor lines is toggled on each run". For example these two forms
toggle:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  // comment
  #   define A 0
  #endif
  #endif

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
     // comment
  #   define A 0
  #endif
  #endif

This happens because we check vertical alignment against the '#' yet
indent to the level of the 'define'. This patch resolves this issue by
aligning against the '#'.

Reviewers: krasimir, klimek, djasper

Reviewed By: krasimir

Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D42408

llvm-svn: 323904
2018-01-31 20:05:50 +00:00
..
AST Attempt to make the PS4 build bot happy. 2018-01-27 16:38:56 +00:00
ASTMatchers Add hasTrailingReturn AST matcher 2018-01-22 22:45:23 +00:00
Analysis [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Basic [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
CodeGen Unit tests for TBAA metadata generation. 2017-12-22 15:22:45 +00:00
CrossTU [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Driver [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Format [clang-format] Align preprocessor comments with # 2018-01-31 20:05:50 +00:00
Frontend [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Lex [Lexer] Support adding working directory to relative search dir for #include shortening in HeaderSearch. 2018-01-29 13:21:23 +00:00
Rename [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Rewrite [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Sema [Sema] Add visited contexts to CodeCompleteContext 2018-01-17 14:29:25 +00:00
StaticAnalyzer [CMake] Use PRIVATE in target_link_libraries for executables 2017-12-05 21:49:56 +00:00
Tooling [Tooling] Test more APIs of ToolExecutor. NFC. 2018-01-26 11:10:32 +00:00
libclang [libclang] Add PrintingPolicy for pretty printing declarations 2018-01-16 10:19:56 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00