Stats added:
- NumCleanupLandingPadsUnreachable: how many cleanup landing pads were optimized as unreachable
- NumCleanupLandingPadsRemaining: how many cleanup landing pads remain
- NumNoUnwind: Number of functions with nounwind attribute
- NumUnwind: Number of functions with unwind attribute
DwarfEHPrepare is always run a single time as part of TargetPassConfig::addISelPasses() which makes it an ideal place near the end of the pipeline to record this information.
Example output from clang built with exceptions cumulative during thinLTO backend (NumCleanupLandingPadsUnreachable was not incremented):
"dwarfehprepare.NumCleanupLandingPadsRemaining": 123660,
"dwarfehprepare.NumNoUnwind": 323836,
"dwarfehprepare.NumUnwind": 472893,
The path leading to InsertUnwindResumeCalls is unconditional for all functions. So this is essentially a total function count. All stats have flat structure, so, 1) we don't add a total function count stats for each pass; 2) The description of each stats need to be informative about what a particular pass did, "Number of functions processed" is too general. If you want to compare against NumNoUnwind, perhaps you could add NunUnwind.