aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorBen Barham <ben_barham@apple.com>2020-11-17 17:25:50 -0800
committerArgyrios Kyrtzidis <kyrtzidis@apple.com>2020-11-17 17:27:50 -0800
commit5834996fefc937d6211dc8c8a5b200068753391a (patch)
tree13cb5ce724739d084d3a0a401ed55c84dc07afc7 /clang/lib/Frontend/CompilerInvocation.cpp
parentf4c6080ab820219c5bf78b0c2143e7fa194da296 (diff)
downloadllvm-5834996fefc937d6211dc8c8a5b200068753391a.zip
llvm-5834996fefc937d6211dc8c8a5b200068753391a.tar.gz
llvm-5834996fefc937d6211dc8c8a5b200068753391a.tar.bz2
[Frontend] Add flag to allow PCM generation despite compiler errors
As with precompiled headers, it's useful for indexers to be able to continue through compiler errors in dependent modules. Resolves rdar://69816264 Reviewed By: akyrtzi Differential Revision: https://reviews.llvm.org/D91580
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 5064230..a9bc48f 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -2027,6 +2027,7 @@ static InputKind ParseFrontendArgs(FrontendOptions &Opts, ArgList &Args,
Opts.IncludeTimestamps = !Args.hasArg(OPT_fno_pch_timestamp);
Opts.UseTemporary = !Args.hasArg(OPT_fno_temp_file);
Opts.IsSystemModule = Args.hasArg(OPT_fsystem_module);
+ Opts.AllowPCMWithCompilerErrors = Args.hasArg(OPT_fallow_pcm_with_errors);
if (Opts.ProgramAction != frontend::GenerateModule && Opts.IsSystemModule)
Diags.Report(diag::err_drv_argument_only_allowed_with) << "-fsystem-module"
@@ -3611,7 +3612,8 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
Opts.UsePredefines = !Args.hasArg(OPT_undef);
Opts.DetailedRecord = Args.hasArg(OPT_detailed_preprocessing_record);
Opts.DisablePCHValidation = Args.hasArg(OPT_fno_validate_pch);
- Opts.AllowPCHWithCompilerErrors = Args.hasArg(OPT_fallow_pch_with_errors);
+ Opts.AllowPCHWithCompilerErrors =
+ Args.hasArg(OPT_fallow_pch_with_errors, OPT_fallow_pcm_with_errors);
Opts.DumpDeserializedPCHDecls = Args.hasArg(OPT_dump_deserialized_pch_decls);
for (const auto *A : Args.filtered(OPT_error_on_deserialized_pch_decl))