Пример #1
0
void
CompassAnalyses::ProtectVirtualMethods::Traversal::
visit(SgNode* node)
   { 
     SgMemberFunctionDeclaration *sgmf = isSgMemberFunctionDeclaration(node);

     if( sgmf != NULL )
     {
       SgFunctionModifier sgfm = sgmf->get_functionModifier();
       SgAccessModifier sgam = 
         sgmf->get_declarationModifier().get_accessModifier();

       if( sgfm.isVirtual() == true && sgam.isPublic() == true )
       {
         output->addOutput( new CheckerOutput( node ) );
       } //if( sgfm.isVirtual() == true && sgam.isPublic() == true )
     } //if( sgmf != NULL )

     return;
   } //End of the visit function.
Пример #2
0
Файл: voidStar.C Проект: 8l/rose
void
CompassAnalyses::VoidStar::Traversal::
visit(SgNode* n)
{
  SgMemberFunctionDeclaration *decl = isSgMemberFunctionDeclaration(n);
  if (decl != NULL) {
    if (decl->get_declarationModifier().get_accessModifier().isPublic()) {
      if (isVoidStar(decl->get_type()->get_return_type())) {
        output->addOutput(new CheckerOutput(decl));
        return ;
      }
      const SgTypePtrList& args = decl->get_type()->get_arguments();
      for (SgTypePtrList::const_iterator i = args.begin();
           i != args.end();
           ++i) {
        if (isVoidStar(*i)) {
          output->addOutput(new CheckerOutput(decl));
          return ;
        }
      }
    }
  } //End of the visit function.
}