This is an archive of the discontinued LLVM Phabricator instance.

[Frontend] give createInvocationFromCommandLine an options struct
ClosedPublic

Authored by sammccall on May 4 2022, 5:16 PM.

Details

Summary

It's accumulating way too many optional params (see D124970)

While here, improve the name and the documentation.

Diff Detail

Event Timeline

sammccall created this revision.May 4 2022, 5:16 PM
Herald added a project: Restricted Project. · View Herald TranscriptMay 4 2022, 5:16 PM
sammccall requested review of this revision.May 4 2022, 5:16 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 4 2022, 5:16 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Thanks this LGTM. Just two questions:

  • Why not migrate rest of the usages and drop the old function completely in this patch
  • What about moving the function from clang/Frontend to Tooling, Support or FrontendTool? this is clearly only inteded to be used by tools and not part of the Frontend. There's actually Tooling/Tooling.h which has a newInvocation that takes in cc1 args, rather than driver args. so these two seem like siblings.
clang/include/clang/Frontend/Utils.h
232

what's the reason for not deleting this all together from open source. there isn't very many references.
is it just to keep the patch small so that relevant changes are more visible ?

Thanks this LGTM. Just two questions:

  • Why not migrate rest of the usages and drop the old function completely in this patch

In order to keep the patch small. I can do this as a followup.

  • What about moving the function from clang/Frontend to Tooling, Support or FrontendTool? this is clearly only inteded to be used by tools and not part of the Frontend. There's actually Tooling/Tooling.h which has a newInvocation that takes in cc1 args, rather than driver args. so these two seem like siblings.

Sounds reasonable to me, but I'm not personally planning to work on it.
Note that ASTUnit depends on this, so there's some layering mess to clean up.

This revision was not accepted when it landed; it landed in state Needs Review.May 5 2022, 6:12 AM
This revision was automatically updated to reflect the committed changes.