<div dir="ltr">Hi all,<div><br></div><div>I am doing a project that requires counting the number of uses of a value</div><div>only in all dominated blocks in a function. I checked the manual for llvm::User</div><div>class, but only get this</div><div><br></div><div><table border="0" cellpadding="0" cellspacing="0" style="margin:1em 0px 0px;padding:0px;font-family:arial,helvetica,sans-serif;font-size:13px;color:rgb(0,0,0);table-layout:auto;border-collapse:collapse;border-bottom:1px solid rgb(153,153,153)"><tbody style="margin:0px;padding:0px"><tr style="margin:0px;padding:0px"><td class="gmail-memItemLeft" align="right" valign="top" style="padding:0.2em 0px 0.2em 0.2em;border-top:1px solid rgb(153,153,153);background-color:rgb(240,241,242);border-right:1px solid rgb(221,221,221)"><a class="el" href="http://llvm.org/test-doxygen/api/classunsigned.html" style="margin:0px;padding:0px;color:rgb(60,122,160);font-weight:bold">unsigned</a> </td><td class="gmail-memItemRight" valign="bottom" style="padding:0.2em 0.5em 0.2em 0.2em;border-top:1px solid rgb(153,153,153);background-color:rgb(240,241,242)"><a class="el" href="http://llvm.org/test-doxygen/api/classllvm_1_1Value.html#a380559e99b47632a34f74de7c1d03cc0" style="margin:0px;padding:0px;color:rgb(60,122,160);font-weight:bold">getNumUses</a> () const</td></tr></tbody></table><br></div><div>This gives me all the uses of a value.</div><div><br></div><div>Is there any simple way, like an API to do this?</div><div>Or I have to manually write a method to traverse dominated basic blocks and count </div><div>the number of uses?</div><div><br></div><div>Thanks,</div><div>Tianyu Cheng</div></div>