[PATCH] Template Instantiation Observer + a few other templight-related changes
Sven Mikael Persson
mikael.s.persson at gmail.com
Mon Oct 13 22:45:32 PDT 2014
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 (https://github.com/mikael-s-persson/templight).
The patch also makes a few more changes:
- ActiveTemplateInstantiation class is moved out of the Sema class (so it can be used with inclusion of Sema.h).
- CreateFrontendAction function in front-end utilities is given external linkage (not longer a hidden static function).
- TemplateInstObserverChain data member added to Sema class to hold the list of template-inst observers.
- Notifications to the template-inst observer are added at the key places where templates are instantiated.
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.
The patch was made against r219658.
http://reviews.llvm.org/D5767
Files:
include/clang/FrontendTool/Utils.h
include/clang/Sema/ActiveTemplateInst.h
include/clang/Sema/Sema.h
include/clang/Sema/TemplateInstObserver.h
lib/FrontendTool/ExecuteCompilerInvocation.cpp
lib/Parse/ParseAST.cpp
lib/Sema/ActiveTemplateInst.cpp
lib/Sema/CMakeLists.txt
lib/Sema/Sema.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/SemaType.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D5767.14850.patch
Type: text/x-patch
Size: 26293 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20141014/741bf984/attachment.bin>
More information about the cfe-commits
mailing list