|
Re: C/C++ CodeReview IRuleFilter [message #92648 is a reply to message #92553] |
Fri, 16 February 2007 16:30 |
Eclipse User |
|
|
|
Originally posted by: s_gutz.ca.ibm.com
It's certainly not for efficiency since single filter would always be
faster. Without really digging into the code I'm not sure this approach
was used. I didn't write this rule but my guess is that the first
filter is ensuring that this is a C++ function definition in case
someone runs this rule on C code and hits a method that looks remarkably
like a destructor (as unlikely as that is).
Steve
Tim Wang wrote:
> I am working with TPTP static analyze for C/C++. I found the following code
> for finding the desturctor definition for a C++ class:
>
> private static IRuleFilter[] destructorFunct = {
> new ASTNodeTypeRuleFilter(IASTNodeTypes.ICPPASTFunctionDefinitio n, true),
> new DestructorFunctionDefinitionRuleFilter(true)
> };
>
> My question is that why not make the destructorFunct like this:
>
> private static IRuleFilter destructorFunct = new
> DestructorFunctionDefinitionRuleFilter(true);
>
> Why bother to add the ICPPASTFunctionDefinition into the filter? Is this for
> effeciency or something else?
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.02788 seconds