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

Michael Kruse via cfe-dev cfe-dev at lists.llvm.org
Thu Oct 7 09:09:42 PDT 2021


There is a pass plugin infrastructure for such cases [1]. There is an
example Bye pass[2] and Polly using it in-tree to see how to use it.

[1] https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Passes/PassPlugin.h
[2] https://github.com/llvm/llvm-project/tree/main/llvm/examples/Bye

Michael


Am Do., 7. Okt. 2021 um 09:44 Uhr schrieb Jose Luis Vázquez via
cfe-dev <cfe-dev at lists.llvm.org>:
>
> 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


More information about the cfe-dev mailing list