This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Refactor computation of extracted expr in ExtractVariable tweak. NFC
ClosedPublic

Authored by sammccall on Jul 26 2019, 6:45 AM.

Details

Summary

This takes this logic out of the Tweak class, and simplifies the signature of
the function where the main logic is.

The goal is to make it easier to turn into a loop like:

for (current = N; current and current->parent are both expr; current = current->parent)
  if (suitable(current))
    return current;
return null;

Event Timeline

sammccall created this revision.Jul 26 2019, 6:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 26 2019, 6:45 AM
SureYeaah accepted this revision.Jul 26 2019, 7:13 AM
This revision is now accepted and ready to land.Jul 26 2019, 7:13 AM
This revision was automatically updated to reflect the committed changes.