summaryrefslogtreecommitdiffstats
path: root/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
diff options
context:
space:
mode:
authorGabor Horvath <xazax.hun@gmail.com>2018-02-10 14:04:45 +0000
committerGabor Horvath <xazax.hun@gmail.com>2018-02-10 14:04:45 +0000
commit207e7b1fa179c359182c25f76dfc18bb757166e5 (patch)
tree36bc16b08c2fca0bbb694a921069c7800c7955f9 /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
parentec81ae37bd835b4d3d89d5e7ac1aeb17a636b752 (diff)
downloadbcm5719-llvm-207e7b1fa179c359182c25f76dfc18bb757166e5.tar.gz
bcm5719-llvm-207e7b1fa179c359182c25f76dfc18bb757166e5.zip
[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 llvm-svn: 324808
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
-rw-r--r--clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
index 4167e1fe20b..59f30d5c306 100644
--- a/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
+++ b/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
@@ -32,6 +32,8 @@
using namespace clang;
using namespace llvm::opt;
+namespace clang {
+
static std::unique_ptr<FrontendAction>
CreateFrontendBaseAction(CompilerInstance &CI) {
using namespace clang::frontend;
@@ -63,6 +65,7 @@ CreateFrontendBaseAction(CompilerInstance &CI) {
case ParseSyntaxOnly: return llvm::make_unique<SyntaxOnlyAction>();
case ModuleFileInfo: return llvm::make_unique<DumpModuleInfoAction>();
case VerifyPCH: return llvm::make_unique<VerifyPCHAction>();
+ case TemplightDump: return llvm::make_unique<TemplightDumpAction>();
case PluginAction: {
for (FrontendPluginRegistry::iterator it =
@@ -122,7 +125,7 @@ CreateFrontendBaseAction(CompilerInstance &CI) {
#endif
}
-static std::unique_ptr<FrontendAction>
+std::unique_ptr<FrontendAction>
CreateFrontendAction(CompilerInstance &CI) {
// Create the underlying action.
std::unique_ptr<FrontendAction> Act = CreateFrontendBaseAction(CI);
@@ -173,7 +176,7 @@ CreateFrontendAction(CompilerInstance &CI) {
return Act;
}
-bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
+bool ExecuteCompilerInvocation(CompilerInstance *Clang) {
// Honor -help.
if (Clang->getFrontendOpts().ShowHelp) {
std::unique_ptr<OptTable> Opts = driver::createDriverOptTable();
@@ -254,3 +257,5 @@ bool clang::ExecuteCompilerInvocation(CompilerInstance *Clang) {
BuryPointer(std::move(Act));
return Success;
}
+
+} //namespace clang
OpenPOWER on IntegriCloud