llvm-project/clang/lib
Mark Zeren 1c3afaf50a [clang-format] Re-land: Fixup #include guard indents after parseFile()
Summary:
When a preprocessor indent closes after the last line of normal code we do not
correctly fixup include guard indents. For example:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  int i;
  #  define A 0
  #endif
  #endif

incorrectly reformats to:

  #ifndef HEADER_H
  #define HEADER_H
  #if 1
  int i;
  #    define A 0
  #  endif
  #endif

To resolve this issue we must fixup levels after parseFile(). Delaying
the fixup introduces a new state, so consolidate include guard search
state into an enum.

Reviewers: krasimir, klimek

Subscribers: cfe-commits

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

llvm-svn: 324246
2018-02-05 15:59:00 +00:00
..
ARCMigrate Added LLVM_FALLTHROUGH to address warning: this statement may fall through. NFC. 2017-06-03 06:23:19 +00:00
AST Make __has_unique_object_representations reject empty union types. 2018-02-02 20:30:39 +00:00
ASTMatchers Add hasTrailingReturn AST matcher 2018-01-22 22:45:23 +00:00
Analysis [analyzer] Fix yet-another-crash in body-farming std::call_once 2018-02-02 01:44:07 +00:00
Basic [RISCV] Create a LinuxTargetInfo when targeting Linux 2018-02-03 11:56:11 +00:00
CodeGen Recommit rL323952: [DebugInfo] Enable debug information for C99 VLA types. 2018-02-03 13:55:59 +00:00
CrossTU [CrossTU] Fix handling of Cross Translation Unit directory path 2017-10-27 12:53:37 +00:00
Driver [WebAssembly] Don't pass -ffunction-section/-fdata-sections 2018-01-31 18:55:22 +00:00
Edit [clang] Fix format specifiers fixits for nested macros 2017-06-20 20:46:58 +00:00
Format [clang-format] Re-land: Fixup #include guard indents after parseFile() 2018-02-05 15:59:00 +00:00
Frontend [analyzer] Show full analyzer invocation for reproducibility in HTML reports 2018-01-23 19:28:52 +00:00
FrontendTool [CMake] Use #cmakedefine01 for CLANG_ENABLE_(ARCMT|OBJC_REWRITER|STATIC_ANALYZER) 2017-10-18 05:21:17 +00:00
Headers [CUDA] Added partial support for CUDA-9.1 2018-01-30 00:00:12 +00:00
Index [Index] fix USR generation for namespace{extern{X}} 2018-02-02 14:13:37 +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
Parse Fix crash when trying to pack-expand a GNU statement expression. 2018-02-03 00:44:57 +00:00
Rewrite [analyzer] Show full analyzer invocation for reproducibility in HTML reports 2018-01-23 19:28:52 +00:00
Sema Fix crash when trying to pack-expand a GNU statement expression. 2018-02-03 00:44:57 +00:00
Serialization [index] Fix crash when indexing a C++14 PCH/module related to TemplateTemplateParmDecls of alias templates 2018-01-26 19:26:12 +00:00
StaticAnalyzer Revert r324166 "[analyzer] Add a checker for mmap()...". 2018-02-03 03:57:32 +00:00
Tooling [Tooling] Returns non-zero status code when files are skipped. 2018-02-02 18:19:22 +00:00
CMakeLists.txt Add Cross Translation Unit support library 2017-09-22 11:11:01 +00:00