This is an archive of the discontinued LLVM Phabricator instance.

[flang] Use octal escapes for character literals in modfiles
ClosedPublic

Authored by tskeith on Jul 13 2020, 11:29 AM.

Details

Summary

Character literals can be formatted using octal or hex escapes for
non-ascii characters. This is so that the program can be unparsed for
either pgf90 or gfortran to compile. But modfiles should not be affected
by that -- they should be consistent.

This changes causes modfiles to always have character literals formatted
with octal escapes.

Diff Detail

Event Timeline

tskeith created this revision.Jul 13 2020, 11:29 AM
Herald added a project: Restricted Project. · View Herald Transcript
klausler accepted this revision.Jul 13 2020, 11:35 AM
klausler added inline comments.
flang/lib/Semantics/mod-file.cpp
109

Could use common::Restorer here instead of a flag and a destructor.

flang/lib/Semantics/mod-file.h
35

nit: should be explicit.

This revision is now accepted and ready to land.Jul 13 2020, 11:35 AM
tskeith updated this revision to Diff 277522.Jul 13 2020, 12:06 PM

Use common::ScopedSet instead of explicit destructor.

tskeith marked 2 inline comments as done.Jul 13 2020, 12:08 PM
tskeith added inline comments.
flang/lib/Semantics/mod-file.cpp
109

Good idea, I've done that.

klausler accepted this revision.Jul 13 2020, 12:15 PM

LGTM, thanks.

This revision was automatically updated to reflect the committed changes.
tskeith marked an inline comment as done.