I am writing a new pass hello and the shared library is created(.so). The library is loaded with opt. But the pass in not available in opt. opt -help shows the command. Please find the screenshot attached. Thanks, Vidya Sagar. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121029/6c34fb72/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: LLVM_PASS.odt Type: application/octet-stream Size: 258637 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121029/6c34fb72/attachment.obj>
opt -load ${shared_lib_name} -hello < input.bc > output.bc You should first translate 1.c to bitcode before your are going to use it as the input of the opt. Try: clang -emit-llvm -c input.c -o input.bc Sincerely, Logan On Mon, Oct 29, 2012 at 7:00 PM, sagar visa <f2001098 at yahoo.co.in> wrote:> I am writing a new pass hello and the shared library is created(.so). The > library is loaded with opt. But the pass in not available in opt. opt > -help shows the command. > > Please find the screenshot attached. > > Thanks, > Vidya Sagar. > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121030/220f3f2f/attachment.html>
I agree with Logan. The pass need an input file .bc not a file .c. You can see more infromation frome the page:http://llvm.org/docs/WritingAnLLVMPass.html Thanks. Shining -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121030/21addb88/attachment.html>
On 29/10/12 19:43, Logan Chien wrote:> opt -load ${shared_lib_name} -hello < input.bc > output.bc > > You should first translate 1.c to bitcode before your are going > to use it as the input of the opt. Try:Maybe Vidya actually wants to write a clang plugin and is confusing that with an LLVM plugin? Ciao, Duncan.