llvm-project/clang/lib/Lex
Ilya Biryukov 8f738ac6d4 Fix recording preamble's conditional stack in skipped PP branches.
Summary:
This fixes PR34547.
`Lexer::LexEndOfFile` handles recording of ConditionalStack for
preamble and reporting errors about unmatched conditionalal PP
directives.
However, SkipExcludedConditionalBlock contianed duplicated logic for
reporting errors and clearing ConditionalStack, but not for preamble
recording.

This fix removes error reporting logic from
`SkipExcludedConditionalBlock`, unmatched PP conditionals are now
reported inside `Lexer::LexEndOfFile`.

Reviewers: erikjv, klimek, bkramer

Reviewed By: erikjv

Subscribers: nik, cfe-commits

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

llvm-svn: 313014
2017-09-12 08:35:57 +00:00
..
CMakeLists.txt
HeaderMap.cpp Use StringRef for MemoryBuffer identifier API (NFC) 2016-10-01 16:38:28 +00:00
HeaderSearch.cpp [modules] Add ability to specify module name to module file mapping (reapply) 2017-08-31 06:26:43 +00:00
Lexer.cpp [Preprocessor] Correct internal token parsing of newline characters in CRLF 2017-09-05 17:32:36 +00:00
LiteralSupport.cpp Recommit "Add _Float16 as a C/C++ source language type" 2017-09-08 15:15:00 +00:00
MacroArgs.cpp [NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions. 2017-07-17 17:18:43 +00:00
MacroInfo.cpp [NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions. 2017-07-17 17:18:43 +00:00
ModuleMap.cpp Fix memory leak after r312467. The ModuleMap is the owner of the global module object until it's reparented under a real module. 2017-09-05 21:46:22 +00:00
PPCaching.cpp [Preprocessor] Fix incorrect token caching that occurs when lexing _Pragma 2017-02-24 17:45:16 +00:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp Switch PPCallbacks to take the new MacroDefinition instead of MacroDirective*, in order to preserve full information on module macro expansion. 2015-05-04 03:15:40 +00:00
PPDirectives.cpp Fix recording preamble's conditional stack in skipped PP branches. 2017-09-12 08:35:57 +00:00
PPExpressions.cpp Keep the IdentifierInfo in the Token for alternative operator keyword 2017-07-14 09:23:40 +00:00
PPLexerChange.cpp Fixed a crash on replaying Preamble's PP conditional stack. 2017-08-21 12:03:08 +00:00
PPMacroExpansion.cpp [NFC] Refactor the Preprocessor function that handles Macro definitions and rename Arguments to Parameters in Macro Definitions. 2017-07-17 17:18:43 +00:00
PTHLexer.cpp Turn FileManager DirectoryEntry::Name from raw pointer to StringRef (NFC) 2016-10-11 07:31:29 +00:00
Pragma.cpp Support non-identifier module names when preprocessing modules. 2017-06-19 23:09:36 +00:00
PreprocessingRecord.cpp [Lexer] Report more precise skipped regions (PR34166) 2017-09-11 20:47:42 +00:00
Preprocessor.cpp Fixed a crash on replaying Preamble's PP conditional stack. 2017-08-21 12:03:08 +00:00
PreprocessorLexer.cpp
ScratchBuffer.cpp PR33902: Invalidate line number cache when adding more text to existing buffer. 2017-07-30 06:31:29 +00:00
TokenConcatenation.cpp [PP] Replace some index based for loops with range based ones 2016-10-26 13:06:13 +00:00
TokenLexer.cpp [NFC] Update local variable names to upper-case as per LLVM Coding Standards. 2017-07-20 01:10:56 +00:00
UnicodeCharSets.h