This is an archive of the discontinued LLVM Phabricator instance.

[flang][driver] Rename the accessors (NFC)
ClosedPublic

Authored by awarzynski on Oct 28 2020, 4:50 AM.

Details

Summary

As per:

point 3:

Accessor member functions are named with the non-public data member's
name, less the trailing underscore.

Originally we just followed the LLVM's style, which is incompatible with
Flang. This patch renames the accessors (and a handful of mutators)
accordingly.

Diff Detail

Event Timeline

awarzynski created this revision.Oct 28 2020, 4:50 AM
Herald added a project: Restricted Project. · View Herald Transcript
awarzynski requested review of this revision.Oct 28 2020, 4:50 AM

Restore changes made outside the driver

Thank you @awarzynski for changing this to be compatible with Flang style, it is not the nicest job.
First time we implemented it was very different so I missed some standards.
What I notice is that you did not changed any of the get for diagnostic. Is there any reasons for that?

flang/include/flang/Frontend/CompilerInstance.h
110–111

Is the diagnostic not changed because you want to have like it is in clang?
As for instance:
clang::DiagnosticsEngine &GetDiagnostics()
void SetDiagnostics(clang::DiagnosticsEngine *value);

195

Should this also be changed?

flang/lib/Frontend/CompilerInstance.cpp
29

Should it be set_invocation?

awarzynski marked 3 inline comments as done.

Update the remaining accessors/mutators

Thank you for reviewing @CarolineConcatto! I missed a few cases - thanks for catching those! That's been updated in the 2nd patch (uploaded just now)

I've also realised that there was:

  • getDiagnostics() and GetDiagnostics() (replaced with diagnostics())
  • setDiagnostics() which was neither implemented nor used
CarolineConcatto accepted this revision.Nov 2 2020, 2:42 AM

Thank you @awarzynski,
LGTM!

This revision is now accepted and ready to land.Nov 2 2020, 2:42 AM
This revision was landed with ongoing or failed builds.Nov 2 2020, 3:29 AM
This revision was automatically updated to reflect the committed changes.