diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2014-09-15 17:09:38 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2014-09-15 17:12:08 +0200 |
commit | 8dccc4d9b768d5a337a512e52cab8bb347bbff7e (patch) | |
tree | 3ce8fc214c8af1f504a350a05ae4a4eaced0e0d1 /compilerplugins | |
parent | c94f43c9da74dbcc12f35e13b64c68c54be35421 (diff) |
loplugin:salbool env var is no longer necessary, all code is clean
Change-Id: Ibf1d8c74dc8abb8c1fef59c53a8873cc426e2932
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/salbool.cxx | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx index 6cca0faa3455..5949e75c1999 100644 --- a/compilerplugins/clang/salbool.cxx +++ b/compilerplugins/clang/salbool.cxx @@ -9,7 +9,6 @@ #include <algorithm> #include <cassert> -#include <cstdlib> #include <set> #include <string> @@ -110,10 +109,7 @@ class SalBool: public RecursiveASTVisitor<SalBool>, public loplugin::RewritePlugin { public: - explicit SalBool(InstantiationData const & data): - RewritePlugin(data), - fullMode_(std::getenv("loplugin:salbool") != nullptr) - {} + explicit SalBool(InstantiationData const & data): RewritePlugin(data) {} virtual void run() override; @@ -148,7 +144,6 @@ private: bool rewrite(SourceLocation location); - bool fullMode_; std::set<VarDecl const *> varDecls_; }; @@ -188,7 +183,7 @@ void SalBool::run() { } } } - if (fullMode_ && !rewrite(loc)) { + if (!rewrite(loc)) { report( DiagnosticsEngine::Warning, "VarDecl, use \"bool\" instead of \"sal_Bool\"", loc) @@ -381,15 +376,14 @@ bool SalBool::VisitParmVarDecl(ParmVarDecl const * decl) { // where the function would still implicitly override and // cause a compilation error due to the incompatible return // type): - if (fullMode_ - && !((compat::isInMainFile( - compiler.getSourceManager(), - compiler.getSourceManager().getSpellingLoc( - dyn_cast<FunctionDecl>( - decl->getDeclContext()) - ->getNameInfo().getLoc())) - || f->isDefined() || f->isPure()) - && k != OverrideKind::MAYBE && rewrite(loc))) + if (!((compat::isInMainFile( + compiler.getSourceManager(), + compiler.getSourceManager().getSpellingLoc( + dyn_cast<FunctionDecl>( + decl->getDeclContext()) + ->getNameInfo().getLoc())) + || f->isDefined() || f->isPure()) + && k != OverrideKind::MAYBE && rewrite(loc))) { report( DiagnosticsEngine::Warning, @@ -476,7 +470,7 @@ bool SalBool::VisitFieldDecl(FieldDecl const * decl) { } } } - if (fullMode_ && !rewrite(loc)) { + if (!rewrite(loc)) { report( DiagnosticsEngine::Warning, "FieldDecl, use \"bool\" instead of \"sal_Bool\"", loc) @@ -530,13 +524,12 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) { // rewriter had a chance to act upon the definition (but use the // heuristic of assuming pure virtual functions do not have // definitions): - if (fullMode_ - && !((compat::isInMainFile( - compiler.getSourceManager(), - compiler.getSourceManager().getSpellingLoc( - decl->getNameInfo().getLoc())) - || f->isDefined() || f->isPure()) - && rewrite(loc))) + if (!((compat::isInMainFile( + compiler.getSourceManager(), + compiler.getSourceManager().getSpellingLoc( + decl->getNameInfo().getLoc())) + || f->isDefined() || f->isPure()) + && rewrite(loc))) { report( DiagnosticsEngine::Warning, @@ -558,9 +551,7 @@ bool SalBool::VisitValueDecl(ValueDecl const * decl) { if (ignoreLocation(decl)) { return true; } - if (fullMode_ && isSalBool(decl->getType()) - && !rewrite(decl->getLocStart())) - { + if (isSalBool(decl->getType()) && !rewrite(decl->getLocStart())) { report( DiagnosticsEngine::Warning, "ValueDecl, use \"bool\" instead of \"sal_Bool\"", |