<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 7/29/11 10:00 AM, <a class="moz-txt-link-abbreviated" href="mailto:david.dewey@comcast.net">david.dewey@comcast.net</a> wrote:
    <blockquote
cite="mid:975478276.14098.1311951620906.JavaMail.root@sz0154a.westchester.pa.mail.comcast.net"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <style type="text/css">p { margin: 0; }</style>
      <div style="font-family: Arial; font-size: 12pt; color: rgb(0, 0,
        0);">
        <p>John,</p>
        <p> </p>
        <p>Thanks for the quick reply.  Using a PassManager object
          should work fine.  As you said, my only objection is to
          exec'ing opt.  </p>
        <p> </p>
        <p>I had actually tried instantiating a PassManager object
          before, but I was definitely not doing it right.  I will take
          a look at how clang and SAFECode use it, and see if I can get
          it working.</p>
      </div>
    </blockquote>
    <br>
    The SAFECode sc tool is based on opt, so you can just see what opt
    does.  Clang does something weird with the PassManager object (I
    think), so I recommend looking at opt or sc over clang.<br>
    <br>
    -- John T.<br>
    <br>
    <blockquote
cite="mid:975478276.14098.1311951620906.JavaMail.root@sz0154a.westchester.pa.mail.comcast.net"
      type="cite">
      <div style="font-family: Arial; font-size: 12pt; color: #000000">
        <p> </p>
        <p>Thanks,</p>
        <p> </p>
        <p>David</p>
        <p><br>
           </p>
        <p>
        </p>
        <hr id="zwchr">
        <p><b>From: </b>"John Criswell" <a class="moz-txt-link-rfc2396E" href="mailto:criswell@illinois.edu"><criswell@illinois.edu></a><br>
          <b>To: </b>"david dewey" <a class="moz-txt-link-rfc2396E" href="mailto:david.dewey@comcast.net"><david.dewey@comcast.net></a><br>
          <b>Cc: </b><a class="moz-txt-link-abbreviated" href="mailto:llvmdev@cs.uiuc.edu">llvmdev@cs.uiuc.edu</a><br>
          <b>Sent: </b>Friday, July 29, 2011 10:56:20 AM<br>
          <b>Subject: </b>Re: [LLVMdev] Accessing Dominator Tree<br>
          <br>
          On 7/29/11 9:43 AM, <a moz-do-not-send="true"
            class="moz-txt-link-abbreviated"
            href="mailto:david.dewey@comcast.net" target="_blank">david.dewey@comcast.net</a>
          wrote: </p>
        <blockquote
cite="mid:1034242797.13028.1311950602990.JavaMail.root@sz0154a.westchester.pa.mail.comcast.net">
          <style>p { margin: 0; }</style>
          <div style="FONT-FAMILY: Arial; COLOR: rgb(0,0,0); FONT-SIZE:
            12pt">
            <p>Hello,</p>
            <p> </p>
            <p>I am working on a project that requires me to perform
              some analysis on a bitcode file outside the existing LLVM
              analysis frameworks (opt, etc.).  In what I am doing, I
              need to be able to access the dominator tree for a given
              function.  Is there a way I can instantiate a
              DominatorTree object outside the existing analysis
              frameworks?</p>
          </div>
        </blockquote>
        <br>
        If you use a PassManager object to run passes, then you can
        simply have your analysis be an LLVM pass and use the standard
        getAnalysis<>() template function to get access to the
        dominator tree analysis.  Any program can create a PassManager
        to run LLVM passes to perform analysis and transformation; the
        clang C/C++ front-end and the sc tool in SAFECode do this.<br>
        <br>
        I don't know if using a PassManager is what you consider to be
        "outside the existing LLVM framework."  I'm hoping your only
        objection is to using the opt tool to run LLVM passes.<br>
        <br>
        -- John T.<br>
        <br>
        <blockquote
cite="mid:1034242797.13028.1311950602990.JavaMail.root@sz0154a.westchester.pa.mail.comcast.net">
          <div style="FONT-FAMILY: Arial; COLOR: #000000; FONT-SIZE:
            12pt">
            <p> </p>
            <p>I have tried several things all along the lines of:</p>
            <p> </p>
            <p>DominatorTree DT;</p>
            <p>DT.getBase().recalculate(F);</p>
            <p> </p>
            <p>Everything I have tried results in an assertion failure
              when trying to access the front() of what I assume is the
              DominatorTree:</p>
            <p> </p>
            <p>Assertion failed: !empty() && "Called front() on
              empty list!"</p>
            <p> </p>
            <p>If anyone has an example of how to do this, I would
              really appreciate it.</p>
            <p> </p>
            <p>Thanks,</p>
            <p> </p>
            <p>David<br>
            </p>
          </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:LLVMdev@cs.uiuc.edu" target="_blank">LLVMdev@cs.uiuc.edu</a>         <a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu/" target="_blank">http://llvm.cs.uiuc.edu</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
        </blockquote>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>