This is an archive of the discontinued LLVM Phabricator instance.

[flang] Catch (and fix) attempts to create an invalid source range for a Scope
ClosedPublic

Authored by klausler on May 16 2023, 1:27 PM.

Details

Summary

When Scope::AddSourceRange() is called to extend the scope's source range to
include another snippet from a cooked character stream, add a check to ensure
that the new range is part of the same cooked character stream as the rest
of the scope.

And fix the bug that was causing such invalid source ranges to be created:
a submodule's Scope is a children of its parent's in the Scope tree, but
it may or may not be part of the same source file, and it is certainly
not enclosed in the parent's source range. So don't propagate Scope
source range expansion from a submodule to its parent.

Diff Detail

Event Timeline

klausler created this revision.May 16 2023, 1:27 PM
Herald added a project: Restricted Project. · View Herald Transcript
klausler requested review of this revision.May 16 2023, 1:27 PM
jeanPerier accepted this revision.May 17 2023, 4:21 AM

Looks good

This revision is now accepted and ready to land.May 17 2023, 4:21 AM
This revision was landed with ongoing or failed builds.May 17 2023, 6:21 AM
This revision was automatically updated to reflect the committed changes.