<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 6/22/15 2:29 PM, Peter Finn wrote:<br>
    </div>
    <blockquote
      cite="mid:524D0131-4E8D-4997-886D-E300C86B48AF@icloud.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      I’ve been debugging SAFECode source code files, and line 170 in
      ArrayBoundCheckLocal.cpp has been causing the following
      compilation error:
      <div class=""><br class="">
      </div>
      <div class="">
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">In file included from
/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/ArrayBoundChecks/ArrayBoundCheckLocal.cpp:18:</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">In file included from
/Users/peterfinn/Desktop/build/projects/safecode/../../../llvm_trunk_2/projects/safecode/include/safecode/ArrayBoundsCheck.h:17:</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">In file included from
/Users/peterfinn/Desktop/build/projects/safecode/../../../llvm_trunk_2/projects/safecode/include/safecode/AllocatorInfo.h:21:</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">In file included from
          /Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/Module.h:20:</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">In file included from
          /Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/IR/DataLayout.h:27:</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">In file included from
          /Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/Pass.h:378:</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class=""><b class="">/Users/peterfinn/Desktop/llvm_trunk_2/include/llvm/PassAnalysisSupport.h:201:53:
          </b><span style="font-variant-ligatures: no-common-ligatures;
            color: #c33720" class=""><b class="">error: </b></span><b
            class="">no member named 'ID' in 'llvm::DataLayout'</b></div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">  return
          getAnalysisID<AnalysisType>(&AnalysisType::ID);</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;
          color: rgb(52, 189, 38);" class=""><b class="">               
                                  ~~~~~~~~~~~~~~^</b></div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class=""><b class="">/Users/peterfinn/Desktop/llvm_trunk_2/projects/safecode/lib/ArrayBoundChecks/ArrayBoundCheckLocal.cpp:170:9:
            note: </b>in instantiation of function template
          specialization</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">     
          'llvm::Pass::getAnalysis<llvm::DataLayout>' requested
          here</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">  TD = &getAnalysis<DataLayout>();</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;
          color: rgb(52, 189, 38);" class=""><b class="">        ^</b></div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">1 error generated.</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">make[2]: ***
          [/Users/peterfinn/Desktop/build/projects/safecode/lib/ArrayBoundChecks/Debug+Asserts/ArrayBoundCheckLocal.o]
          Error 1</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">make[1]: *** [ArrayBoundChecks/.makeall] Error 2</div>
        <div style="margin: 0px; font-size: 11px; font-family: Menlo;"
          class="">make: *** [all] Error 1</div>
      </div>
      <div class=""><br class="">
      </div>
      <div class="">I assume I need to obtain a DataLayout reference
        from the argument of the function “runOnFunction”.  Is this
        correct?  If so, how do I do this?  If not, what is supposed to
        be done instead?</div>
    </blockquote>
    <br>
    If you have a pointer to a Function object, you can get the Module
    in which the Function resides by calling the getParent() method of
    Function.  If F is a pointer to an llvm::Function, then<br>
    <br>
    F->getParent()<br>
    <br>
    ... should return a pointer (or reference; I'm not sure which) to
    the Function's containing module.<br>
    <br>
    Once you have the Module, you can get the DataLayout.<br>
    <br>
    Regards,<br>
    <br>
    John Criswell<br>
    <br>
    <blockquote
      cite="mid:524D0131-4E8D-4997-886D-E300C86B48AF@icloud.com"
      type="cite">
      <div class=""><br class="">
      </div>
      <div class="">Thanks,</div>
      <div class="">Peter Finn</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="https://urldefense.proofpoint.com/v2/url?u=http-3A__www.cs.rochester.edu_u_criswell&d=AwMD-g&c=8hUWFZcy2Z-Za5rBPlktOQ&r=Mfk2qtn1LTDThVkh6-oGglNfMADXfJdty4_bhmuhMHA&m=RX2VsepnsRpeviZdtI4AHZNkYk7hZp4avI5KZZhXttk&s=eUPRdR1rCx9Ui9iNQKxkju46lFOGfMenIVdaRaqW024&e=">http://www.cs.rochester.edu/u/criswell</a></pre>
  </body>
</html>