IR: Store MDNodes in a separate LeakDetector container
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Dec 2014 21:39:39 +0000 (21:39 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Thu, 11 Dec 2014 21:39:39 +0000 (21:39 +0000)
commitda75f7277e3a129aed8ef8aa4e0d84de40b76fd4
treedb69c47b6b31d06b86ed16d8236654e7e9b5a776
parent5b17297b3d660bef87cc25a9a68adf1a7f6efa17
IR: Store MDNodes in a separate LeakDetector container

This gives us better leak detection messages, like `Value` has.

This also has the side effect of papering over a problem where
`MachineInstr`s are added as garbage to the leak detector and then
deleted without being removed.  If `MDNode::getTemporary()` allocates an
`MDNodeFwdDecl` in the same spot, the leak detector asserts.  By
separating `MDNode`s into their own container we lose that assertion.

Since `MachineInstr` is required to have a trivial destructor, its usage
of `LeakDetector` at all is pretty suspect.  I'll be sending a patch
soon to strip that out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224060 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/LeakDetector.h
lib/IR/LeakDetector.cpp
lib/IR/LeaksContext.h