<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    On 11/10/11 11:06 AM, Ryan Taylor wrote:
    <blockquote
cite="mid:CABgVvXtXKy=QjUduEYPtwqxULQybPOKSanx9Q6z8zM-3Cuc2GQ@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      LLVMers,<br>
      <br>
         I am doing a CallGraphPass but would like to get the LoopInfo
      of the functions inside this pass, is this possible? Currently I
      have a function inside the CallGraph struct:<br>
      <br>
          void getAnalysisUsage(AnalysisUsage &AU) const {<br>
              AU.addRequired<LoopInfo>();<br>
              AU.addPreserved<LoopInfo>();<br>
          }<br>
      <br>
      And later inside the pass I am calling:<br>
      <br>
      LoopInfo &LI = getAnalysis<LoopInfo>();<br>
      <br>
      I have also tried to pass the Function pointer to getAnalysis but
      that doesn't work either. With the above code my error is:<br>
    </blockquote>
    <br>
    1) You may need to pass a Function pointer or reference if your pass
    is not a FunctionPass (e.g., if it is a ModulePass).<br>
    <br>
    2) If you have to specify a Function pointer or reference, you need
    to make sure that the Function is *not* a declaration:<br>
    <br>
    if (!(F->getDeclaration()))<br>
        getAnalysis<LoopInfo>(F);<br>
    <br>
    -- John T.<br>
    <br>
    <blockquote
cite="mid:CABgVvXtXKy=QjUduEYPtwqxULQybPOKSanx9Q6z8zM-3Cuc2GQ@mail.gmail.com"
      type="cite">
      <br>
      UNREACHABLE executed!<br>
      0  opt             0x00000000008edc2f<br>
      1  opt             0x00000000008edfda<br>
      2  libpthread.so.0 0x00007f9c8e69bc60<br>
      3  libc.so.6       0x00007f9c8d986d05 gsignal + 53<br>
      4  libc.so.6       0x00007f9c8d98aab6 abort + 390<br>
      5  opt             0x00000000008da974
      llvm::llvm_unreachable_internal(char const*, char const*, unsigned
      int) + 356<br>
      6  opt             0x000000000087e046<br>
      7  opt             0x0000000000882b45
      llvm::PMDataManager::add(llvm::Pass*, bool) + 741<br>
      8  opt             0x000000000087f413
      llvm::PassManager::add(llvm::Pass*) + 259<br>
      9  opt             0x00000000004ab9be main + 2174<br>
      10 libc.so.6       0x00007f9c8d971eff __libc_start_main + 255<br>
      11 opt             0x000000000049f5f9<br>
      Stack dump:<br>
      <br>
      <br>
      Any help would be appreciated, thanks!<br>
      <br>
      <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>