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>
This commit is contained in:
Luboš Luňák
2020-01-28 22:10:10 +01:00
parent d34b37ebe3
commit 67ae9380b7

View File

@@ -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();
}
}