update credits
[LibreOffice.git] / compilerplugins / clang / bodynotinblock.hxx
blobe6ad1ab893e3451083bbe1e849388ef598708407
1 /*
2 * This file is part of the LibreOffice project.
4 * Based on LLVM/Clang.
6 * This file is distributed under the University of Illinois Open Source
7 * License. See LICENSE.TXT for details.
9 */
11 #ifndef BODYNOTINBLOCK_H
12 #define BODYNOTINBLOCK_H
14 #include "plugin.hxx"
16 namespace loplugin
19 class BodyNotInBlock
20 : public RecursiveASTVisitor< BodyNotInBlock >
21 , public Plugin
23 public:
24 explicit BodyNotInBlock( CompilerInstance& compiler );
25 virtual void run() override;
26 bool VisitFunctionDecl( const FunctionDecl* declaration );
27 private:
28 typedef vector< const Stmt* > StmtParents;
29 void traverseStatement( const Stmt* stmt, StmtParents& parents );
30 void checkBody( const Stmt* body, SourceLocation stmtLocation, const StmtParents& parents,
31 int stmtType, bool dontGoUp = false );
34 } // namespace
36 #endif // BODYNOTINBLOCK_H