<div dir="ltr"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I've got some out-of-source passes which were written before the new PassManager was a thing.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">I'm trying to get them to build and run properly, with a minimum of effort.  I'm willing to use the Legacy PassManager only, even if that's a crutch that will eventually go away.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Unfortunately I'm hitting some speed-bumps:</div><div class="gmail_default"><ul><li><font face="arial, helvetica, sans-serif">I can't find any documentation giving an overview of how the new PassManager is supposed to be used.  </font><a href="http://llvm.org/docs/WritingAnLLVMPass.html" style="font-family:arial,helvetica,sans-serif">This tutorial</a><span style="font-family:arial,helvetica,sans-serif"> seems out of date.<br><br></span></li><li><span style="font-family:arial,helvetica,sans-serif">I've looked at how some other passes were ported to the new PassManager, for example: <a href="https://reviews.llvm.org/D24592">here</a>.  However, it's not really clear how closely they match my situation:</span></li><ul><li><span style="font-family:arial,helvetica,sans-serif">They're in-source, but my passes are out-of-source.<br><br></span></li><li><font face="arial, helvetica, sans-serif">They seem to cater to both the new and legacy PassManagers.  It's not clear if a Pass needs to interact with <i>both</i> of those pass managers if the only goal is to use the legacy one.<br><br></font></li><li><font face="arial, helvetica, sans-serif">I'm getting failed asserts from LLVM when using `AAResultsWrapperPass`, but I can't figure out what I'm doing wrong:</font></li></ul></ul></div><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default">Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"' failed.</div><div class="gmail_default"><br></div></blockquote></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><div class="gmail_default" style="font-family:arial,helvetica,sans-serif;display:inline">​(Bear in mind that this code worked fine with LLVM 3.7.  All of the old "AU.addRequired<...>()" calls are still there, although I've changed the AA-provider to "AAResultsWrapperPass".)</div></blockquote></blockquote><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><blockquote style="margin:0 0 0 40px;border:none;padding:0px"><br></blockquote></blockquote><div class="gmail_default"><div><font face="arial, helvetica, sans-serif">Can anyone suggest good sources of info for what I'm trying to do?</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">Cheers,</font></div><div><font face="arial, helvetica, sans-serif">Christian</font></div><div><font face="arial, helvetica, sans-serif"><br></font></div></div></div>