This is an archive of the discontinued LLVM Phabricator instance.

[SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`.
ClosedPublic

Authored by eduucaldas on Sep 21 2020, 10:06 AM.

Details

Summary

There can be Macros that are tagged with modifiable. Thus verifying canModifyAllDescendants is not sufficient to avoid macros when deep copying.

We think the TokenBuffer could inform us whether a Token comes from a macro. We'll look into that when we can surface this information easily, for instance in unit tests for ComputeReplacements.

Diff Detail

Event Timeline

eduucaldas created this revision.Sep 21 2020, 10:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 21 2020, 10:06 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
eduucaldas requested review of this revision.Sep 21 2020, 10:06 AM

Remove buggy deepCopy

eduucaldas retitled this revision from [SyntaxTree][Synthesis] Implement `deepCopyExpandingMacros` to [SyntaxTree][Synthesis] Fix: `deepCopy` -> `deepCopyExpandingMacros`..
eduucaldas edited the summary of this revision. (Show Details)
gribozavr2 accepted this revision.Sep 22 2020, 1:30 AM
This revision is now accepted and ready to land.Sep 22 2020, 1:30 AM