This is an archive of the discontinued LLVM Phabricator instance.

[flang] Extension: initialization of LOGICAL with INTEGER & vice versa
ClosedPublic

Authored by klausler on Jan 12 2022, 2:17 PM.

Details

Summary

We already accept assignments of INTEGER to LOGICAL (& vice versa)
as an extension, but not initialization. Extend initialization
to cover those cases.

(Also fix misspelling in nearby comment as suggested by code reviewer.)

Decouple an inadvertent dependence cycle by moving two
one-line function definitions into a header file.

Diff Detail

Event Timeline

klausler created this revision.Jan 12 2022, 2:17 PM
klausler requested review of this revision.Jan 12 2022, 2:17 PM
jeanPerier accepted this revision.Jan 13 2022, 7:20 AM

Please check why the buildbots are failing in data-to-inits.cpp. Logic looks good to me.
We will have to do something in lowering to support this feature, I think lowering would currently canonicalize the value when lowering initializers.

flang/lib/Semantics/data-to-inits.cpp
242

LLVM builds raise error expected ';' at end of declaration here (see bots).

This revision is now accepted and ready to land.Jan 13 2022, 7:20 AM
klausler updated this revision to Diff 399744.Jan 13 2022, 11:57 AM

Correct build issue.

klausler updated this revision to Diff 399766.Jan 13 2022, 1:25 PM

Rebase and resolve confict.

Herald added a project: Restricted Project. · View Herald TranscriptJan 13 2022, 2:22 PM