This is an archive of the discontinued LLVM Phabricator instance.

[flang] Enable optional copy construction & assignment in the parse tree
AcceptedPublic

Authored by klausler on Jul 17 2023, 11:03 AM.

Details

Summary

The parse tree's several class definitions all currently go out
of their ways to ensure that they support only move constructors
and operator= (generated automatically via =default;). This was
by intent -- during construction of the backtracking parser combinators,
I did not want to worry about any risk of accidentally creating
expensive deep copies of partial parse trees.

However, copyable parse tree classes are a prerequisite for possible
implementations of possible future features, including inlining,
outlining, F'202Y template prototyping, and parameterized modules.

This patch makes it possible to enable copy construction and copy
assignment for parse tree classes. It's still off by default.

Diff Detail

Event Timeline

klausler created this revision.Jul 17 2023, 11:03 AM
klausler requested review of this revision.Jul 17 2023, 11:03 AM
vzakhari accepted this revision.Jul 17 2023, 1:24 PM

Looks good to me. Thank you!

This revision is now accepted and ready to land.Jul 17 2023, 1:24 PM
klausler updated this revision to Diff 546179.Aug 1 2023, 12:20 PM

Run the code through the most recent clang-format, maybe that will get it past the CI check.