This patch introduces a new feature that allows InstrBuilder to reuse mca::Instruction recycled from IncrementalSourceMgr. This significantly reduces the memory footprint.
Note that we're only recycling instructions that have static InstrDesc and no variadic operands.
This is patch 2/2 of MCA Daemon's upstreaming efforts.
I suggest to use a using for that type, and then use that new type definition in setOnInstFreedCallback (instead of using decltype).
Something like this: