diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-10-27 13:45:39 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-10-27 13:45:39 +0200 |
commit | 5670f65ccea6c47b17ec010fd15edcee5522086b (patch) | |
tree | 70a2c4f66b64a6be0915c533f6d4cbe83d05108b | |
parent | bb72ef2a15b0a08b07256f1bb3a0c96c413e8da8 (diff) |
-Werror=unused-function
Change-Id: I2858c6cb74b96ffe6a799dc2ab02cbbe1c56abc7
-rw-r--r-- | compilerplugins/clang/plugin.cxx | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx index e512cc399d16..077b24370f71 100644 --- a/compilerplugins/clang/plugin.cxx +++ b/compilerplugins/clang/plugin.cxx @@ -186,73 +186,6 @@ bool Plugin::isInUnoIncludeFile(const FunctionDecl* functionDecl) const functionDecl->getCanonicalDecl()->getNameInfo().getLoc())); } -namespace -{ -class ParentBuilder - : public RecursiveASTVisitor< ParentBuilder > -{ -public: - bool VisitFunctionDecl( const FunctionDecl* function ); - bool VisitObjCMethodDecl( const ObjCMethodDecl* method ); - void walk( const Stmt* stmt ); - bool shouldVisitTemplateInstantiations () const { return true; } - std::unordered_map< const Stmt*, const Stmt* >* parents; -}; - -bool ParentBuilder::VisitFunctionDecl( const FunctionDecl* function ) -{ -// if( ignoreLocation( declaration )) -// return true; ??? - if( function->doesThisDeclarationHaveABody() - && !function->isLateTemplateParsed()) - { - const Stmt* body = function->getBody(); - (*parents)[ body ] = NULL; // no parent - walk( body ); - } - if( const CXXConstructorDecl* ctor = dyn_cast< CXXConstructorDecl >( function )) - { - for( CXXConstructorDecl::init_const_iterator it = ctor->init_begin(); - it != ctor->init_end(); - ++it ) - { - const Expr* init_expression = (*it)->getInit(); - (*parents)[ init_expression ] = NULL; - walk( init_expression ); - } - } - return true; -} - -bool ParentBuilder::VisitObjCMethodDecl( const ObjCMethodDecl* method ) -{ -// if( ignoreLocation( declaration )) -// return true; ??? - if( method->hasBody()) - { - const Stmt* body = method->getBody(); - (*parents)[ body ] = NULL; // no parent - walk( body ); - } - return true; -} - -void ParentBuilder::walk( const Stmt* stmt ) -{ - for( ConstStmtIterator it = stmt->child_begin(); - it != stmt->child_end(); - ++it ) - { - if( *it != NULL ) - { - (*parents)[ *it ] = stmt; - walk( *it ); - } - } -} - -} // namespace - SourceLocation Plugin::locationAfterToken( SourceLocation location ) { return Lexer::getLocForEndOfToken( location, 0, compiler.getSourceManager(), compiler.getLangOpts()); |