The Comprehensive Static Instrumentation (CSI) framework provides static instrumentation that a compiler inserts into a program-under-test so that dynamic-analysis tools -- memory checkers, race detectors, cache simulators, performance profilers, code-coverage analyzers, etc. -- can observe and investigate runtime behavior. Heretofore, tools based on compiler instrumentation would each separately modify the compiler to insert their own instrumentation. In contrast, CSI inserts a standard collection of instrumentation hooks into the program-under-test. Each CSI-tool is implemented as a library that defines relevant hooks, and the remaining hooks are "nulled'" out and elided during link-time optimization (LTO), resulting in instrumented runtimes on par with custom instrumentation. CSI allows many compiler-based tools to be written as simple libraries without modifying the compiler, greatly lowering the bar for developing dynamic-analysis tools.
This diff encompasses a skeleton compiler pass for CSI. For an extended usage doc, please see the docs/CSI.rst document submitted with the clang diff. We will be submitting further diffs that incrementally add functionality to CSI.
I would suggest a FIXME comment to make it clear that this is not finished and is an incremental step.