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

Jose Luis Vázquez via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 8 01:28:49 PDT 2021


Good morning,

Thank you for the quick response. That tutorial helped with finding most 
of the parts that I needed to modify in order to run my pass but it 
seems that code changes in the past couple of years cause the option 
parsing to ignore the added code generator option in the "Real" 
CompilerInvocation, and as a consequence the passes are never ran. In 
particular it seems to be related to the new codegen options definition 
file, so I want to be perfectly sure of properly adding what is needed.

Kindest regards,

Jose Luis

On 7/10/21 18:01, Min-Yih Hsu wrote:
> 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 <mailto: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 <mailto: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/20211008/ca0165ee/attachment.html>


More information about the cfe-dev mailing list