This patch is a part of an attempt to obtain more timer data from the analyzer. In this patch, we try to use LLVM::TimeRecord to save time before starting the analysis and to print the time that a specific function takes while getting analyzed.
The timer data is printed along with the -analyzer-display-progress outputs.
ANALYZE (Syntax): test.c functionName : 0.4 ms ANALYZE (Path, Inline_Regular): test.c functionName : 2.6 ms
I don't think this problem requires "global mutable state"(tm). What prevents you from doing it with just local variables? I.e., something like: