This is an archive of the discontinued LLVM Phabricator instance.

[flang][nfc] Simplify option forwarding
ClosedPublic

Authored by awarzynski on Jul 28 2023, 4:43 AM.

Details

Summary

Use AddAllArgs to keep the implementation succinct. Also adds missing
'-flang-experimental-hlfir` in "frontend-forwarding.f90"

Diff Detail

Event Timeline

awarzynski created this revision.Jul 28 2023, 4:43 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
Herald added a subscriber: sunshaoce. · View Herald Transcript
awarzynski requested review of this revision.Jul 28 2023, 4:43 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 28 2023, 4:43 AM

LG.

clang/lib/Driver/ToolChains/Flang.cpp
146–147

Is the order changing in the tests below (poly before hlfir) expected?

This revision is now accepted and ready to land.Jul 28 2023, 5:20 AM

Thanks for taking a look!

clang/lib/Driver/ToolChains/Flang.cpp
146–147

Yes. AddAllArgs will consume -flang-experimental-polymorphism first because:

  • it satisfies the condition specified here (i.e. either -flang-experimental-hlfir or -flang-experimental-polymorphism ), and
  • that's the first option it encounters (i.e. it is specified before -flang-experimental-hlfir in the test file).
This revision was landed with ongoing or failed builds.Jul 28 2023, 7:24 AM
This revision was automatically updated to reflect the committed changes.