This is an archive of the discontinued LLVM Phabricator instance.

[flang] Add runtime interface for COMMAND_ARGUMENT_COUNT
ClosedPublic

Authored by rovka on Aug 25 2021, 12:38 AM.

Diff Detail

Event Timeline

rovka created this revision.Aug 25 2021, 12:38 AM
rovka requested review of this revision.Aug 25 2021, 12:38 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 25 2021, 12:38 AM

"environment.h" is not the right header for this.

The result type probably doesn't have to be an 64-bit integer.

rovka updated this revision to Diff 369054.Aug 27 2021, 3:08 AM

Addressed review comments.

In the end I created a new file, command.h, because main.h is in the c-or-cpp style and I'm not sure it's a good idea to touch it. I don't mind hearing otherwise though :)

rovka added inline comments.Aug 27 2021, 4:08 AM
flang/runtime/command.h
10

That's weird, it's suggesting LLVM_FLANG_RUNTIME_COMMAND_H, but none of the other headers in the runtime have that kind of include guard (there are 3 FLANG_RUNTIME_*_H and plenty of FORTRAN_RUNTIME_*_H). The C++ style document isn't very specific on this either. What's the preference?

klausler added inline comments.Aug 27 2021, 9:11 AM
flang/runtime/command.h
10

That's weird, it's suggesting LLVM_FLANG_RUNTIME_COMMAND_H, but none of the other headers in the runtime have that kind of include guard (there are 3 FLANG_RUNTIME_*_H and plenty of FORTRAN_RUNTIME_*_H). The C++ style document isn't very specific on this either. What's the preference?

Our header guards correspond to namespaces, so FORTRAN_*_H.

rovka added inline comments.Aug 30 2021, 12:07 AM
flang/runtime/command.h
10

Ok, so the file should be fine then. I don't think we can tune the clang-tidy check for this, and we probably don't want to disable it altogether since then we'd miss out on real issues (i.e. missing header guards). Should I just commit as-is? Or does anyone have any other comments?

jeanPerier accepted this revision.Aug 30 2021, 12:11 AM

Should I just commit as-is? Or does anyone have any other comments?

LGTM, you can go ahead.

This revision is now accepted and ready to land.Aug 30 2021, 12:11 AM
This revision was landed with ongoing or failed builds.Aug 30 2021, 12:42 AM
This revision was automatically updated to reflect the committed changes.