<div>I have seen ReachingDefAnalysis. It works with MachineInstrs at back-end:<div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"><span style="background:rgb( 232 , 232 , 232 );border-right-color:rgb( 0 , 255 , 0 );border-right-style:solid;border-right-width:2px;padding-right:4px;text-align:right;white-space:pre">92</span> <span style="color:rgb( 128 , 0 , 0 )"> /// Provides the instruction id of the closest reaching def instruction of</span></div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"><span style="background:rgb( 232 , 232 , 232 );border-right-color:rgb( 0 , 255 , 0 );border-right-style:solid;border-right-width:2px;padding-right:4px;text-align:right;white-space:pre">93</span> <span style="color:rgb( 128 , 0 , 0 )"> /// PhysReg that reaches MI, relative to the begining of MI's basic block.</span></div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"><span style="background:rgb( 232 , 232 , 232 );border-right-color:rgb( 0 , 255 , 0 );border-right-style:solid;border-right-width:2px;padding-right:4px;text-align:right;white-space:pre">94</span>  <span style="color:rgb( 96 , 64 , 32 )">int</span> <a href="https://llvm.org/doxygen/classllvm_1_1ReachingDefAnalysis.html#ac0e983c57424630b04796d051aee5d43" style="color:rgb( 70 , 101 , 162 );font-weight:normal;text-decoration:none">getReachingDef</a>(<a href="https://llvm.org/doxygen/classllvm_1_1MachineInstr.html" style="color:rgb( 70 , 101 , 162 );font-weight:normal;text-decoration:none">MachineInstr</a> *<a href="https://llvm.org/doxygen/IRTranslator_8cpp.html#abe44dfdea65b4f7e11e0a608ab708b76" style="color:rgb( 70 , 101 , 162 );font-weight:normal;text-decoration:none">MI</a>, <span style="color:rgb( 96 , 64 , 32 )">int</span> PhysReg);</div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"> </div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px">but I need to do same at source-code level.</div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"> </div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"> </div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px">It seems that I must try ReachingDefenitions from <a href="https://reviews.llvm.org/D64991" style="background:rgb( 255 , 255 , 255 );color:rgb( 204 , 0 , 0 );font:400 15px 'arial' , sans-serif;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">https://reviews.llvm.org/D64991</a>.</div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px">Thanks a lot.</div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"> </div><div style="color:rgb( 0 , 0 , 0 );font:400 13px / 1 monospace , 'fixed';margin:0px;min-height:13px;padding-bottom:0px;padding-left:53px;text-decoration-style:initial;text-transform:none;white-space:pre-wrap;word-spacing:0px"> </div></div><div>Good luck in writing thesis.</div><div> </div><div><br /></div><div><br /></div><div>20.11.2019, 21:25, "Kristóf Umann" <dkszelethus@gmail.com>:</div><blockquote><div dir="ltr">In LLVM, sure: <a href="https://llvm.org/doxygen/classllvm_1_1ReachingDefAnalysis.html">https://llvm.org/doxygen/classllvm_1_1ReachingDefAnalysis.html</a><div><br /></div><div>In Clang for C++ (or even C) code, none that I'm aware of. Its really not far off, but I happen to be occupied with my thesis for a good long while :)</div></div><br /><div class="990dff61da1bf26c96b7874e5886d2ddddb5400cc378696a2a2a68d613807c78gmail_quote"><div class="409424f73590217415708220c1f0eb7d1ce69f9573b50cd3251b7c46389de94bgmail_attr" dir="ltr">On Wed, 20 Nov 2019 at 17:00, Алексеев Кирилл <<a href="mailto:rldoc@yandex.ru">rldoc@yandex.ru</a>> wrote:<br /></div><blockquote class="990dff61da1bf26c96b7874e5886d2ddddb5400cc378696a2a2a68d613807c78gmail_quote" style="border-left-color:rgb( 204 , 204 , 204 );border-left-style:solid;border-left-width:1px;margin:0px 0px 0px 0.8ex;padding-left:1ex"><div>Thanks for you answer. Is there reaching definitions implementation in llvm or clang source (not in clang StaticAnalyzer)?</div>
</blockquote></div>
</blockquote>