2013-09-21 14:42:35 +01:00
|
|
|
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
|
2012-10-13 17:38:58 +02:00
|
|
|
/*
|
|
|
|
* 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>
|
|
|
|
|
2012-10-15 15:36:25 +02:00
|
|
|
#include "plugin.hxx"
|
2012-10-13 17:38:58 +02:00
|
|
|
|
|
|
|
namespace loplugin
|
|
|
|
{
|
|
|
|
|
|
|
|
class SalLogAreas
|
|
|
|
: public RecursiveASTVisitor< SalLogAreas >
|
|
|
|
, public Plugin
|
|
|
|
{
|
|
|
|
public:
|
2014-01-27 13:09:20 +01:00
|
|
|
explicit SalLogAreas( const InstantiationData& data );
|
2013-05-31 18:34:11 +02:00
|
|
|
virtual void run() override;
|
2013-05-02 18:17:32 +02:00
|
|
|
bool VisitFunctionDecl( const FunctionDecl* function );
|
|
|
|
bool VisitCallExpr( const CallExpr* call );
|
2012-10-13 17:38:58 +02:00
|
|
|
private:
|
|
|
|
void checkArea( StringRef area, SourceLocation location );
|
2015-11-19 16:05:35 +01:00
|
|
|
void checkAreaSyntax(StringRef area, SourceLocation location);
|
2012-10-13 17:38:58 +02:00
|
|
|
void readLogAreas();
|
|
|
|
const FunctionDecl* inFunction;
|
2012-10-17 19:53:32 +02:00
|
|
|
SourceLocation lastSalDetailLogStreamMacro;
|
2012-10-15 14:58:19 +02:00
|
|
|
set< string > logAreas;
|
2016-12-15 14:11:16 +02:00
|
|
|
#if 0
|
2016-12-14 09:49:39 +02:00
|
|
|
string firstSeenLogArea;
|
|
|
|
SourceLocation firstSeenLocation;
|
2016-12-15 14:11:16 +02:00
|
|
|
#endif
|
2012-10-13 17:38:58 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
#endif // SALLOGAREAS_H
|
2013-09-21 14:42:35 +01:00
|
|
|
|
|
|
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|