This is an archive of the discontinued LLVM Phabricator instance.

[clang][cli] Report result of ParseLangArgs
ClosedPublic

Authored by jansvoboda11 on Feb 1 2021, 9:08 AM.

Details

Summary

This patch correctly reports success/failure of ParseLangArgs. Besides being consistent with other Parse functions, this is required to make round-tripping of LangOptions work.

Diff Detail

Event Timeline

jansvoboda11 requested review of this revision.Feb 1 2021, 9:08 AM
jansvoboda11 created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2021, 9:08 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
jansvoboda11 edited the summary of this revision. (Show Details)Feb 1 2021, 9:26 AM
dexonsmith added inline comments.Feb 1 2021, 8:50 PM
clang/lib/Frontend/CompilerInvocation.cpp
3082

Would this avoid the changes above?

return Success && !Diags.hasErrorOccurred();

?

Alternatively, might it be cleaner to shove the Success = false into a helper lambda or something?

Rely on DiagnosticsEngine when reporting parsing result

jansvoboda11 added inline comments.Feb 3 2021, 10:08 AM
clang/lib/Frontend/CompilerInvocation.cpp
3082

I've implemented something similar in my latest update. I think it works out pretty well, thanks for the suggestion.

This revision is now accepted and ready to land.Feb 3 2021, 1:12 PM
This revision was landed with ongoing or failed builds.Feb 8 2021, 12:56 AM
This revision was automatically updated to reflect the committed changes.