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

When given the -output-file-map= option, the driver should check the map file exists (and other improvements)

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Compiler
    • Labels:

      Description

      This task tracks two TODOs left in swift/lib/Driver/Driver.cpp three years ago: "perform some preflight checks to ensure the [output map] file exists", and "emit [a] diagnostic with error string [explaining why the file could not be opened]".

      Other parts of this Driver.cpp file use the llvm::sys::fs::exists() function in order to check a file exists before the driver proceeds with execution. The same should be done here, so that the user can be notified of a missing file before the driver attempts to open and read on the next line.

      Further, assuming the file exists, but the driver is unable to open it on the next line for some reason, an error diagnostic with the reason why should be surfaced. swift/lib/Driver/OutputFileMap.cpp appears to use LLVM functions to open and read the file, and these functions return error objects/codes. Those errors should have a message associated with them, although I don't know the API to read that message off the top of my head.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              modocache Brian Ivan Gesiak
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: