diff options
author | David Blaikie <dblaikie@gmail.com> | 2018-11-15 03:04:21 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2018-11-15 03:04:21 +0000 |
commit | 799b6c6d7970bb973cce13e509d89a3824fa0022 (patch) | |
tree | 999be4d49155909b415248a79c01259ce24449e0 /lib/Lex | |
parent | 7a7947889fb274b80557161b55db053c72ff3114 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346928 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex')
-rw-r--r-- | lib/Lex/Pragma.cpp | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp index 0a63ed724c..e58378f6ab 100644 --- a/lib/Lex/Pragma.cpp +++ b/lib/Lex/Pragma.cpp @@ -1130,10 +1130,6 @@ struct PragmaDebugHandler : public PragmaHandler { } void HandleCaptured(Preprocessor &PP) { - // Skip if emitting preprocessed output. - if (PP.isPreprocessedOutput()) - return; - Token Tok; PP.LexUnexpandedToken(Tok); |