<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"><br>​#0 0x222Bd05 llvm::sys::PrintStackTrace(llvm::raw_ostream&)  XX/LLVM3.7.0/llvm/lib/Support/Unix/Signals.inc/:437:0</font></div><div><font color="#000000">#1 0x222901a PrintStackTraceSignalHandler(void*)  XX/LLVM3.7.0/llvm/lib/Support/Unix/Signal.inc:495:0</font></div><div><font color="#000000">.... </font></div><div><font color="#000000"><br></font></div><div>I really don't know why it is. can anyone help me?</div></div>