aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorNico Weber <thakis@chromium.org>2021-09-29 18:46:24 -0400
committerNico Weber <thakis@chromium.org>2021-09-30 14:33:14 -0400
commit8dfbe9b0aeb6d45975d453dfed828068c63c225e (patch)
tree74e9543500ccb10f44fbea533213de3149f9b42b /clang/lib/Frontend/CompilerInvocation.cpp
parentdbaa40833693e79a8fcbea6435eb3b0becfd67ad (diff)
downloadllvm-8dfbe9b0aeb6d45975d453dfed828068c63c225e.zip
llvm-8dfbe9b0aeb6d45975d453dfed828068c63c225e.tar.gz
llvm-8dfbe9b0aeb6d45975d453dfed828068c63c225e.tar.bz2
[clang] Make crash reproducer work with clang-cl
When clang crashes, it writes a standalone source file and shell script to reproduce the crash. The Driver used to set `Mode = CPPMode` in generateCompilationDiagnostics() to force preprocessing mode. This has the side effect of making IsCLMode() return false, which in turn meant Clang::AddClangCLArgs() didn't get called when creating the standalone source file, which meant the stand-alone file was preprocessed with the gcc driver's defaults In particular, exceptions default to on with the gcc driver, but to off with the cl driver. The .sh script did use the original command line, so in the reproducer for a clang-cl crash, the standalone source file could contain exception-using code after preprocessing that the compiler invocation in the shell script would then complain about. This patch removes the `Mode = CPPMode;` line and instead additionally checks for `CCGenDiagnostics` in most places that check `CCCIsCPP(). This also matches the strategy Clang::ConstructJob() uses to add -frewrite-includes for creating the standalone source file for a crash report. Fixes PR52007. Differential Revision: https://reviews.llvm.org/D110783
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions