This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add -f[no-]honor-infinities and -menable-no-infs
ClosedPublic

Authored by tblah on Oct 31 2022, 4:50 AM.

Details

Summary

Only add the option processing and store the result. No attributes are added to FIR yet.

This patch follows clang in forwarding -fno-honor-infinities as -menable-no-infs.

The argument parsing state machine in the compiler driver may seem over-engineered for the currently supported flags, but more will be added subsequently.

The frontend driver is not user facing so I have not written code support multiple flags overriding each other or to support both positive and negative versions of boolean flags. Clang-cc1 can automatically process arguments using details in Options.td, but this is not yet used in Flang-fc1.

Diff Detail

Event Timeline

tblah created this revision.Oct 31 2022, 4:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 31 2022, 4:50 AM
tblah requested review of this revision.Oct 31 2022, 4:50 AM

Looks good to me.

clang/include/clang/Driver/Options.td
5637–5642

Can we add a header here for grouping these options (assuming there will be more) or move it to another place, see the next comment?

6059–6063

Would this be a better place to add the option menable_no_infinities?

tblah updated this revision to Diff 472606.Nov 2 2022, 7:27 AM

Thanks @kiranchandramohan for review. I've updated the patch.

tblah marked 2 inline comments as done.Nov 2 2022, 7:27 AM
kiranchandramohan accepted this revision.Nov 2 2022, 8:02 AM

Thanks @tblah. LGTM.

This revision is now accepted and ready to land.Nov 2 2022, 8:02 AM
awarzynski accepted this revision.Nov 3 2022, 1:20 AM

Thanks Tom, LGTM!

This revision was automatically updated to reflect the committed changes.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 3 2022, 3:40 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript