<div dir="ltr">Looking at the existing users of the new pass manager may be useful. See BackendUtil.cpp for how Clang sets up the new pass manager, and NewPMDriver.cpp for how opt sets it up.<div><br></div><div>There should be no need to initialize individual passes, although you can inject your own analyses (e.g. alias analysis).</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 3, 2020 at 9:21 AM Ejjeh, Adel via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div lang="EN-US" style="overflow-wrap: break-word;">
<div class="gmail-m_3557215511021373046WordSection1">
<p class="MsoNormal">Hello<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I am writing a tool within an external project, and I need to use an instance of the new pass manager to invoke LLVM analyses. It used to be possible to create an initialized instance of the legacy::FunctionPassManager by providing the
Module to the constructor. I was unable to find a corresponding way to initialize an instance of the new FunctionAnalysisManager. When I tried to construct an instance of FunctionAnalysisManager and use it, none of the passes were registered and I found myself
having to register every single LLVM pass, even if it is not directly invoked by my tool (which is not feasible). What is the correct way to do this?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks<u></u><u></u></p>
<p class="MsoNormal">-Adel Ejjeh<u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">-- <u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:14pt;font-family:"Lucida Handwriting";color:rgb(31,56,100)">Adel Ejjeh</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:black">PhD Candidate | Computer Science</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:black">University of Illinois at Urbana Champaign</span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:black">Email: <a href="mailto:aejjeh@illinois.edu" title="mailto:aejjeh@illinois.edu" target="_blank"><span style="color:rgb(5,99,193)">aejjeh@illinois.edu</span></a> | <a href="mailto:adel.ejjeh@gmail.com" target="_blank"><span style="color:rgb(5,99,193)">adel.ejjeh@gmail.com</span></a></span><span style="color:black"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:9pt;color:black">Zoom: <a href="https://illinois.zoom.us/my/aejjeh" title="https://illinois.zoom.us/my/aejjeh" target="_blank"><span style="color:rgb(5,99,193)">https://illinois.zoom.us/my/aejjeh</span></a></span><u></u><u></u></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>