<div><div dir="auto">Clang doesn’t support adding passes from the command line the way opt does. Opt has special parsing in opt.cpp for this that clang doesn’t have.</div><div dir="auto"><br></div><div dir="auto">I’m not sure what the correct way to do this is. I think your plugin needs to do something to tell clang/llvm when to run the pass. I’ll try to look later when I’m back at a computer.</div><br><div class="gmail_quote"><div>On Fri, Jan 12, 2018 at 7:00 PM 陳韋任 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif">Do you pull clang under llvm/tools and compile it as well? In theory, if `opt` recognize the option, so does `clang -mllvm`.</div><div class="gmail_default" style="font-family:arial,helvetica,sans-serif"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2018-01-12 8:47 GMT+08:00 sangeeta chowdhary <span><<a href="mailto:sangitachowdhary@gmail.com" target="_blank">sangitachowdhary@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><font face="Times" style="font-size:14px">Hello,</font></div><div><font face="Times" style="font-size:14px"><br></font></div><font face="Times" style="font-size:14px">I have tried giving this option like this</font><div><font face="Times" style="font-size:14px"><br></font></div><div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><span style="font-variant-ligatures:no-common-ligatures;font-size:14px"><font face="Times">clang -c -emit-llvm -mllvm -rdetector hello.c -c -o hello.bc</font></span></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><font face="Times" style="font-size:14px"><span style="font-variant-ligatures:no-common-ligatures">but I am getting error "</span> Unknown command line argument '-rdetector’.”</font></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><font face="Times" style="font-size:14px"><br></font></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><font face="Times" style="font-size:14px">Although same option work with opt -</font></div><div style="margin:0px;font-stretch:normal;line-height:normal;background-color:rgb(255,255,255)"><div style="margin:0px;font-stretch:normal;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures;font-size:14px"><font face="Times">opt -rdetector hello.ll </font></span></div><div><span style="font-variant-ligatures:no-common-ligatures"><br></span></div></div></div></div></blockquote></div></div><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div><div><div class="m_-8763387240049979224h5"><div style="margin:0px;font-stretch:normal;font-size:18px;line-height:normal;font-family:Menlo;background-color:rgb(255,255,255)"><br></div><div><br><blockquote type="cite"><div>On Jan 11, 2018, at 6:41 PM, sangeeta chowdhary <<a href="mailto:sangitachowdhary@gmail.com" target="_blank">sangitachowdhary@gmail.com</a>> wrote:</div><br class="m_-8763387240049979224m_-5292553007911824756Apple-interchange-newline"><div><div style="word-wrap:break-word;line-break:after-white-space">Can you please tell me when I need to give this option and how. I am sorry I am new to this. Thank you so much for responding.<br><div><br><blockquote type="cite"><div>On Jan 11, 2018, at 6:28 PM, 陳韋任 <<a href="mailto:chenwj.cs97g@g2.nctu.edu.tw" target="_blank">chenwj.cs97g@g2.nctu.edu.tw</a>> wrote:</div><br class="m_-8763387240049979224m_-5292553007911824756Apple-interchange-newline"><div><span style="font-family:arial,helvetica,sans-serif;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">-mllvm</span></div></blockquote></div><br></div></div></blockquote></div><br></div></div></div></div></blockquote></div></div><div class="gmail_extra"><div><br></div>-- <br><div class="m_-8763387240049979224gmail_signature" data-smartmail="gmail_signature"><div><div>Wei-Ren Chen (陳韋任)<br>Homepage: <a href="https://people.cs.nctu.edu.tw/~chenwj" target="_blank">https://people.cs.nctu.edu.tw/~chenwj</a></div></div></div>
</div>
_______________________________________________<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div></div><div dir="ltr">-- <br></div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div>