[Libreoffice-commits] core.git: compilerplugins/clang

Stephan Bergmann sbergman at redhat.com
Fri Oct 27 11:46:10 UTC 2017


 compilerplugins/clang/plugin.cxx |   67 ---------------------------------------
 1 file changed, 67 deletions(-)

New commits:
commit 5670f65ccea6c47b17ec010fd15edcee5522086b
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Oct 27 13:45:39 2017 +0200

    -Werror=unused-function
    
    Change-Id: I2858c6cb74b96ffe6a799dc2ab02cbbe1c56abc7

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());


More information about the Libreoffice-commits mailing list