diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-01-28 22:10:10 +0100 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-01-29 21:59:09 +0100 |
commit | 67ae9380b7adb67590192d6122b713839eaf4665 (patch) | |
tree | 7d27eb507fdf83da2e3cf1bd65e73111959ee71f /compilerplugins/clang/pluginhandler.cxx | |
parent | d34b37ebe334fe26aa22eb6e8aa5bb5bb9b83863 (diff) |
make our clang plugin visible in -ftime-trace output
Change-Id: Id9363d8db729883d0f72eb9fcbf6d8bf5b396414
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87662
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'compilerplugins/clang/pluginhandler.cxx')
-rw-r--r-- | compilerplugins/clang/pluginhandler.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compilerplugins/clang/pluginhandler.cxx b/compilerplugins/clang/pluginhandler.cxx index 02150c2b10c5..492561fb3a3e 100644 --- a/compilerplugins/clang/pluginhandler.cxx +++ b/compilerplugins/clang/pluginhandler.cxx @@ -21,6 +21,10 @@ #include <clang/Lex/PPCallbacks.h> #include <stdio.h> +#if CLANG_VERSION >= 90000 +#include <llvm/Support/TimeProfiler.h> +#endif + #if defined _WIN32 #include <process.h> #else @@ -292,6 +296,9 @@ void PluginHandler::addSourceModification(SourceRange range) void PluginHandler::HandleTranslationUnit( ASTContext& context ) { +#if CLANG_VERSION >= 90000 + llvm::TimeTraceScope mainTimeScope("LOPluginMain", StringRef("")); +#endif if( context.getDiagnostics().hasErrorOccurred()) return; if (mainFileName.endswith(".ii")) @@ -305,6 +312,9 @@ void PluginHandler::HandleTranslationUnit( ASTContext& context ) { if( plugins[ i ].object != NULL && !plugins[ i ].disabledRun ) { +#if CLANG_VERSION >= 90000 + llvm::TimeTraceScope timeScope("LOPlugin", [&]() { return plugins[i].optionName; }); +#endif plugins[ i ].object->run(); } } |