This is an archive of the discontinued LLVM Phabricator instance.

COFF: Support both /lldmap and /lldmap:<file>
ClosedPublic

Authored by hans on Dec 8 2016, 2:53 PM.

Details

Summary

The former option bases the filename on the output name, e.g. if the
link output is a.exe, the map will be written to a.exe. This the
behaviour of link.exe's /MAP option and is useful for creating a map
file of each executable when building a large project.

Diff Detail

Repository
rL LLVM

Event Timeline

hans updated this revision to Diff 80831.Dec 8 2016, 2:53 PM
hans retitled this revision from to COFF: Support both /lldmap and /lldmap:<file>.
hans updated this object.
hans added a reviewer: ruiu.
hans added a subscriber: llvm-commits.

Oh, and what do you think about just spelling the option /map, like for link.exe? Maybe the output format isn't exactly the same, but the functionality is.

ruiu edited edge metadata.Dec 8 2016, 3:10 PM

IIRC, the reason why I chose a different name than /map is because the output format is different. If some build system is using /map, it is likely that it reads a result file afterwards using a script, so I chose to fail early. In that sense, I think keeping the different name still makes sense.

COFF/Driver.cpp
775 ↗(On Diff #80831)

Pass Args and call getLastArg in getMapFile. Since Config is a global variable, you don't need to pass it to the function.

hans marked an inline comment as done.Dec 8 2016, 3:44 PM
In D27595#617733, @ruiu wrote:

IIRC, the reason why I chose a different name than /map is because the output format is different. If some build system is using /map, it is likely that it reads a result file afterwards using a script, so I chose to fail early. In that sense, I think keeping the different name still makes sense.

Sounds reasonable.

COFF/Driver.cpp
775 ↗(On Diff #80831)

Thanks! That's nicer.

hans updated this revision to Diff 80839.Dec 8 2016, 3:44 PM
hans edited edge metadata.
hans marked an inline comment as done.

Addressing comments.

ruiu accepted this revision.Dec 9 2016, 12:50 PM
ruiu edited edge metadata.

LGTM

This revision is now accepted and ready to land.Dec 9 2016, 12:50 PM
This revision was automatically updated to reflect the committed changes.