title: How can I find all uses of a ValueDecl?
body: <p>I'd like to take clang AST, analyze how a certain variable is used and do some
  source-to-source transformation if a specific usage pattern is recognized.
  Particularly, I'm looking for patterns like this:</p>
  
  <pre><code>void *h;
  h = create_handler(...);
  use_handler(h);
  destroy_handler(h);
  </code></pre>
  
  <p>So far, I am able to detect <code>ValueDecl</code> corresponding to <code>void *h</code>. Next step
  would be to find all uses of <code>h</code> and see if they are safe and if
  <code>create_handler/destroy_handler</code> properly dominate/post-dominate one another.
  Unfortunately, I have no idea how to iterate over <code>h</code>'s uses, it seems that
  there is no such interface in <code>ValueDecl</code> class.</p>
  
  <p>I'd appreciate it if you could you either suggest how I could find all uses of a
  variable in AST, or point me to some clang-based tool dealing with a similar problem.</p>
  
  <p>Thank you!</p>