[flang-commits] [flang] [Flang][OpenMP] Fix compilation error when a line with Fixed Source Form Conditional Compilation Sentinels is a continuation line (PR #70309)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Mon Oct 30 08:17:58 PDT 2023
================
@@ -997,20 +997,27 @@ const char *Prescanner::FixedFormContinuationLine(bool mightNeedSpace) {
}
tabInCurrentLine_ = false;
char col1{*nextLine_};
- if (InCompilerDirective()) {
- // Must be a continued compiler directive.
- if (!IsFixedFormCommentChar(col1)) {
- return nullptr;
- }
+ if (InCompilerDirective() ||
+ (features_.IsEnabled(LanguageFeature::OpenMP) &&
+ IsFixedFormCommentChar(col1) && nextLine_[1] == '$')) {
int j{1};
- for (; j < 5; ++j) {
- char ch{directiveSentinel_[j - 1]};
- if (ch == '\0') {
- break;
- }
- if (ch != ToLowerCaseLetter(nextLine_[j])) {
+ if (InCompilerDirective()) {
----------------
klausler wrote:
Restructure this `if` statement nest as `if (InCompilerDirective()) { ... } else if (features_.InEnabled(...)) { }`. It's needlessly confusing now as it stands.
https://github.com/llvm/llvm-project/pull/70309
More information about the flang-commits
mailing list