@@ -24,28 +24,32 @@ import codingstandards.c.cert
2424import codingstandards.cpp.types.Compatible
2525import ExternalIdentifiers
2626
27- predicate interestedInFunctions ( FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2 ) {
27+ predicate interestedInFunctions (
28+ FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2 , ExternalIdentifiers d
29+ ) {
2830 not f1 = f2 and
29- f1 .getDeclaration ( ) = f2 .getDeclaration ( ) and
30- f1 .getName ( ) = f2 .getName ( )
31+ d = f1 .getDeclaration ( ) and
32+ d = f2 .getDeclaration ( )
33+ }
34+
35+ predicate interestedInFunctions ( FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2 ) {
36+ interestedInFunctions ( f1 , f2 , _)
3137}
3238
39+ module FuncDeclEquiv =
40+ FunctionDeclarationTypeEquivalence< TypesCompatibleConfig , interestedInFunctions / 2 > ;
41+
3342from ExternalIdentifiers d , FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2
3443where
3544 not isExcluded ( f1 , Declarations2Package:: incompatibleFunctionDeclarationsQuery ( ) ) and
3645 not isExcluded ( f2 , Declarations2Package:: incompatibleFunctionDeclarationsQuery ( ) ) and
37- not f1 = f2 and
38- f1 .getDeclaration ( ) = d and
39- f2 .getDeclaration ( ) = d and
40- f1 .getName ( ) = f2 .getName ( ) and
46+ interestedInFunctions ( f1 , f2 , d ) and
4147 (
4248 //return type check
43- not FunctionDeclarationTypeEquivalence< TypesCompatibleConfig , interestedInFunctions / 2 > :: equalReturnTypes ( f1 ,
44- f2 )
49+ not FuncDeclEquiv:: equalReturnTypes ( f1 , f2 )
4550 or
4651 //parameter type check
47- not FunctionDeclarationTypeEquivalence< TypesCompatibleConfig , interestedInFunctions / 2 > :: equalParameterTypes ( f1 ,
48- f2 )
52+ not FuncDeclEquiv:: equalParameterTypes ( f1 , f2 )
4953 ) and
5054 // Apply ordering on start line, trying to avoid the optimiser applying this join too early
5155 // in the pipeline
0 commit comments