diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-10-04 11:14:43 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-10-04 11:14:43 +0200 |
commit | 56c9446f74747214f733757f134cbc9e055ca5e2 (patch) | |
tree | dcff407d2b0b81eb5d6385aaa8164a6a0bc03e43 /compilerplugins/clang/blockblock.cxx | |
parent | 83a34d29100862b15d9d86cb852a0fd86f5b7f77 (diff) |
Suppress loplugin:blockblock in functions involving preprocessing conditionals
...as needed to avoid an unhelpful warning about Player::createPlayerWindow in
avmedia/source/gstreamer/gstplayer.cxx when included from
avmedia/source/gstreamer/gst_0_10.cxx (so that ENABLE_GTKSINK is not defined).
Change-Id: I6de9cc59cf8e611c4c9d939dd837499b1d2c8787
Diffstat (limited to 'compilerplugins/clang/blockblock.cxx')
-rw-r--r-- | compilerplugins/clang/blockblock.cxx | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/compilerplugins/clang/blockblock.cxx b/compilerplugins/clang/blockblock.cxx index 43e9b94deedb..3d5d69c2ab57 100644 --- a/compilerplugins/clang/blockblock.cxx +++ b/compilerplugins/clang/blockblock.cxx @@ -35,6 +35,41 @@ public: TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } + bool TraverseCXXMethodDecl(CXXMethodDecl * decl) { + if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) { + return true; + } + return RecursiveASTVisitor::TraverseCXXMethodDecl(decl); + } + + bool TraverseCXXConstructorDecl(CXXConstructorDecl * decl) { + if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) { + return true; + } + return RecursiveASTVisitor::TraverseCXXConstructorDecl(decl); + } + + bool TraverseCXXDestructorDecl(CXXDestructorDecl * decl) { + if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) { + return true; + } + return RecursiveASTVisitor::TraverseCXXDestructorDecl(decl); + } + + bool TraverseCXXConversionDecl(CXXConversionDecl * decl) { + if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) { + return true; + } + return RecursiveASTVisitor::TraverseCXXConversionDecl(decl); + } + + bool TraverseObjCMethodDecl(ObjCMethodDecl * decl) { + if (containsPreprocessingConditionalInclusion(decl->getSourceRange())) { + return true; + } + return RecursiveASTVisitor::TraverseObjCMethodDecl(decl); + } + bool VisitCompoundStmt(CompoundStmt const * ); }; |