llvm-project/clang/lib/Lex
David Blaikie 1013fe7451 Fix combining pragma __debug dump & parser_crash with -E
Previously these would be transformed into annotation tokens and the
preprocessor would then assume they were real tokens with source
locations and assert/UB.

Other pragmas that produce annotation tokens aren't a problem because
they aren't handled if the parser isn't hooked up - ParsePragma.cpp
registers those handlers & isn't run for pure preprocessing. So they're
treated as unknown pragmas & printed verbatim by the preprocessor.

Perhaps these pragmas should be treated the same way? But they got mixed
in with other __debug pragmas that do need to be handled during
preprocessing.

The third __debug pragma that produces an annotation token is 'captured'
- which had its own fix for this issue - by not inserting the annotation
token in the first place if it detected that it was in preprocessing
mode. I've removed that fix (from Lex/Pragma.cpp) in favor of the more
general one in Frontend/PrintPreprocessedOutput.cpp.

llvm-svn: 346928
2018-11-15 03:04:21 +00:00
..
CMakeLists.txt
HeaderMap.cpp [Lex] Make HeaderMaps a unique_ptr vector 2018-08-20 19:15:02 +00:00
HeaderSearch.cpp [HeaderSearch] loadSubdirectoryModuleMaps should respect -working-directory 2018-11-14 01:08:03 +00:00
Lexer.cpp NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
LiteralSupport.cpp Fix clang -Wimplicit-fallthrough warnings across llvm, NFC 2018-11-01 19:54:45 +00:00
MacroArgs.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
MacroInfo.cpp [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManager 2018-10-31 17:19:20 +00:00
ModuleMap.cpp Reapply "Fix regression in behavior of clang -x c++-header -fmodule-name=XXX" 2018-11-05 12:46:02 +00:00
PPCaching.cpp [Lex] Fix crash on code completion in comment in included file. 2018-01-19 23:41:47 +00:00
PPCallbacks.cpp
PPConditionalDirectiveRecord.cpp
PPDirectives.cpp NFC: Remove the ObjC1/ObjC2 distinction from clang (and related projects) 2018-10-30 20:31:30 +00:00
PPExpressions.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
PPLexerChange.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
PPMacroExpansion.cpp Add a callback for `__has_include` and use it for dependency scanning. 2018-09-18 23:27:02 +00:00
PTHLexer.cpp Lift VFS from clang to llvm (NFC) 2018-10-10 13:27:25 +00:00
Pragma.cpp Fix combining pragma __debug dump & parser_crash with -E 2018-11-15 03:04:21 +00:00
PreprocessingRecord.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
Preprocessor.cpp [CodeComplete] Add completions for filenames in #include directives. 2018-09-18 08:40:41 +00:00
PreprocessorLexer.cpp Remove \brief commands from doxygen comments. 2018-05-09 01:00:01 +00:00
ScratchBuffer.cpp [Lex] Use WritableMemoryBuffer in ScratchBuffer.cpp 2018-01-11 10:43:45 +00:00
TokenConcatenation.cpp [Lex] TokenConcatenation now takes const Preprocessor 2018-09-27 12:40:16 +00:00
TokenLexer.cpp Remove trailing space 2018-07-30 19:24:48 +00:00
UnicodeCharSets.h