<div dir="ltr">Hi all,<div>I need to write a tool that will convert stackful coroutine to stackless. One of the required refactorings is inlining all functions that call yield into a coroutine body. </div><div><br></div><div>Here is an example of required refactoring:</div><div><br></div><div>Input source code:</div><div><br></div><div><font face="monospace, monospace">void foo() { /*foo*/ yield(); }</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">void bar() { /*bar*/  foo(); }</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">void coroutine_body() { </font></div><div><font face="monospace, monospace">  bar();</font></div><div><font face="monospace, monospace">}</font></div><div><br></div><div>Expected output code from tool:</div><div><br></div><div><div><font face="monospace, monospace">void coroutine_body() {</font></div><div><font face="monospace, monospace">   </font><span style="font-family:monospace,monospace">/*bar*/ </span></div><div><span style="font-family:monospace,monospace">   /*foo*/</span></div><div><span style="font-family:monospace,monospace">   yield();</span></div><div><span style="font-family:monospace,monospace">}</span><br></div></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><br></font></div><div><div>So when I run the tool it will create two conflicting replacements:  </div><div><ul><li>inline foo into bar<br></li><li>inline bar into coroutine_body</li></ul><div><br></div></div></div><div>Is it possible to apply them one after another using current Clang libraries?  Or it is not supported out-of-the-box and I should better run tool N times to inline all functions one-by-one without generating conflicting replacements? </div><div><br></div><div>Thanks,</div><div>Roman</div></div>