<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 3/17/16 9:04 AM,
      <a class="moz-txt-link-abbreviated" href="mailto:marwayusuf@feng.bu.edu.eg">marwayusuf@feng.bu.edu.eg</a> wrote:<br>
    </div>
    <blockquote
cite="mid:AM3PR01MB1105EF3B43B5ACBC3A7B4D1EBB8B0@AM3PR01MB1105.eurprd01.prod.exchangelabs.com"
      type="cite">
      <meta http-equiv="Context-Type" content="text/html;
        charset=iso-8859-1">
      <div id="divtagdefaultwrapper">
        <p>I've compiled high level to IR and I want to get the original
          source code (Not to generate high level code) of a given IR
          function or part of function like a loop for example.</p>
      </div>
    </blockquote>
    <br>
    From what I understand, this is probably pretty difficult.  I have a
    student (Ethan) who needs to use LLVM IR analysis information from a
    MachineFunctionPass, and that is proving to be problematic as the
    code generator will insert new instructions not visible at the LLVM
    IR level.  I suspect that, at best, you can locate the basic block
    that corresponds to the code you are analyzing, but you will
    probably need to use debug information after that to get anything
    more accurate.<br>
    <br>
    As an FYI, I've suggested a GSoC project to encode high-level
    analysis information (e.g, call graph, points-to results) into the
    MachineInstr IR during code generation.  If that would be useful to
    others, I'd like to know.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
cite="mid:AM3PR01MB1105EF3B43B5ACBC3A7B4D1EBB8B0@AM3PR01MB1105.eurprd01.prod.exchangelabs.com"
      type="cite">
      <div id="divtagdefaultwrapper">
        <p><br>
        </p>
        <div id="Signature">
          <div id="divtagdefaultwrapper">
            <div class="BodyFragment"><span>
                <div class="PlainText">Regards,<br>
                  Marwa Yusuf<br>
                  Teaching Assistant - Computer Engineering Department<br>
                  Faculty of Engineering - Benha University<br>
                  E-JUST PhD Student<br>
                  Computer Science & Engineering Dept.</div>
              </span></div>
          </div>
        </div>
        <br>
        <br>
        <div>
          <hr tabindex="-1">
          <div id="divRplyFwdMsg" dir="ltr"><b>From:</b> John Criswell
            <a class="moz-txt-link-rfc2396E" href="mailto:jtcriswel@gmail.com"><jtcriswel@gmail.com></a><br>
            <b>Sent:</b> Wednesday, March 16, 2016 4:00 PM<br>
            <b>To:</b> <a class="moz-txt-link-abbreviated" href="mailto:marwayusuf@feng.bu.edu.eg">marwayusuf@feng.bu.edu.eg</a>;
            <a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a><br>
            <b>Subject:</b> Re: [llvm-dev] Getting the original
            high-level code
            <div> </div>
          </div>
          <div>
            <div class="moz-cite-prefix">On 3/15/16 9:22 AM, <a
                moz-do-not-send="true" class="moz-txt-link-abbreviated"
                href="mailto:marwayusuf@feng.bu.edu.eg">
                <a class="moz-txt-link-abbreviated" href="mailto:marwayusuf@feng.bu.edu.eg">marwayusuf@feng.bu.edu.eg</a></a> via llvm-dev wrote:<br>
            </div>
            <blockquote type="cite">
              <meta content="text/html; charset=iso-8859-1">
              <div id="divtagdefaultwrapper">
                <p>Dear All</p>
                <p>Is there is a way I can get the original hogh level
                  code (e.g c++ code) of an IR function within MCJIT?</p>
              </div>
            </blockquote>
            <br>
            You might want to specify the context.  Are you compiling
            high level code to LLVM IR to MachineInstr to MC and then
            wanting to map an MC instruction back to a source level
            instruction?  Or are you disassembling a binary program to
            the MC IR and then wanting to reconstruct the source code?<br>
            <br>
            The answer to your question depends on which of these you
            are trying to do.<br>
            <br>
            Regards,<br>
            <br>
            John Criswell<br>
            <br>
            <blockquote type="cite">
              <div id="divtagdefaultwrapper">
                <p><br>
                </p>
                <div id="Signature">
                  <div id="divtagdefaultwrapper">
                    <div class="BodyFragment"><span>
                        <div class="PlainText">Regards,<br>
                          Marwa Yusuf<br>
                          Teaching Assistant - Computer Engineering
                          Department<br>
                          Faculty of Engineering - Benha University<br>
                          E-JUST PhD Student<br>
                          Computer Science & Engineering Dept.</div>
                      </span></div>
                  </div>
                </div>
              </div>
              <br>
              <fieldset class="mimeAttachmentHeader"></fieldset>
              <br>
              <pre>_______________________________________________
LLVM Developers mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
            </blockquote>
            <br>
            <br>
            <pre class="moz-signature" cols="72">-- 
John Criswell
Assistant Professor
Department of Computer Science, University of Rochester
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://www.cs.rochester.edu/u/criswell">http://www.cs.rochester.edu/u/criswell</a></pre>
          </div>
        </div>
      </div>
    </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>