summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-16 09:15:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-16 11:57:39 +0200
commitd6a73b2ab70f3ba0161709c9601fa40692ba9ce5 (patch)
treea4fba2e299ae4bfd95f320562ebd746dd31027ac /compilerplugins
parentbf08ca37324c5a6d6cfe8cc0be5c4d6396fa1341 (diff)
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@collabora.co.uk>
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/sallogareas.cxx35
-rw-r--r--compilerplugins/clang/sallogareas.hxx47
2 files changed, 26 insertions, 56 deletions
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: */