<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 7/29/11 9:43 AM, <a class="moz-txt-link-abbreviated" href="mailto:david.dewey@comcast.net">david.dewey@comcast.net</a> wrote:
    <blockquote
cite="mid:1034242797.13028.1311950602990.JavaMail.root@sz0154a.westchester.pa.mail.comcast.net"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <style type="text/css">p { margin: 0; }</style>
      <div style="font-family: Arial; font-size: 12pt; color: rgb(0, 0,
        0);">
        <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"
      type="cite">
      <div style="font-family: Arial; font-size: 12pt; color: #000000">
        <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 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>
  </body>
</html>