This is an archive of the discontinued LLVM Phabricator instance.

[Flang] NFC: Changes to adhere to coding guidelines
ClosedPublic

Authored by kiranchandramohan on Feb 28 2022, 4:33 AM.

Details

Summary

This patch includes some changes which brings the code in line with
llvm coding guidelines.
-> Remove curlies for one line if statements.
-> Remove else after return.
-> Removes a few usage of auto.
-> Add Doxygen comments

Addresses post review comments in D120403 by @schweitz.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2022, 4:33 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
kiranchandramohan requested review of this revision.Feb 28 2022, 4:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 28 2022, 4:33 AM
rovka added a subscriber: rovka.Feb 28 2022, 4:45 AM
rovka added inline comments.
flang/lib/Lower/IntrinsicCall.cpp
314

I think you're actually supposed to use braces here, there's an example in the LLVM coding style that says "Use braces for the outer if since the nested for is braced."
Anyway, I don't feel very strongly about it, so feel free to ignore.

rovka added inline comments.Feb 28 2022, 4:47 AM
flang/lib/Lower/IntrinsicCall.cpp
82

Address review comments from @rovka.

kiranchandramohan marked an inline comment as done.Feb 28 2022, 5:08 AM
kiranchandramohan added inline comments.
flang/lib/Lower/IntrinsicCall.cpp
314

Yes, makes sense and since it is mentioned in the guideline it is better to stick with it. I thought about it but didn't put the effort to check the coding style guide.

I have made the change.

rovka added a comment.Feb 28 2022, 5:24 AM

Ok, thanks :) This LGTM, but since you're mostly addressing Eric's comments I'll let him give you the official blessing.

schweitz accepted this revision.Feb 28 2022, 10:52 AM

I don't think always getting rid of type inferencing is really necessary and as code owner would accept using it.

flang/lib/Lower/IntrinsicCall.cpp
353–354

To avoid regressions. :)

This revision is now accepted and ready to land.Feb 28 2022, 10:52 AM

Add initialization to avoid regressions.

This revision was landed with ongoing or failed builds.Feb 28 2022, 3:51 PM
This revision was automatically updated to reflect the committed changes.