A high-level comment: does this pass achieve something not doable with XRay, a mature instrumentation framework in LLVM?
%T in lit is deprecated.
We generally avoid grep in tests. Just use FileCheck.
This is dangerous. %T refers to the parent directory. You may accidentally delete files in a sibling testing process.
No trailing empty line
All of this can be implemented as a runtime plugged into the XRay framework. If you just want to see which functions have been called (or executed) in this documentation I have an example of how to do precisely what this is attempting to do:
That implementation works for basic and FDR modes.
Thanks for the link.
The code size overhead of this instrumentation is 12bytes per function(adrp+strb+1byte in global array) + 13bytes per module. how does this compare to xray instrumentation?