Author: Jan Svoboda Date: 2021-02-08T10:18:15+01:00 New Revision: 6039f821456fffa24fa36132f2022880fa9128df
URL: https://github.com/llvm/llvm-project/commit/6039f821456fffa24fa36132f2022880fa9128df DIFF: https://github.com/llvm/llvm-project/commit/6039f821456fffa24fa36132f2022880fa9128df.diff LOG: Revert "[clang][cli] Report result of ParseLangArgs" This reverts commit bff6d9bb The change causes failure of Clang's Index/implicit-attrs.m test. Added: Modified: clang/include/clang/Basic/Diagnostic.h clang/include/clang/Frontend/CompilerInvocation.h clang/lib/Frontend/CompilerInvocation.cpp Removed: ################################################################################ diff --git a/clang/include/clang/Basic/Diagnostic.h b/clang/include/clang/Basic/Diagnostic.h index a3cc3af5a74a..3499c551cfdf 100644 --- a/clang/include/clang/Basic/Diagnostic.h +++ b/clang/include/clang/Basic/Diagnostic.h @@ -806,7 +806,6 @@ class DiagnosticsEngine : public RefCountedBase<DiagnosticsEngine> { return FatalErrorOccurred || UnrecoverableErrorOccurred; } - unsigned getNumErrors() const { return NumErrors; } unsigned getNumWarnings() const { return NumWarnings; } void setNumWarnings(unsigned NumWarnings) { diff --git a/clang/include/clang/Frontend/CompilerInvocation.h b/clang/include/clang/Frontend/CompilerInvocation.h index e880713b71aa..233569aa727b 100644 --- a/clang/include/clang/Frontend/CompilerInvocation.h +++ b/clang/include/clang/Frontend/CompilerInvocation.h @@ -249,7 +249,7 @@ class CompilerInvocation : public CompilerInvocationBase { DiagnosticsEngine &Diags); /// Parse command line options that map to LangOptions. - static bool ParseLangArgs(LangOptions &Opts, llvm::opt::ArgList &Args, + static void ParseLangArgs(LangOptions &Opts, llvm::opt::ArgList &Args, InputKind IK, const llvm::Triple &T, std::vector<std::string> &Includes, DiagnosticsEngine &Diags); diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp index e131804b11d1..f4104a35c0fd 100644 --- a/clang/lib/Frontend/CompilerInvocation.cpp +++ b/clang/lib/Frontend/CompilerInvocation.cpp @@ -2642,12 +2642,10 @@ static void GenerateLangArgs(const LangOptions &Opts, GenerateArg(Args, OPT_fdeclare_opencl_builtins, SA); } -bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, +void CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, const llvm::Triple &T, std::vector<std::string> &Includes, DiagnosticsEngine &Diags) { - unsigned NumErrorsBefore = Diags.getNumErrors(); - // FIXME: Cleanup per-file based stuff. LangStandard::Kind LangStd = LangStandard::lang_unspecified; if (const Arg *A = Args.getLastArg(OPT_std_EQ)) { @@ -3078,8 +3076,6 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, } } } - - return Success && Diags.getNumErrors() == NumErrorsBefore; } static bool isStrictlyPreprocessorAction(frontend::ActionKind Action) { @@ -3420,8 +3416,8 @@ bool CompilerInvocation::CreateFromArgs(CompilerInvocation &Res, } else { // Other LangOpts are only initialized when the input is not AST or LLVM IR. // FIXME: Should we really be calling this for an Language::Asm input? - Success &= ParseLangArgs(LangOpts, Args, DashX, T, - Res.getPreprocessorOpts().Includes, Diags); + ParseLangArgs(LangOpts, Args, DashX, T, Res.getPreprocessorOpts().Includes, + Diags); if (Res.getFrontendOpts().ProgramAction == frontend::RewriteObjC) LangOpts.ObjCExceptions = 1; if (T.isOSDarwin() && DashX.isPreprocessed()) { _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits