]> granicus.if.org Git - clang/commit
[Templight] Template Instantiation Observer
authorGabor Horvath <xazax.hun@gmail.com>
Sat, 10 Feb 2018 14:04:45 +0000 (14:04 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Sat, 10 Feb 2018 14:04:45 +0000 (14:04 +0000)
commitc963abc492c42effaeea2dfc61d1177f08c3a44f
treec1efeacb5153a6b8ef2894ec8761c1110434c240
parent8d0b5771e42ee079be1cb3475a65af2220847a44
[Templight] Template Instantiation Observer

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.

Patch by: Abel Sinkovics!

Differential Revision: https://reviews.llvm.org/D5767

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@324808 91177308-0d34-0410-b5e6-96231b3b80d8
25 files changed:
include/clang/Driver/CC1Options.td
include/clang/Frontend/FrontendActions.h
include/clang/Frontend/FrontendOptions.h
include/clang/FrontendTool/Utils.h
include/clang/Sema/Sema.h
include/clang/Sema/TemplateInstCallback.h [new file with mode: 0644]
lib/Frontend/CompilerInvocation.cpp
lib/Frontend/FrontendActions.cpp
lib/FrontendTool/ExecuteCompilerInvocation.cpp
lib/Parse/ParseAST.cpp
lib/Sema/Sema.cpp
lib/Sema/SemaTemplateInstantiate.cpp
lib/Sema/SemaTemplateInstantiateDecl.cpp
lib/Sema/SemaType.cpp
test/Templight/templight-deduced-func.cpp [new file with mode: 0644]
test/Templight/templight-default-arg-inst.cpp [new file with mode: 0644]
test/Templight/templight-default-func-arg.cpp [new file with mode: 0644]
test/Templight/templight-default-template-arg.cpp [new file with mode: 0644]
test/Templight/templight-exception-spec-func.cpp [new file with mode: 0644]
test/Templight/templight-explicit-template-arg.cpp [new file with mode: 0644]
test/Templight/templight-memoization.cpp [new file with mode: 0644]
test/Templight/templight-nested-memoization.cpp [new file with mode: 0644]
test/Templight/templight-nested-template-instantiation.cpp [new file with mode: 0644]
test/Templight/templight-one-instantiation.cpp [new file with mode: 0644]
test/Templight/templight-prior-template-arg.cpp [new file with mode: 0644]