[PATCH] D83703: [flang] Use octal escapes for character literals in modfiles

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 12:19:40 PDT 2020


This revision was automatically updated to reflect the committed changes.
tskeith marked an inline comment as done.
Closed by commit rG3780d3eb1001: [flang] Use octal escapes for character literals in modfiles (authored by tskeith).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D83703/new/

https://reviews.llvm.org/D83703

Files:
  flang/lib/Semantics/mod-file.cpp
  flang/lib/Semantics/mod-file.h


Index: flang/lib/Semantics/mod-file.h
===================================================================
--- flang/lib/Semantics/mod-file.h
+++ flang/lib/Semantics/mod-file.h
@@ -32,7 +32,7 @@
 
 class ModFileWriter {
 public:
-  ModFileWriter(SemanticsContext &context) : context_{context} {}
+  explicit ModFileWriter(SemanticsContext &context) : context_{context} {}
   bool WriteAll();
 
 private:
Index: flang/lib/Semantics/mod-file.cpp
===================================================================
--- flang/lib/Semantics/mod-file.cpp
+++ flang/lib/Semantics/mod-file.cpp
@@ -8,6 +8,7 @@
 
 #include "mod-file.h"
 #include "resolve-names.h"
+#include "flang/Common/restorer.h"
 #include "flang/Evaluate/tools.h"
 #include "flang/Parser/message.h"
 #include "flang/Parser/parsing.h"
@@ -99,6 +100,9 @@
 };
 
 bool ModFileWriter::WriteAll() {
+  // this flag affects character literals: force it to be consistent
+  auto restorer{
+      common::ScopedSet(parser::useHexadecimalEscapeSequences, false)};
   WriteAll(context_.globalScope());
   return !context_.AnyFatalError();
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D83703.277527.patch
Type: text/x-patch
Size: 1092 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200713/48c87e7e/attachment.bin>


More information about the llvm-commits mailing list