Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[flang] Allow continuation of D lines #66242

Merged
merged 1 commit into from
Sep 18, 2023
Merged

[flang] Allow continuation of D lines #66242

merged 1 commit into from
Sep 18, 2023

Conversation

klausler
Copy link
Contributor

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.)

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.)

Pull request: llvm#66242
@klausler klausler requested a review from a team as a code owner September 13, 2023 16:59
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:parser labels Sep 13, 2023
@llvmbot
Copy link
Collaborator

llvmbot commented Sep 13, 2023

@llvm/pr-subscribers-flang-parser

Changes 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)
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 == ' ' && nextLine_[1] == ' ' && nextLine_[2] == ' ' &&
-        nextLine_[3] == ' ' && nextLine_[4] == ' ') {
+    if ((col1 == ' ' ||
+            ((col1 == 'D' || col1 == 'd') &&
+                features_.IsEnabled(LanguageFeature::OldDebugLines))) &&
+        nextLine_[1] == ' ' && nextLine_[2] == ' ' && nextLine_[3] == ' ' &&
+        nextLine_[4] == ' ') {
       char col6{nextLine_[5]};
       if (col6 != '\n' && col6 != '\t' && col6 != ' ' && col6 != '0') {
         if ((col6 == 'i' || col6 == 'I') && IsIncludeLine(nextLine_)) {

@EugeneZelenko EugeneZelenko added flang:frontend and removed flang Flang issues not falling into any other category flang:parser labels Sep 15, 2023
@klausler klausler merged commit fa44ec7 into llvm:main Sep 18, 2023
3 checks passed
@klausler klausler deleted the bug1538 branch September 18, 2023 16:37
ZijunZhaoCCK pushed a commit to ZijunZhaoCCK/llvm-project that referenced this pull request Sep 19, 2023
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.)
zahiraam pushed a commit to tahonermann/llvm-project that referenced this pull request Oct 24, 2023
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.)
zahiraam pushed a commit to tahonermann/llvm-project that referenced this pull request Oct 24, 2023
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.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants