[flang-commits] [flang] [flang] Allow continuation of D lines (PR #66242)

via flang-commits flang-commits at lists.llvm.org
Wed Sep 13 10:00:46 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-flang-parser
            
<details>
<summary>Changes</summary>
When the old extension of D debug lines in fixed form source is enabled, recognize continuation lines that begin with a D.

(No test is added, since the community's driver doesn't support the GNU Fortran option -fd-lines-as-code.)
--
Full diff: https://github.com/llvm/llvm-project/pull/66242.diff

1 Files Affected:

- (modified) flang/lib/Parser/prescan.cpp (+5-2) 


<pre>
diff --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp
index 6ed1581209da68e..2f25b02bf7a323d 100644
--- a/flang/lib/Parser/prescan.cpp
+++ b/flang/lib/Parser/prescan.cpp
@@ -1041,8 +1041,11 @@ const char *Prescanner::FixedFormContinuationLine(bool mightNeedSpace) {
       tabInCurrentLine_ = true;
       return nextLine_ + 2; // VAX extension
     }
-    if (col1 == &#x27; &#x27; && nextLine_[1] == &#x27; &#x27; && nextLine_[2] == &#x27; &#x27; &&
-        nextLine_[3] == &#x27; &#x27; && nextLine_[4] == &#x27; &#x27;) {
+    if ((col1 == &#x27; &#x27; ||
+            ((col1 == &#x27;D&#x27; || col1 == &#x27;d&#x27;) &&
+                features_.IsEnabled(LanguageFeature::OldDebugLines))) &&
+        nextLine_[1] == &#x27; &#x27; && nextLine_[2] == &#x27; &#x27; && nextLine_[3] == &#x27; &#x27; &&
+        nextLine_[4] == &#x27; &#x27;) {
       char col6{nextLine_[5]};
       if (col6 != &#x27;\n&#x27; && col6 != &#x27;\t&#x27; && col6 != &#x27; &#x27; && col6 != &#x27;0&#x27;) {
         if ((col6 == &#x27;i&#x27; || col6 == &#x27;I&#x27;) && IsIncludeLine(nextLine_)) {
</pre>
</details>


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


More information about the flang-commits mailing list