summaryrefslogtreecommitdiff
path: root/compilerplugins
diff options
context:
space:
mode:
Diffstat (limited to 'compilerplugins')
-rw-r--r--compilerplugins/clang/plugin.cxx22
1 files changed, 17 insertions, 5 deletions
diff --git a/compilerplugins/clang/plugin.cxx b/compilerplugins/clang/plugin.cxx
index 6611606d793f..7454144f7dfd 100644
--- a/compilerplugins/clang/plugin.cxx
+++ b/compilerplugins/clang/plugin.cxx
@@ -100,11 +100,23 @@ bool ParentBuilder::VisitFunctionDecl( const FunctionDecl* function )
{
// if( ignoreLocation( declaration ))
// return true; ???
- if( !function->doesThisDeclarationHaveABody())
- return true;
- const Stmt* body = function->getBody();
- (*parents)[ body ] = NULL; // no parent
- walk( body );
+ if( function->doesThisDeclarationHaveABody())
+ {
+ 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;
}