Hi All, If I write my own Pass and in a C++ file, how can you invoke it? In both of them are Passes, we can use getAnalysis<>(). I can't use use getAnalysis<>(), b/c it will throw assertion like "Unable to find on the fly pass " or "pass xx by yy can't be required". Any help is appreciated. Best, Yuxi -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160710/7ea5e2ca/attachment.html>
John Criswell via llvm-dev
2016-Jul-10 20:02 UTC
[llvm-dev] C++ program using your own pass
On 7/10/16 2:20 PM, Yuxi Chen via llvm-dev wrote:> Hi All, > > If I write my own Pass and in a C++ file, how can you invoke it? > In both of them are Passes, we can use getAnalysis<>(). > I can't use use getAnalysis<>(), b/c it will throw assertion like > "Unable to find on the fly pass " or "pass xx by yy can't be required". > > Any help is appreciated.You need to create a PassManager object and use its add() method to schedule the passes that you want to run. Take a look at the opt program in llvm/tools/opt for an example. Regards, John Criswell> > Best, > Yuxi > > > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- John Criswell Assistant Professor Department of Computer Science, University of Rochester http://www.cs.rochester.edu/u/criswell -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160710/e5599c87/attachment.html>