Uploaded image for project: 'Swift'
  1. Swift
  2. SR-14587

`refactor-check-compiles` should generate both `-dump-text` and `dump-rewritten` from a single `swift-refactor` invocation

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: None
    • Labels:

      Description

      At the moment refactor-check-compiles invokes swift-refactor twice, once to generate the output for -dump-text and once to generate the output for -dump-rewritten. This is duplicated effort. We should instead add an option to swift-refactor that outputs -dump-text to stdout and the contents of -dump-rewritten to a file. That way we could be generating both representations at the same time.

      If anyone wants to tackle this as a starter bug:

      • You would need to add a new flag like -rewritten-output-file in swift-refactor.cpp that dumps the rewritten text to the specified output file, just like the DumpType::REWRITTEN case does today here
      • Afterwards, you’d need to update refactory-check-compiles.py to use that new argument to swift-refactor to retrieve the rewritten code together with the invocation that has -dump-rewritten, getting rid of the path that calls -dump-text and writes its stdout to the temp file.

        Attachments

          Activity

            People

            Assignee:
            jiaren wang jiaren wang
            Reporter:
            ahoppen Alex Hoppen
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: