[Libreoffice-commits] core.git: compilerplugins/clang

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Wed Jan 29 20:59:40 UTC 2020


 compilerplugins/clang/pluginhandler.cxx |   10 ++++++++++
 1 file changed, 10 insertions(+)

New commits:
commit 67ae9380b7adb67590192d6122b713839eaf4665
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Tue Jan 28 22:10:10 2020 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Wed Jan 29 21:59:09 2020 +0100

    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 at collabora.com>

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


More information about the Libreoffice-commits mailing list