<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 4/11/13 10:30 PM, Bill He wrote:<br>
</div>
<blockquote
cite="mid:CAPh06R_oGOgTuf3Jcu580v4VT5xJ0xXv-sHUQe558kL5DaYpqg@mail.gmail.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
Hi all,
<div><br>
</div>
<div>I am trying to traverse a dominator tree and have encountered
a weird runtime exception:</div>
<div><br>
</div>
<div>Here's my simple code: </div>
<div><br>
</div>
<div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">
virtual bool runOnFunction(Function &F) {</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">
DominatorTree& DT =
getAnalysis<DominatorTree>();</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)"><br>
</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)"> <b><font
color="#ff0000"> DomTreeNode* rootNode =
DT.getRootNode();</font></b></div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">
return false.</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">}</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)"><br>
</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">Here's
the documentation page:</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)"><a
moz-do-not-send="true"
href="http://llvm.org/docs/doxygen/html/classllvm_1_1DominatorTree.html"
target="_blank" style="color:rgb(17,85,204)">http://llvm.org/docs/doxygen/html/classllvm_1_1DominatorTree.html</a><br>
</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)"><br>
</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">And
here's my runtime exception:</div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">
<div>dyld: lazy symbol binding failed: Symbol not found:
__ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv</div>
<div> Referenced from:
/Users/weibohe/Projects/llvm/llvm/Debug+Asserts/lib/LLVMSLVN.dylib</div>
</div>
</div>
</blockquote>
<br>
How are you running your pass? Based on the error, it looks like
whatever tool you're using to run your pass doesn't have the library
defining the DominatorTree code linked in.<br>
<br>
-- John T.<br>
<br>
<blockquote
cite="mid:CAPh06R_oGOgTuf3Jcu580v4VT5xJ0xXv-sHUQe558kL5DaYpqg@mail.gmail.com"
type="cite">
<div>
<div
style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.800000190734863px;background-color:rgb(255,255,255)">
<div>
Expected in: flat namespace</div>
<div><br>
</div>
<div>dyld: Symbol not found:
__ZN4llvm17DominatorTreeBaseINS_10BasicBlockEE11getRootNodeEv</div>
<div> Referenced from:
/Users/weibohe/Projects/llvm/llvm/Debug+Asserts/lib/LLVMSLVN.dylib</div>
<div> Expected in: flat namespace</div>
<div><br>
</div>
<div>0 opt 0x0000000105f528de
llvm::sys::PrintStackTrace(__sFILE*) + 46</div>
<div>1 opt 0x0000000105f52beb
_ZL28PrintStackTraceSignalHandlerPv + 27</div>
<div>2 opt 0x0000000105f52ef9
_ZL13SignalHandleri + 297</div>
<div>3 libsystem_c.dylib 0x00007fff90d32cfa _sigtramp + 26</div>
<div>4 libsystem_c.dylib 0xfffffffffffffff8 _sigtramp +
1865208600</div>
<div>5 libsystem_c.dylib 0x00007fff64a41948 _sigtramp +
3553684584</div>
<div>6 libdyld.dylib 0x00007fff8afe2716 dyld_stub_binder_
+ 13</div>
<div>7 LLVMSLVN.dylib 0x00000001081a8040 void
std::__destroy_aux<llvm::PassInfo
const**>(llvm::PassInfo const**, llvm::PassInfo const**,
std::__true_type) + 19904</div>
<div>8 LLVMSLVN.dylib 0x00000001081998c1 (anonymous
namespace)::DVN::runOnFunction(llvm::Function&) + 65</div>
<div>9 opt 0x0000000105eb27b2
llvm::FPPassManager::runOnFunction(llvm::Function&) +
434</div>
<div>10 opt 0x0000000105eb2a98
llvm::FPPassManager::runOnModule(llvm::Module&) + 104</div>
<div>11 opt 0x0000000105eb2e9a
llvm::MPPassManager::runOnModule(llvm::Module&) + 634</div>
<div>
12 opt 0x0000000105eb36ae
llvm::PassManagerImpl::run(llvm::Module&) + 302</div>
<div>13 opt 0x0000000105eb3951
llvm::PassManager::run(llvm::Module&) + 33</div>
<div>14 opt 0x0000000104e4d335 main + 6549</div>
<div>15 opt 0x0000000104e3e434 start + 52</div>
<div>Stack dump:</div>
<div>0.<span style="white-space:pre-wrap"> </span>Program
arguments: opt -load
../../../Debug+Asserts/lib/LLVMSLVN.dylib -dvn </div>
<div>1.<span style="white-space:pre-wrap"> </span>Running
pass 'Function Pass Manager' on module '<stdin>'.</div>
<div>2.<span style="white-space:pre-wrap"> </span>Running
pass 'My test analysis' on function '@main'</div>
<div><br>
</div>
<div><br>
</div>
<div>Any idea on why this is happening? Any help or suggestion
is appreciated! Thanks in advance.</div>
<div><br>
</div>
<div>Best,</div>
<div>Weibo</div>
<div><br>
</div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a class="moz-txt-link-freetext" href="http://llvm.cs.uiuc.edu">http://llvm.cs.uiuc.edu</a>
<a class="moz-txt-link-freetext" href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a>
</pre>
</blockquote>
<br>
</body>
</html>