[IR] Delete llvm::Constants using the correct type.
authorEli Friedman <efriedma@quicinc.com>
Wed, 24 Jun 2020 22:54:21 +0000 (15:54 -0700)
committerEli Friedman <efriedma@quicinc.com>
Tue, 30 Jun 2020 19:37:53 +0000 (12:37 -0700)
commit15440191b57237eafb18600ac653b9a0023db391
tree56d33b57ff84da3653e156c67c8030a2512cd31f
parent1ccc49924aeb7bb5fbd2eb956243d16db3a02b08
[IR] Delete llvm::Constants using the correct type.

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.

Differential Revision: https://reviews.llvm.org/D82509
llvm/include/llvm/IR/Constant.h
llvm/include/llvm/IR/Constants.h
llvm/lib/Bitcode/Reader/ValueList.cpp
llvm/lib/IR/Constants.cpp
llvm/lib/IR/ConstantsContext.h
llvm/lib/IR/Value.cpp