title: How do I get debug information from a function?
body: <p>I've used Clang to compile a function with debug information enabled. For <code>Instruction</code>s there's the handy <code>getDebugLoc()</code>, but there's no such thing for <code>Function</code>s. Given a <code>Function</code> instance, how can I get the debug information (I'm guessing in <code>DISubProgram</code> form) for it?</p>
  
  <p>I've seen <a href="http://llvm.org/docs/SourceLevelDebugging.html#subprogram-descriptors" rel="noreferrer">the guide entry explaining how that debug information is represented</a>, and the metadata does contain a link back to the function, but there's apparently no link back. Am I supposed to iterate over all the metadata in the module?</p>