[flang-commits] [flang] 14c7754 - [flang] Skip `D` when including D debug line

Jean Perier via flang-commits flang-commits at lists.llvm.org
Thu Mar 31 01:56:42 PDT 2022


Author: Jean Perier
Date: 2022-03-31T10:56:25+02:00
New Revision: 14c7754a35da9bf6b346e2a6ce4b3d8c3b00b434

URL: https://github.com/llvm/llvm-project/commit/14c7754a35da9bf6b346e2a6ce4b3d8c3b00b434
DIFF: https://github.com/llvm/llvm-project/commit/14c7754a35da9bf6b346e2a6ce4b3d8c3b00b434.diff

LOG: [flang] Skip `D` when including D debug line

When including debug lines as code, the `D` should be considered as
a white space. Currently an error was raised about bad labels because
it the `D` remained a `D` when considering the source line as code.

Differential Revision: https://reviews.llvm.org/D122711

Added: 
    

Modified: 
    flang/lib/Parser/prescan.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Parser/prescan.cpp b/flang/lib/Parser/prescan.cpp
index b4b8a17341f7d..17fc090c8c9c0 100644
--- a/flang/lib/Parser/prescan.cpp
+++ b/flang/lib/Parser/prescan.cpp
@@ -144,6 +144,10 @@ void Prescanner::Statement() {
   case LineClassification::Kind::Source:
     BeginStatementAndAdvance();
     if (inFixedForm_) {
+      if (features_.IsEnabled(LanguageFeature::OldDebugLines) &&
+          (*at_ == 'D' || *at_ == 'd')) {
+        NextChar();
+      }
       LabelField(tokens);
     } else if (skipLeadingAmpersand_) {
       skipLeadingAmpersand_ = false;


        


More information about the flang-commits mailing list