[PATCH] D84059: Insert leading blanks in LOGICAL formatted output fields

Peter Klausler via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 17 11:16:33 PDT 2020


klausler created this revision.
klausler added reviewers: sscalpone, schweitz.
klausler added a project: Flang.
Herald added a reviewer: jdoerfert.
Herald added a reviewer: DavidTruby.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

For Lw output editing, emit (w-1) blanks before the T or the F.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84059

Files:
  flang/runtime/edit-output.cpp


Index: flang/runtime/edit-output.cpp
===================================================================
--- flang/runtime/edit-output.cpp
+++ flang/runtime/edit-output.cpp
@@ -424,7 +424,8 @@
   switch (edit.descriptor) {
   case 'L':
   case 'G':
-    return io.Emit(truth ? "T" : "F", 1);
+    return io.EmitRepeated(' ', std::max(0, edit.width.value_or(1) - 1)) &&
+        io.Emit(truth ? "T" : "F", 1);
   default:
     io.GetIoErrorHandler().SignalError(IostatErrorInFormat,
         "Data edit descriptor '%c' may not be used with a LOGICAL data item",


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84059.278856.patch
Type: text/x-patch
Size: 561 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200717/e9b528cc/attachment.bin>


More information about the llvm-commits mailing list