<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi,all:<div style="line-height: 1.7; "></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; ">I am a new at writing LLVM PASS, i write a pass like this :</div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><div>using namespace llvm;</div><div><br></div><div>namespace {</div><div> class RuntimeEval : public ModulePass {</div><div> public:</div><div> static char ID; // Pass identification, replacement for typeid</div><div><br></div><div> RuntimeEval() : ModulePass(ID) {</div><div> }</div><div> </div><div> virtual bool runOnModule(Module &M) {</div><div> return false; </div><div> } </div><div> };</div><div>}</div><div><br></div><div>char HSASupportedRuntimeEval::ID = 0;</div><div>static RegisterPass<RuntimeEval> X("Eval", "Runti!
me Evaluation");</div></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><br></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; ">it can be compiled successful, but when i run it with command: './Release+Asserts/bin/opt -load ./Release+Asserts/lib/LLVMRuntimeEval.so -Eval < code2.bc', </div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><br></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; ">i meet an error: </div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><br></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><div>Pass 'HSA Supported Runtime Evaluation' is not initialized.</div><div>Verify if there is a pass dependency cycle.</div><div>Required Passes:</div><div>opt: /home/ccwang/software/LLVM/LLVM3.2/llvm-3.2.src/lib/VMCore/PassManager.cpp:616: void llvm::PMTopLevelManager::schedulePass(llvm::Pass*): Assertion `PI && "Expected req!
uired passes to be initialized"' failed.</div><div>0 opt
0x00000000011a649f</div><div>1 opt 0x00000000011a69c9</div><div>2 libpthread.so.0 0x00007fc102e21cb0</div><div>3 libc.so.6 0x00007fc102073425 gsignal + 53</div><div>4 libc.so.6 0x00007fc102076b8b abort + 379</div><div>5 libc.so.6 0x00007fc10206c0ee</div><div>6 libc.so.6 0x00007fc10206c192</div><div>7 opt 0x000000000113c423 llvm::PMTopLevelManager::schedulePass(llvm::Pass*) + 1907</div><div>8 opt 0x000000000055253a main + 2874</div><div>9 libc.so.6 0x00007fc10205e76d __libc_start_main + 237</div><div>10 opt 0x00000000005687dd</div><div>Stack dump:</div><div>0.<span class="Apple-tab-span" style="white-space: pre; "> </spa!
n>Program arguments: ./Release+Asserts/bin/opt -load ./Release+Asserts/lib/LLVMHRuntimeEval.so -Eval </div><div>Aborted (core dumped)</div></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><br></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; ">If anyone can give me some advices about it? thanks!</div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; "><br></div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; ">regards,</div><div style="font-family: Helvetica, 'Microsoft Yahei', verdana; ">wang</div><div><br></div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>