<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 11/14/14, 6:53 AM, Qingan Li wrote:<br>
    </div>
    <blockquote
cite="mid:CAN5dsDFVD18cjeabJcWp3-39NVR73TBuqf9cXJvP+z+U4DtEYg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div>Hi,</div>
        <div><br>
        </div>
        <div>Recently, I am working on some information collection on
          the machine instruction (MachineInstr) level.</div>
        <div>But, sometimes, I need check the corresponding IR level
          instruction of the a machine instruction.</div>
        <div><br>
        </div>
        <div>When visiting a machine instruction which is a call
          (MachineInstr::isCall()), I need to check the arguments of
          this call site.</div>
        <div>I know that the CallSite class provides good facility for
          this work, but the CallSite can be constructed only
          fromInstruction rather than MachineInstr.</div>
        <div><br>
        </div>
        <div>Is there any workaround? <br>
        </div>
      </div>
    </blockquote>
    <br>
    If you're working on MachineInstr's, then you can probably examine
    the MachineIntr's operands to determine which function is being
    called.  This probably won't be target independent, but if you're
    working at the MachineInstr level, you're not doing target
    independent work, anyway.<br>
    <br>
    Alternatively, you should check to see if the MachineBasicBlock has
    a method to fetch the BasicBlock from which it was generated.  Using
    that, you could potentially scan the BasicBlock looking for a
    CallInst or InvokeInst that is likely to match the MachineInstr.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:CAN5dsDFVD18cjeabJcWp3-39NVR73TBuqf9cXJvP+z+U4DtEYg@mail.gmail.com"
      type="cite">
      <div dir="ltr">
        <div><br>
        </div>
        <div>Thanks.</div>
        <div><br>
        </div>
        -- <br>
        <div class="gmail_signature">Best regards,
          <div><br>
          </div>
          <div>Li Qingan</div>
        </div>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>