<div dir="ltr"><div><div>Hi,<br></div>I wrote a sample program to iterate through each function and just print a 'hello' for every basic blocks. There were no errors while running a 'make' command. But the program returns some errors in my system. When I check the same program in my friend's system it works fine.<br><br></div>My program:<br><br>virtual bool runOnFunction(Function &F) {<br>  for (Function::iterator b = F.begin(), be = F.end(); b != be; ++b) //Thorws error when I add this loop<br>   {<br>        <br>                                errs()<<"hello"<<"\t"; <br>    }<br>        <br>            <br>            return false;<br>        } <br><div><br><br>Command : $ opt -load ~/LLVM/bulid/Debug+Asserts/lib/CSE.so -CSE < hell.ll > /dev/null<br><br></div><div>Error while running the pass :<br><br>hello    hello    0  opt             0x00000000014a1b92 llvm::sys::PrintStackTrace(_IO_FILE*) + 34<br>1  opt             0x00000000014a0f79<br>2  libpthread.so.0 0x00007f2c1a4a7340<br>3  CSE.so          0x00007f2c192826cc<br>4  CSE.so          0x00007f2c192826ac<br>5  CSE.so          0x00007f2c1928267f<br>6  CSE.so          0x00007f2c19282564<br>7  opt             0x000000000142f4df llvm::FPPassManager::runOnFunction(llvm::Function&) + 607<br>8  opt             0x000000000142f54b llvm::FPPassManager::runOnModule(llvm::Module&) + 43<br>9  opt             0x000000000142f09f llvm::legacy::PassManagerImpl::run(llvm::Module&) + 927<br>10 opt             0x000000000059f768 main + 4888<br>11 libc.so.6       0x00007f2c194a6ec5 __libc_start_main + 245<br>12 opt             0x00000000005bae91<br>Stack dump:<br>0.    Program arguments: opt -load /home/mtech2/LLVM/bulid/Debug+Asserts/lib/CSE.so -CSE <br>1.    Running pass 'Function Pass Manager' on module '<stdin>'.<br>2.    Running pass 'Print Instructions' on function '@main'<br>Segmentation fault (core dumped)<br><br></div><div>Any help regarding the error.<br><br></div><div>Regards,<br></div><div>Rakesh R Nair<br></div></div>