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

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 16 09:58:27 UTC 2019


 compilerplugins/clang/sallogareas.cxx |   35 ++++++++++++++++++-------
 compilerplugins/clang/sallogareas.hxx |   47 ----------------------------------
 2 files changed, 26 insertions(+), 56 deletions(-)

New commits:
commit d6a73b2ab70f3ba0161709c9601fa40692ba9ce5
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 16 09:15:52 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 16 11:57:39 2019 +0200

    remove sallogareas header file
    
    in preparation for using LO_CLANG_SHARED_PLUGINS
    
    Change-Id: I91cf186188bf0f15fc4e5adc095d404d89d0b025
    Reviewed-on: https://gerrit.libreoffice.org/75681
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/compilerplugins/clang/sallogareas.cxx b/compilerplugins/clang/sallogareas.cxx
index 50e25a3f04e6..4d749330abd1 100644
--- a/compilerplugins/clang/sallogareas.cxx
+++ b/compilerplugins/clang/sallogareas.cxx
@@ -9,17 +9,40 @@
  *
  */
 
-#include "sallogareas.hxx"
+#include "plugin.hxx"
 #include "check.hxx"
 #include "compat.hxx"
 
 #include <clang/Lex/Lexer.h>
 
 #include <fstream>
+#include <set>
 
-namespace loplugin
+namespace
 {
 
+class SalLogAreas
+    : public loplugin::FilteringPlugin< SalLogAreas >
+    {
+    public:
+        explicit SalLogAreas( const loplugin::InstantiationData& data )
+            : FilteringPlugin(data), inFunction(nullptr) {}
+        virtual void run() override;
+        bool VisitFunctionDecl( const FunctionDecl* function );
+        bool VisitCallExpr( const CallExpr* call );
+    private:
+        void checkArea( StringRef area, SourceLocation location );
+        void checkAreaSyntax(StringRef area, SourceLocation location);
+        void readLogAreas();
+        const FunctionDecl* inFunction;
+        SourceLocation lastSalDetailLogStreamMacro;
+        std::set< std::string > logAreas;
+#if 0
+        std::string firstSeenLogArea;
+        SourceLocation firstSeenLocation;
+#endif
+    };
+
 /*
 This is a compile check.
 
@@ -28,14 +51,8 @@ report if the area is not listed there. The fix is either use a proper area or a
 if appropriate.
 */
 
-SalLogAreas::SalLogAreas( const InstantiationData& data )
-    : FilteringPlugin(data), inFunction(nullptr)
-    {
-    }
-
 void SalLogAreas::run()
     {
-    inFunction = NULL;
     lastSalDetailLogStreamMacro = SourceLocation();
     TraverseDecl( compiler.getASTContext().getTranslationUnitDecl());
     }
@@ -244,7 +261,7 @@ void SalLogAreas::readLogAreas()
         report( DiagnosticsEngine::Warning, "error reading log areas" );
     }
 
-static Plugin::Registration< SalLogAreas > X( "sallogareas" );
+static loplugin::Plugin::Registration< SalLogAreas > X( "sallogareas" );
 
 } // namespace
 
diff --git a/compilerplugins/clang/sallogareas.hxx b/compilerplugins/clang/sallogareas.hxx
deleted file mode 100644
index b9f57bdd4d6c..000000000000
--- a/compilerplugins/clang/sallogareas.hxx
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * Based on LLVM/Clang.
- *
- * This file is distributed under the University of Illinois Open Source
- * License. See LICENSE.TXT for details.
- *
- */
-
-#ifndef SALLOGAREAS_H
-#define SALLOGAREAS_H
-
-#include <set>
-
-#include "plugin.hxx"
-
-namespace loplugin
-{
-
-class SalLogAreas
-    : public FilteringPlugin< SalLogAreas >
-    {
-    public:
-        explicit SalLogAreas( const InstantiationData& data );
-        virtual void run() override;
-        bool VisitFunctionDecl( const FunctionDecl* function );
-        bool VisitCallExpr( const CallExpr* call );
-    private:
-        void checkArea( StringRef area, SourceLocation location );
-        void checkAreaSyntax(StringRef area, SourceLocation location);
-        void readLogAreas();
-        const FunctionDecl* inFunction;
-        SourceLocation lastSalDetailLogStreamMacro;
-        std::set< std::string > logAreas;
-#if 0
-        std::string firstSeenLogArea;
-        SourceLocation firstSeenLocation;
-#endif
-    };
-
-} // namespace
-
-#endif // SALLOGAREAS_H
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list