@@ -24,28 +24,32 @@ import codingstandards.c.cert
24
24
import codingstandards.cpp.types.Compatible
25
25
import ExternalIdentifiers
26
26
27
- predicate interestedInFunctions ( FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2 ) {
27
+ predicate interestedInFunctions (
28
+ FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2 , ExternalIdentifiers d
29
+ ) {
28
30
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 , _)
31
37
}
32
38
39
+ module FuncDeclEquiv =
40
+ FunctionDeclarationTypeEquivalence< TypesCompatibleConfig , interestedInFunctions / 2 > ;
41
+
33
42
from ExternalIdentifiers d , FunctionDeclarationEntry f1 , FunctionDeclarationEntry f2
34
43
where
35
44
not isExcluded ( f1 , Declarations2Package:: incompatibleFunctionDeclarationsQuery ( ) ) and
36
45
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
41
47
(
42
48
//return type check
43
- not FunctionDeclarationTypeEquivalence< TypesCompatibleConfig , interestedInFunctions / 2 > :: equalReturnTypes ( f1 ,
44
- f2 )
49
+ not FuncDeclEquiv:: equalReturnTypes ( f1 , f2 )
45
50
or
46
51
//parameter type check
47
- not FunctionDeclarationTypeEquivalence< TypesCompatibleConfig , interestedInFunctions / 2 > :: equalParameterTypes ( f1 ,
48
- f2 )
52
+ not FuncDeclEquiv:: equalParameterTypes ( f1 , f2 )
49
53
) and
50
54
// Apply ordering on start line, trying to avoid the optimiser applying this join too early
51
55
// in the pipeline
0 commit comments