title: Extracting names in LLVM IR
body: <p>I'm currently writing passes using LLVM and I have a few questions regarding variable/parameter/argument names.</p>
  
  <ol>
  <li><p>Say I have this struct:</p>
  
  <pre><code>struct Kid {
      char name[30];
      int age;
      char hobby[30];
  };
  </code></pre></li>
  </ol>
  
  <p>I'm running a module pass and found <code>Kid</code>'s corresponding <code>StructType</code> in the module. I would like to use the names of <code>Kid</code>'s members but I don't know how to access them. I tried using an <code>element_iterator</code> but it only returns the members as <code>Type</code>. How can I access the names of a struct's data member?</p>
  
  <p>EDIT: The purpose of this is so I can be able to determine whether the member of type 'char' I'm currently dealing with is 'name' or 'hobby', so I can perform a different action in each case. Something like:</p>
  
  <pre><code>    case "name" do something;
      case "hobby" do something else;
  </code></pre>
  
  <p>Is there another way to differentiate between to members of the same type?</p>
  
  <ol start="2">
  <li>Say I have a function <code>foo(int a, int b)</code>.
  How can I get the names of a function's parameters?
  I tried running an <code>arg_iterator</code> on a call to <code>foo</code> to find the 
  arguments but when I call <code>getName()</code> on an argument it returns an empty <code>StringRef</code>.</li>
  </ol>
  
  <p>Will appreciate any help.</p>