This is an archive of the discontinued LLVM Phabricator instance.

[IR] Delete llvm::Constants using the correct type.
ClosedPublic

Authored by efriedma on Jun 24 2020, 4:40 PM.

Details

Summary

In most cases, this doesn't have much impact: the destructors just call the base class destructor anyway. A few subclasses of ConstantExpr actually store non-trivial data, though. Make sure we clean up appropriately.

This is sort of ugly, but I don't see a good alternative given the constraints.

Issue found by asan buildbots running the testcase for D80330.

Diff Detail

Event Timeline

efriedma created this revision.Jun 24 2020, 4:40 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2020, 4:40 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
jdoerfert accepted this revision.Jun 29 2020, 5:45 PM

I guess this is mostly in line with the existing destruction code for values. What I want to say is, this is not pretty but seems reasonable and it fixes a problem. LGTM

This revision is now accepted and ready to land.Jun 29 2020, 5:45 PM
This revision was automatically updated to reflect the committed changes.