Counting local variable declarations

Hi everyone,

I'm trying to modify Clang so that I can take an action if the the number of local variable declarations in a function exceeds some limit. I know I could just throw a counter into the Sema class and increment it when GetTypeForDeclarator sees the variable, but I'm thinking there's probably a better (built-in) way. Any suggestions? Thanks,