<div dir="ltr">Ok, got it, thank you!<br><br>- Stefanos</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Στις Παρ, 31 Ιουλ 2020 στις 5:59 μ.μ., ο/η Jonathan Smith <<a href="mailto:jvstech%2Bllvm@gmail.com">jvstech+llvm@gmail.com</a>> έγραψε:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Fri, Jul 31, 2020 at 9:45 AM Stefanos Baziotis via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I'm interested in the sort of pass where you write `-passes=print<pass-name>` and it calls the `print()` function of the pass.<br>
><br>
> I have seen some other passes that can invoke `-passes=print<>` but the implementation<br>
> seems to be in the wrapper pass for the old pass manager.<br>
><br>
> Thanks,<br>
> Stefanos Baziotis<br>
> _______________________________________________<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>
<br>
Printing passes in the new pass manager are no different from any<br>
other pass: the 'run()' function is called. Unlike the legacy pass<br>
manager, there is no 'print()' function to be called specifically by<br>
printing passes. You would implement all your printing logic in the<br>
run() function of your pass class. As an example, see<br>
<a href="https://www.youtube.com/watch?v=MagR2KY8MQI&t=44m40s" rel="noreferrer" target="_blank">https://www.youtube.com/watch?v=MagR2KY8MQI&t=44m40s</a> (full disclosure:<br>
this is my video). The "print<pass-name>" string in the --passes=...<br>
argument is simply a token registered in PassRegistry.def that maps<br>
that string to a particular pass -- in this case, a printing pass.<br>
<br>
Respectfully,<br>
Jon (jvstech)<br>
</blockquote></div>