<div dir="ltr">Hi Benno,<br><br>Thanks for your response! Unfortunately, I don't think the -<font face="monospace">mllvm</font> flag is doing what I need. <br><br>Specifically, I am adding to the <font face="monospace">LowerTypeTests</font> optimization pass in LLVM. When I invoke this pass with <font face="monospace">opt</font>, there is a command line option called "<font face="monospace">lowertypetests-read-summary</font>", which allows me to specify a file name. I've added a similar option, that takes a filename as input and opens that file to obtain some information necessary to do the pass. <br><br>It looks like <font face="monospace">-lowertypetests</font> is not a pass that -<font face="monospace">mllvm</font> recognizes, so I'm not able to input arguments to this pass using -<font face="monospace">mllvm</font>. In fact, it doesn't seem like <i>any</i> of the passes that -<font face="monospace">mllvm</font> recognizes can be invoked with <font face="monospace">opt</font>. Do you know if there's some code I can modify that will allow -<font face="monospace">mllvm</font> to recognize this pass? Or is there a better way to get <font face="monospace">clang</font> to send the filename input to my pass? Thanks so much for your help!<br><br>Best, <br>Shishir Jessu<br><br><br></div><img src="https://my-email-signature.link/signature.gif?u=452460&e=90052845&v=4a42548bc679da435d970f792b219a2ad2fb26095cbb7f218382c650af4ffd5c" style="width:2px;max-height:0;overflow:hidden"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Mar 17, 2020 at 2:48 AM Benno Krauss <<a href="mailto:benno.krauss@wibu.com">benno.krauss@wibu.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hello Shishir,<br>
<br>
To pass arguments to LLVM from clang, use something like `clang source.c -mllvm -customarg -mllvm argvalue`. The -mllvm argument tells clang to forward the following argument to LLVM. Similarly, there is the -Xclang argument to pass the following argument to clang proper, as opposed to the clang driver.<br>
<br>
Cheers,<br>
Benno<br>
<br>
Am 16.03.2020 um 23:45 schrieb Shishir V Jessu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><mailto:<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>>:<br>
<br>
Hello,<br>
<br>
I am adding to an LLVM pass that requires a filename as input. I am able to input this filename as a command line argument when I invoke this pass using opt, but I ultimately need to pass this argument to my code when I compile code with clang.<br>
<br>
How can I pass this argument to clang so that I can use it in my LLVM pass? Thanks for your help!<br>
<br>
Best,<br>
Shishir Jessu<br>
[<a href="https://my-email-signature.link/signature.gif?u=452460&e=89920299&v=06d9a9b1e5d7f6685284ae9f5a944df07b26d3dc9391d3cecc31b2e77d4f5d20" rel="noreferrer" target="_blank">https://my-email-signature.link/signature.gif?u=452460&e=89920299&v=06d9a9b1e5d7f6685284ae9f5a944df07b26d3dc9391d3cecc31b2e77d4f5d20</a>] _______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><mailto:<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>
</blockquote></div>