[cfe-dev] Integrating a pass as a clang option

Min-Yih Hsu via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 7 09:01:34 PDT 2021


Hi,

I wrote a small tutorial about this very topic: https://medium.com/@mshockwave/writing-llvm-pass-in-2018-part-iv-d69dac57171d <https://medium.com/@mshockwave/writing-llvm-pass-in-2018-part-iv-d69dac57171d> 
Details might differ from ToT codebase but I think the workflow hasn’t changed since then.
Hope this helps.

-Min

> On Oct 7, 2021, at 7:44 AM, Jose Luis Vázquez via cfe-dev <cfe-dev at lists.llvm.org> wrote:
> 
> Good afternoon
> 
> I've developed a pass that I want to run directly from a clang invocation by setting an option in the command line. The pass has been ran through opt and tested for correctness. I've defined the option and the driver can parse it but I haven't been able to trigger the execution of the pass by the pass manager. Is there any particular structure I need to follow to convert the flag I added in include/clang/Driver/Options.td into an option parsed by the frontend?
> 
> Kindest regards
> 
> Jose Luis
> 
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211007/d5ac9b72/attachment.html>


More information about the cfe-dev mailing list