This is an archive of the discontinued LLVM Phabricator instance.

[flang] Expunge needless semantics::ProcInterface
ClosedPublic

Authored by klausler on Dec 15 2022, 11:21 AM.

Details

Summary

The ProcInterface structure is used only by ProcEntityDetails; it represents
what a program might have put in parentheses in a procedure-declaration-stmt,
either the name of a procedure interface or a declaration-type-spec.

If a procedure entity has an implicit interface, the function result
type (if any) can be kept in EntityDetails::type_, which already exists
and is currently redundant for ProcEntityDetails symbols.

All that is really needed is a nullable Symbol pointer in ProcEntityDetails
to point to the procedure's explicit interface, when it has one.

Also, catch the case where a procedure has an explicit interface
and a program attempts to also give it a type.

Diff Detail

Event Timeline

klausler created this revision.Dec 15 2022, 11:21 AM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Dec 15 2022, 11:21 AM

I feel sorry to bother you here because there is something odd with clang-format that is a bit unrelated to your patch.
My top of the tree clang-format agrees with the formatting of your patch, but the build bot clang format (and @PeteSteinfeld's clang-format).

I had a similar issue in one of my patch, it seems my clang-format and yours want the "*" in if (const Symbol *interface{proc.procInterface()}) next to the variable name (which makes more sense IMHO), while the build bot clang-format (and older clang format I could test) wants the "*" in the middle of two spaces if (const Symbol * interface{proc.procInterface()}). Given most of flang codebase is using the latter style, it may be better to stick with it, especially if it still is what the build bot expects.

I feel sorry to bother you here because there is something odd with clang-format that is a bit unrelated to your patch.
My top of the tree clang-format agrees with the formatting of your patch, but the build bot clang format (and @PeteSteinfeld's clang-format).

I had a similar issue in one of my patch, it seems my clang-format and yours want the "*" in if (const Symbol *interface{proc.procInterface()}) next to the variable name (which makes more sense IMHO), while the build bot clang-format (and older clang format I could test) wants the "*" in the middle of two spaces if (const Symbol * interface{proc.procInterface()}). Given most of flang codebase is using the latter style, it may be better to stick with it, especially if it still is what the build bot expects.

I'm not sure if this is documented anywhere, but I believe that the version of clang-format that the build bots use gets built from the latest released sources. The latest released version of llvm has the tag "llvmorg-15.0.6". I'd guess that if you build clang-format from that release, you'll match the build bots.

I have always been using the top-of-tree clang-format.

Agree that the extra space after the '*' in some but not all pointer declarations looks weird. There have also been issues with spaces in a few braced declarations.

This revision was not accepted when it landed; it landed in state Needs Review.Dec 16 2022, 10:44 AM
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.