[flang-commits] [flang] [flang] Ignore empty keyword macros before directives (PR #130333)
Andre Kuhlenschmidt via flang-commits
flang-commits at lists.llvm.org
Fri Mar 7 12:06:01 PST 2025
================
@@ -1463,18 +1485,18 @@ Prescanner::IsFixedFormCompilerDirectiveLine(const char *start) const {
*sp = '\0';
if (const char *ss{IsCompilerDirectiveSentinel(
sentinel, static_cast<std::size_t>(sp - sentinel))}) {
- std::size_t payloadOffset = p - start;
- return {LineClassification{
- LineClassification::Kind::CompilerDirective, payloadOffset, ss}};
+ return {
+ LineClassification{LineClassification::Kind::CompilerDirective, 0, ss}};
}
return std::nullopt;
}
std::optional<Prescanner::LineClassification>
Prescanner::IsFreeFormCompilerDirectiveLine(const char *start) const {
- if (const char *p{SkipWhiteSpace(start)}; p && *p++ == '!') {
+ if (const char *p{SkipWhiteSpaceIncludingEmptyMacros(start)};
+ p && *p++ == '!') {
if (auto maybePair{IsCompilerDirectiveSentinel(p)}) {
----------------
akuhlens wrote:
For my own edification, what is the significance of the pair returned from IsCompilerDirectiveSentinel? The beginning and end of the sentinel?
https://github.com/llvm/llvm-project/pull/130333
More information about the flang-commits
mailing list