diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-19 15:08:05 +0100 |
---|---|---|
committer | Björn Michaelsen <bjoern.michaelsen@canonical.com> | 2014-11-19 14:58:40 +0000 |
commit | b736204f3ba6ee9813ae109071c9d442c2fb2219 (patch) | |
tree | 50c4be237612cce208bd8361cdc0bc9d8048ebd0 /compilerplugins/clang/store/cascadingcondop.hxx | |
parent | 58ce60da28b019be3dcf52c6b9fc51b91361137e (diff) |
add clang plugin for detecting cascading condops
Change-Id: I1b782bb04b09bee5c3db2261f9390a7b2edf4564
Reviewed-on: https://gerrit.libreoffice.org/12967
Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'compilerplugins/clang/store/cascadingcondop.hxx')
-rw-r--r-- | compilerplugins/clang/store/cascadingcondop.hxx | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/compilerplugins/clang/store/cascadingcondop.hxx b/compilerplugins/clang/store/cascadingcondop.hxx new file mode 100644 index 000000000000..e648bdf15e50 --- /dev/null +++ b/compilerplugins/clang/store/cascadingcondop.hxx @@ -0,0 +1,38 @@ +/* -*- 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 CASCADINGCONDOP_H +#define CASCADINGCONDOP_H + +#include "plugin.hxx" + +namespace loplugin +{ + +// The class implementing the plugin action. +class CascadingCondOp + // Inherits from the Clang class that will allow examing the Clang AST tree (i.e. syntax tree). + : public RecursiveASTVisitor< CascadingCondOp > + // And the base class for LO Clang plugins. + , public Plugin + { + public: + CascadingCondOp( const InstantiationData& data ); + virtual void run() override; + void Walk( const Stmt* stmt ); + bool VisitStmt( const Stmt* stmt ); + }; + +} // namespace loplugin + +#endif // CASCADINGCONDOP_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |