llvm-project/clang/lib/Format
Daniel Jasper 472da8644e clang-format: Properly reset nested AnnotatedLine structure.
This fixes llvm.org/PR17682.

Without this patch, the following code leads to invalid reads/writes:
  DEBUG({
    return aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +
           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa;
  });
  #if a
  #else
  #endif

Because of the #if-#else structure, the code is formatted and annotated
twice and becauce of the nested block, the annotated lines form a
hierarchical structure. This structure was not properly reset between
runs.

llvm-svn: 193352
2013-10-24 15:23:11 +00:00
..
BreakableToken.cpp Implemented tab usage only for indentation (http://llvm.org/PR17363) 2013-09-27 16:14:22 +00:00
BreakableToken.h Implemented tab usage only for indentation (http://llvm.org/PR17363) 2013-09-27 16:14:22 +00:00
CMakeLists.txt clang-format: Add column layout formatting for braced lists 2013-08-22 15:00:41 +00:00
ContinuationIndenter.cpp clang-format: Cleanup array initializer and dict initializer formatting. 2013-10-24 10:31:50 +00:00
ContinuationIndenter.h Keep track of indentation levels in static initializers for correct indentation with tabs. 2013-10-14 00:46:35 +00:00
Encoding.h Handle zero-width and double-width characters in string literals and comments. 2013-09-05 14:08:34 +00:00
Format.cpp clang-format: Fix formatting of nested blocks after comment. 2013-10-20 17:28:32 +00:00
FormatToken.cpp clang-format: Be more conservative about column layout formatting. 2013-10-24 14:14:49 +00:00
FormatToken.h clang-format: Cleanup array initializer and dict initializer formatting. 2013-10-24 10:31:50 +00:00
Makefile
TokenAnnotator.cpp clang-format: Cleanup array initializer and dict initializer formatting. 2013-10-24 10:31:50 +00:00
TokenAnnotator.h clang-format: Properly reset nested AnnotatedLine structure. 2013-10-24 15:23:11 +00:00
UnwrappedLineParser.cpp Remove incorrect assert. 2013-10-22 08:27:19 +00:00
UnwrappedLineParser.h Automatically munch semicolons after blocks. 2013-10-12 22:46:56 +00:00
WhitespaceManager.cpp Support formatting of preprocessor branches. 2013-10-11 21:25:45 +00:00
WhitespaceManager.h Support formatting of preprocessor branches. 2013-10-11 21:25:45 +00:00