This is an archive of the discontinued LLVM Phabricator instance.

Fix the order of destructors in LibLTOCodeGenerator
ClosedPublic

Authored by steven_wu on Dec 8 2015, 1:32 PM.

Details

Summary

The order of destructors in LTOCodeGenerator gets changed in r254696.
It is possible for LTOCodeGenerator to have a MergedModule created in
the OwnedContext, in which case the module must be destructed before
the context.

Diff Detail

Event Timeline

steven_wu updated this revision to Diff 42212.Dec 8 2015, 1:32 PM
steven_wu retitled this revision from to Fix the order of destructors in LibLTOCodeGenerator.
steven_wu updated this object.
steven_wu added reviewers: rafael, dexonsmith.
steven_wu added a subscriber: llvm-commits.
rafael accepted this revision.Dec 8 2015, 6:31 PM
rafael edited edge metadata.

Needs a git-clang-format.

You should be able to write an unit test that calls lto_module_create_in_codegen_context. I would be very happy if you did, but I understand if you think it is not worth it.

This revision is now accepted and ready to land.Dec 8 2015, 6:31 PM
This revision was automatically updated to reflect the committed changes.

Thanks Rafael for reviewing the change! I couldn't find a clean way to link against libLTO for testing in llvm repo. This might need to be fixed. I have some internal ld64 test case covering this for now.

Steven