This is an archive of the discontinued LLVM Phabricator instance.

IR: Call dropAllReferences from GlobalVariable's destructor.
ClosedPublic

Authored by pcc on Jun 7 2016, 5:09 PM.

Details

Summary

We were previously failing to do this and as a result failing to drop
attached metadata.

Not sure if there's a good way to test this. An in-progress patch exposed this
problem by allocating a GlobalVariable at the same address as a previously
allocated GlobalVariable.

Diff Detail

Event Timeline

pcc updated this revision to Diff 59977.Jun 7 2016, 5:09 PM
pcc retitled this revision from to IR: Call dropAllReferences from GlobalVariable's destructor..
pcc updated this object.
pcc added reviewers: dexonsmith, aprantl, mehdi_amini.
pcc added a subscriber: llvm-commits.
aprantl accepted this revision.Jun 7 2016, 5:12 PM
aprantl edited edge metadata.

Seems reasonable...
Is that only a problem in GlobalVariable or also in its base classes?

This revision is now accepted and ready to land.Jun 7 2016, 5:12 PM
pcc added a comment.Jun 7 2016, 5:19 PM

It's only a problem for classes that need to override dropAllReferences. Most classes are fine with the User::~User behaviour, which just clears operands using User::dropAllReferences.

This revision was automatically updated to reflect the committed changes.