This is an archive of the discontinued LLVM Phabricator instance.

[ASAN] Add doFinalization to reset state
ClosedPublic

Authored by loladiro on Nov 24 2015, 11:06 AM.

Details

Summary

If the same pass manager is used for multiple modules ASAN complains about GlobalsMD being initialized twice. Fix this by resetting GlobalsMD in a new doFinalization method to allow this use case.

Diff Detail

Event Timeline

loladiro updated this revision to Diff 41066.Nov 24 2015, 11:06 AM
loladiro retitled this revision from to [ASAN] Add doFinalization to reset state.
loladiro updated this object.
loladiro added a reviewer: kcc.
loladiro set the repository for this revision to rL LLVM.
loladiro added a subscriber: llvm-commits.
kcc edited edge metadata.Nov 24 2015, 11:29 AM

Is a test possible for this fix?

The easiest thing would probably be to change llc to reuse the pass manager if multiple modules are passed on the command line. Then this could be tested quite easily from the command line. Will draw up an appropriate patch and see if people like it.

loladiro updated this revision to Diff 41966.Dec 4 2015, 5:32 PM
loladiro edited edge metadata.

Add test case

kcc accepted this revision.Dec 4 2015, 5:42 PM
kcc edited edge metadata.

LGTM,
but I would run this test on a non-empty test (with some small function in it), just in case.

This revision is now accepted and ready to land.Dec 4 2015, 5:42 PM
This revision was automatically updated to reflect the committed changes.