[flang-commits] [flang] fa44ec7 - [flang] Allow continuation of D lines (#66242)
via flang-commits
flang-commits at lists.llvm.org
Mon Sep 18 09:37:06 PDT 2023
Author: Peter Klausler
Date: 2023-09-18T09:37:01-07:00
New Revision: fa44ec72d6d15cb42dd457b95d5456ef43bfe834
URL: https://github.com/llvm/llvm-project/commit/fa44ec72d6d15cb42dd457b95d5456ef43bfe834
DIFF: https://github.com/llvm/llvm-project/commit/fa44ec72d6d15cb42dd457b95d5456ef43bfe834.diff
LOG: [flang] Allow continuation of D lines (#66242)
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.)
Added:
Modified:
flang/lib/Parser/prescan.cpp
Removed:
################################################################################
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_)) {
More information about the flang-commits
mailing list