This is an archive of the discontinued LLVM Phabricator instance.

lld::COFF: better behavior when using as a library
ClosedPublic

Authored by ruiu on Oct 23 2017, 12:43 PM.
Tokens
"Like" token, awarded by andrewrk.

Details

Summary

Previously, the COFF driver would call exit(0) when called
as a library. Now it takes ExitEarly option, and if it
is false, it doesn't exit. So it is now more library-friendly.

Furthermore, link() calls freeArena() before returning, to
clean up resources.

Based on an Andrew Kelley's patch.

Event Timeline

ruiu created this revision.Oct 23 2017, 12:43 PM
andrewrk accepted this revision.Oct 23 2017, 12:53 PM
andrewrk awarded a token.
andrewrk added a subscriber: andrewrk.
andrewrk added inline comments.
lld/COFF/Driver.cpp
64

is this necessary?

This revision is now accepted and ready to land.Oct 23 2017, 12:54 PM
ruiu added inline comments.Oct 23 2017, 1:01 PM
lld/COFF/Driver.cpp
64

Yes, because we use it in Errors.cpp.

This revision was automatically updated to reflect the committed changes.