[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-10-12 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic closed this revision. jpenix-quic added a comment. 0ec3ac9b7fbd Gah, I goofed and forgot to add the "Differential Revision" line--this has been committed at 0ec3ac9b7fbd15698af7289e1214e8ff3d82ec14

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-10-12 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added a comment. Ping @awarzynski and @klausler--could you please let me know if the driver and runtime portions look good to you, respectively? (Apologies in advance if this isn't necessary, but as you both gave me significant feedback I wanted to make sure you are ok with the

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-10-03 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic marked an inline comment as done. jpenix-quic added a comment. In D130513#3827108 , @jeanPerier wrote: > The lowering part looks good to me (I only have a minor comment inlined about > a header used in lowering). Thank you @jeanPerier for

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-10-03 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 464849. jpenix-quic added a comment. Add /*overwrite=*/ comment I missed previously, move Runtime/environment-defaults.h to Lower/EnvironmentDefault.h CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/ https://reviews.llvm.org/D130513

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-20 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added a comment. > The build still fails. I think it might be an infrastructure issue or something like that--I've tried restarting it a few times and each time it just ends with "HTTP 28" as the only message I see. Another review that was created a bit ago

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-20 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic marked 5 inline comments as done. jpenix-quic added inline comments. Comment at: flang/test/Driver/convert.f90:1 +! Ensure argument -fconvert= works as expected. + awarzynski wrote: > rovka wrote: > > Nit: Shouldn't you also check that valid values

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-20 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 461759. jpenix-quic marked an inline comment as done. jpenix-quic added a comment. Move comment, see if build will cooperate. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/ https://reviews.llvm.org/D130513 Files:

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-20 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 461753. jpenix-quic added a comment. Address comments from @awarzynski, @rovka, and @peixin. Also fixed the file header comments for EnvironmentDefaults.h, environment-defaults.h, and environment-default-list.h to match others in their respective

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-19 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added inline comments. Comment at: flang/test/Driver/emit-mlir.f90:16 ! CHECK-NEXT: } +! CHECK-NEXT: fir.global @_QQEnvironmentDefaults constant : !fir.ref, !fir.ref> { +! CHECK-NEXT: %[[VAL_0:.*]] = fir.zero_bits !fir.ref, !fir.ref>

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-16 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic marked 2 inline comments as done. jpenix-quic added inline comments. Comment at: flang/runtime/environment.cpp:77 +#else + envp = environ; +#endif peixin wrote: > What is `environ` used for? Should we try to keep as less extern variable as >

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-16 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 460819. jpenix-quic added a comment. Remove unneeded braces and unnecessary changes to NameUniquer. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/ https://reviews.llvm.org/D130513 Files: clang/include/clang/Driver/Options.td

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-09-02 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added inline comments. Comment at: flang/test/Driver/emit-mlir.f90:16 ! CHECK-NEXT: } +! CHECK-NEXT: fir.global @_QQEnvironmentDefaults constant : !fir.ref, !fir.ref> { +! CHECK-NEXT: %[[VAL_0:.*]] = fir.zero_bits !fir.ref, !fir.ref>

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-26 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added inline comments. Comment at: flang/runtime/environment-default-list.h:1 +//===-- Runtime/environment-default-list.h ===// +// klausler wrote: > If you want this header to be maximally portable C and C++, please

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-26 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 455975. jpenix-quic added a comment. Fixed up/simplified environment-default-list.h for C/C++ compatibility. Also cleaned up a declaration and a few autos in the lowering component. Rebased. CHANGES SINCE LAST ACTION

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-22 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added a comment. @klausler Could you please take a look at this again and let me know if it is more in line with your suggestion above? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/ https://reviews.llvm.org/D130513

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-09 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 451225. jpenix-quic added a comment. Rebase to address conflicts, use string substitution blocks in my tests. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/ https://reviews.llvm.org/D130513 Files:

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-08 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added inline comments. Comment at: flang/lib/Lower/Bridge.cpp:203 //them. for (Fortran::lower::pft::Program::Units : pft.getUnits()) { std::visit(Fortran::common::visitors{ peixin wrote: > Doing this can avoid add one variable

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-08 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 450895. jpenix-quic edited the summary of this revision. jpenix-quic added a comment. Change hasMainProgram to be a local variable and update summary to reflect the new approach. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-04 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 449894. jpenix-quic added a comment. Hopefully fix Window's build errors by using the proper Windows-specific environment utilities (_putenv_s vs setenv). CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130513/new/

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-03 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added a comment. > BTW, can you continue working on the lowering of the convert argument of open > statement? I will take a look at this! Comment at: flang/lib/Lower/Bridge.cpp:2757 +if (funit.isMainProgram()) { + auto conversion =

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-08-03 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 449875. jpenix-quic added a comment. Herald added subscribers: bzcheeseman, sdasgup3, wenzhicui, wrengr, cota, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, stephenneuendorffer, liufengdb, aartbik, mgester,

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-07-26 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic marked 2 inline comments as done. jpenix-quic added inline comments. Comment at: clang/lib/Driver/ToolChains/Flang.cpp:52 +options::OPT_fno_automatic, +options::OPT_fconvert_EQ}); } awarzynski

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-07-26 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic updated this revision to Diff 447838. jpenix-quic added a comment. Added changes to address feedback about missing braces and where I am adding options::OPT_fconvert_EQ (and removing the extra formatting change). Also removes an unnecessary include I had mistakenly added. CHANGES

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-07-25 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added inline comments. Comment at: clang/include/clang/Driver/Options.td:4897 def ffixed_line_length_VALUE : Joined<["-"], "ffixed-line-length-">, Group, Alias; +def fconvert_EQ : Joined<["-"], "fconvert=">, Group, + HelpText<"Set endian conversion of data for

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-07-25 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added a comment. Thank you for taking a look at this and thank you for the feedback! I'm not sure if I am entirely following/I think I am confusing myself on some of the specifics. My understanding of your suggestion is that, rather than add and create a call to a fconvert-specific

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-07-25 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic added a comment. I do have a few related lingering questions as well: 1. While this implementation mimics gfortran's behavior, there are still differences with other compilers (please see the comment here: https://github.com/llvm/llvm-project/issues/55961#issuecomment-1175677659).

[PATCH] D130513: [Flang] Add -fconvert option to swap endianness for unformatted files

2022-07-25 Thread Jonathon Penix via Phabricator via cfe-commits
jpenix-quic created this revision. jpenix-quic added reviewers: schweitz, klausler, peixin, awarzynski. jpenix-quic added a project: Flang. Herald added subscribers: mehdi_amini, jdoerfert, mgorny. Herald added a reviewer: sscalpone. Herald added a project: All. jpenix-quic requested review of