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

Luboš Luňák (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 3 15:33:33 UTC 2020


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

New commits:
commit 512cb39ffc646e7126533d782482621a806e825d
Author:     Luboš Luňák <l.lunak at collabora.com>
AuthorDate: Mon Feb 3 14:08:32 2020 +0100
Commit:     Luboš Luňák <l.lunak at collabora.com>
CommitDate: Mon Feb 3 16:33:01 2020 +0100

    handle -Wunused-function warnings in clang's sharedvisitor.cxx
    
    Change-Id: I5fbf7da1da8c1c5b33e008e30898ca5d2cdfde65
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87870
    Tested-by: Jenkins
    Reviewed-by: Luboš Luňák <l.lunak at collabora.com>

diff --git a/compilerplugins/clang/sharedvisitor/generator.cxx b/compilerplugins/clang/sharedvisitor/generator.cxx
index b94083aaa304..62c0798a4801 100644
--- a/compilerplugins/clang/sharedvisitor/generator.cxx
+++ b/compilerplugins/clang/sharedvisitor/generator.cxx
@@ -296,6 +296,16 @@ void generateVisitor( PluginType type )
             output << "            --activeRefCount;\n";
             output << "        " << plugin.variableName << " = save" << plugin.className << ";\n";
         }
+        output << "        if( false ) // silence -Wunused-function warnings\n";
+        output << "        {\n";
+        for( const PluginInfo& plugin : plugins[ type ] )
+        {
+            auto pluginTraverse = plugin.traverseFunctions.find( traverse );
+            if( pluginTraverse == plugin.traverseFunctions.end())
+                continue;
+            output << "            " << plugin.variableName << "->" << pluginTraverse->name << "( arg );\n";
+        }
+        output << "        }\n";
         output << "        return ret;\n";
         output << "    }\n";
     }


More information about the Libreoffice-commits mailing list