This patch restores several calls to Optional::value() in preference
to Optional::operator*.
The Flang C++ Style Guide tells us to use x.value() where no presence
test is obviously protecting a *x reference to the contents.
Paths
| Differential D128590
[flang] Restore Optional::value() (NFC) ClosedPublic Authored by kazu on Jun 25 2022, 12:18 PM.
Details
Summary This patch restores several calls to Optional::value() in preference The Flang C++ Style Guide tells us to use x.value() where no presence
Diff Detail
Event TimelineHerald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJun 25 2022, 12:18 PM Comment Actions I'm a bit lost with your changes here. Earlier you removed the use of the value() or equivalent function and now you are introducing it back? Can we have a clear plan of action on this? Or is it just to stick with our guidelines? Is so there are more to change. Comment Actions
Yes, I'm trying to correct my early patch and trying to stick with the guidelines. My plan is to move away from Optional::{hasValue,getValue} while sticking to the coding style of respective subprojects. This means that for flang, hasValue will be dropped inside control-flow conditions and converted to has_value outside control-flow conditions. getValue will be converted to '*' where the protection is obvious and .value() otherwise. This revision is now accepted and ready to land.Jun 25 2022, 1:15 PM Closed by commit rGdc97886fa36d: [flang] Restore Optional::value() (NFC) (authored by kazu). · Explain WhyJun 25 2022, 1:21 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 440010 flang/lib/Lower/ConvertExpr.cpp
flang/lib/Optimizer/CodeGen/CodeGen.cpp
|