diff options
author | Peter Klausler <pklausler@nvidia.com> | 2025-05-12 12:16:05 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-05-12 12:16:05 -0700 |
commit | 58535e81dd982f5e5b64df39d2ab264027d6e8ca (patch) | |
tree | 25467f975d02476d9a166467484f3e38c1e3c0a3 /flang/lib/Parser/token-sequence.cpp | |
parent | 5b9bd8838842896b482fea20dce56906d42cc7b1 (diff) | |
download | llvm-58535e81dd982f5e5b64df39d2ab264027d6e8ca.zip llvm-58535e81dd982f5e5b64df39d2ab264027d6e8ca.tar.gz llvm-58535e81dd982f5e5b64df39d2ab264027d6e8ca.tar.bz2 |
[flang] Further refinement of OpenMP !$ lines in -E mode (#138956)
Address failing Fujitsu test suite cases that were broken by the patch
to defer the handling of !$ lines in -fopenmp vs. normal compilation to
actual compilation rather than processing them immediately in -E mode.
Tested on the samples in the bug report as well as all of the Fujitsu
tests that I could find that use !$ lines.
Fixes https://github.com/llvm/llvm-project/issues/136845.
Diffstat (limited to 'flang/lib/Parser/token-sequence.cpp')
-rw-r--r-- | flang/lib/Parser/token-sequence.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/flang/lib/Parser/token-sequence.cpp b/flang/lib/Parser/token-sequence.cpp index aee7693..40a074e 100644 --- a/flang/lib/Parser/token-sequence.cpp +++ b/flang/lib/Parser/token-sequence.cpp @@ -357,7 +357,7 @@ ProvenanceRange TokenSequence::GetProvenanceRange() const { const TokenSequence &TokenSequence::CheckBadFortranCharacters( Messages &messages, const Prescanner &prescanner, - bool allowAmpersand) const { + bool preprocessingOnly) const { std::size_t tokens{SizeInTokens()}; for (std::size_t j{0}; j < tokens; ++j) { CharBlock token{TokenAt(j)}; @@ -371,8 +371,10 @@ const TokenSequence &TokenSequence::CheckBadFortranCharacters( TokenAt(j + 1))) { // !dir$, &c. ++j; continue; + } else if (preprocessingOnly) { + continue; } - } else if (ch == '&' && allowAmpersand) { + } else if (ch == '&' && preprocessingOnly) { continue; } if (ch < ' ' || ch >= '\x7f') { |