[flang-commits] [clang] [flang] [Flang] Adding -ffree-line-length-<value> flag (PR #192941)

Andre Kuhlenschmidt via flang-commits flang-commits at lists.llvm.org
Wed May 6 09:56:50 PDT 2026


================
@@ -808,27 +808,33 @@ static bool parseFrontendArgs(FrontendOptions &opts, llvm::opt::ArgList &args,
                            : FortranForm::FreeForm;
   }
 
-  // Set fixedFormColumns based on -ffixed-line-length=<value>
-  if (const auto *arg =
-          args.getLastArg(clang::options::OPT_ffixed_line_length_EQ)) {
+  // Set fixedFormColumns based on -ffixed-line-length=<value> or
+  // set freeFormColumns based on -ffree-line-length=<value>.
+  for (const auto *arg :
+       args.filtered(clang::options::OPT_ffixed_line_length_EQ,
+                     clang::options::OPT_ffree_line_length_EQ)) {
+
     llvm::StringRef argValue = llvm::StringRef(arg->getValue());
+    bool isFixedLineFlag =
+        arg->getOption().matches(clang::options::OPT_ffixed_line_length_EQ);
     std::int64_t columns = -1;
     if (argValue == "none") {
       columns = 0;
     } else if (argValue.getAsInteger(/*Radix=*/10, columns)) {
       columns = -1;
     }
     if (columns < 0) {
-      diags.Report(clang::diag::err_drv_negative_columns)
+      diags.Report(clang::diag::err_drv_invalid_columns)
           << arg->getOption().getName() << arg->getValue();
     } else if (columns == 0) {
-      opts.fixedFormColumns = 1000000;
-    } else if (columns < 7) {
+      columns = 10000;
----------------
akuhlens wrote:

This is changing the behavior of `--ffixed-line-length=` for both "none" and "0" from 1M to 10K. Please either explain the purpose and intent of the change or put it back.

https://github.com/llvm/llvm-project/pull/192941


More information about the flang-commits mailing list