<div dir="ltr"><div>This patch adds a base-class called TemplateInstantiationObserver which gets notified whenever a template instantiation is entered or exited during semantic analysis. This is a base class used to implement the template profiling and debugging tool called Templight (<a href="https://github.com/mikael-s-persson/templight">https://github.com/mikael-s-persson/templight</a>).</div><div><br></div><div>The patch also makes a few more changes:</div><div> - ActiveTemplateInstantiation class is moved out of the Sema class (so it can be used with inclusion of Sema.h).<br></div><div> - CreateFrontendAction function in front-end utilities is given external linkage (not longer a hidden static function).</div> - TemplateInstObserverChain data member added to Sema class to hold the list of template-inst observers.<div> - Notifications to the template-inst observer are added at the key places where templates are instantiated.</div><div><br></div><div>I believe this patch should be fairly uncontroversial as the changes are very limited. I tried to keep them minimal, it does not add any end-user feature or bug-fix, and the impact to the main-line code is negligible. AFAIK, all LLVM / Clang guidelines have been respected.</div><div><br></div><div>The patch was made against r219067.</div><div><div><br></div>-- <br>Sven Mikael Persson, M.Sc.(Tech.)<br>McGill University,<br><br>
</div></div>