<div dir="ltr">sorry, the network has something wrong.<div><span style="color:rgb(0,0,0);font-size:14px">the error as follows:</span><br></div><div><span style="color:rgb(0,0,0);font-size:14px"><img src="cid:ii_150bc3aae758d22b" alt="内嵌图片 1"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">2015-10-31 12:47 GMT+08:00 Q Z <span dir="ltr"><<a href="mailto:zhaoqian301@gmail.com" target="_blank">zhaoqian301@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I wrote a very simple pass. The code as follows(rude.cpp):<div><font color="#351c75">#include "llvm/Pass.h"<br>#include "llvm/IR/Function.h"<br>#include "llvm/Support/raw_ostream.h"<br>#include "llvm/IR/BasicBlock"<br><br>using namespace llvm;<br><br>namespace {<br> struct rude : public FunctionPass {<br> static char ID;<br> rude() : FunctionPass(ID) {}<br><br> bool runOnFunction(Function &F) override {<br> errs() << "Hello,I'm rude: ";<br> errs().write_escaped(F.getName()) << '\n';<br> <br> for(Function::iterator b=F.begin(),be=F.end();b!=be;++b)<br> {<br> errs()<<"\n\tBB:";<br> for(BasicBlock::iterator i=b->begin(),ie=b->end();i!=ie;++i)<br> {<br> errs()<<"\n\tanalysis instructions";<br> }<br> }<br> return false;<br> }<br> };<br>}<br><br>char Hello::ID = 9;<br>static RegisterPass<rude> X("rude", "rude Pass", false, false);</font></div><div><font color="#351c75"><br></font></div><div><font color="#000000">then I use command :</font></div><div><font color="#000000">opt -load XX/Debug+Assertion/rude.so <test1.bc> /dev/null to run the rude.so file .</font></div><div><font color="#000000">the error as follows:</font></div><div><font color="#000000"></font></div><div><font color="#000000"><br></font></div></div>
</blockquote></div><br></div>