2012-10-05 18:17:13 +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 COMPILEPLUGIN_H
|
|
|
|
#define COMPILEPLUGIN_H
|
|
|
|
|
2012-10-09 16:27:25 +02:00
|
|
|
#include <clang/AST/RecursiveASTVisitor.h>
|
|
|
|
|
|
|
|
using namespace clang;
|
|
|
|
|
|
|
|
namespace loplugin
|
|
|
|
{
|
|
|
|
|
|
|
|
class Plugin
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
explicit Plugin( ASTContext& context );
|
|
|
|
protected:
|
2012-10-13 17:38:58 +02:00
|
|
|
DiagnosticBuilder report( DiagnosticsEngine::Level level, StringRef message, SourceLocation loc = SourceLocation());
|
2012-10-09 16:39:49 +02:00
|
|
|
bool ignoreLocation( SourceLocation loc );
|
|
|
|
bool ignoreLocation( const Decl* decl );
|
|
|
|
bool ignoreLocation( const Stmt* stmt );
|
2012-10-09 16:27:25 +02:00
|
|
|
ASTContext& context;
|
|
|
|
};
|
|
|
|
|
2012-10-09 16:39:49 +02:00
|
|
|
inline
|
|
|
|
bool Plugin::ignoreLocation( const Decl* decl )
|
|
|
|
{
|
2012-10-12 15:34:14 +02:00
|
|
|
return ignoreLocation( decl->getLocation());
|
2012-10-09 16:39:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
inline
|
|
|
|
bool Plugin::ignoreLocation( const Stmt* stmt )
|
|
|
|
{
|
|
|
|
return ignoreLocation( stmt->getLocStart());
|
|
|
|
}
|
|
|
|
|
2012-10-09 16:27:25 +02:00
|
|
|
} // namespace
|
|
|
|
|
2012-10-05 18:17:13 +02:00
|
|
|
#endif // COMPILEPLUGIN_H
|