Skip to content

Commit 1bab950

Browse files
committed
C++: Introduce (_Complex) _Float16 type which is needed after frontend update
1 parent 282ca10 commit 1bab950

File tree

6 files changed

+16
-0
lines changed

6 files changed

+16
-0
lines changed

cpp/ql/lib/semmle/code/cpp/Type.qll

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -816,6 +816,12 @@ private predicate floatingPointTypeMapping(
816816
or
817817
// _Float128x
818818
kind = 50 and base = 2 and domain = TRealDomain() and realKind = 50 and extended = true
819+
or
820+
// _Float16
821+
kind = 52 and base = 2 and domain = TRealDomain() and realKind = 52 and extended = false
822+
or
823+
// _Complex _Float16
824+
kind = 53 and base = 2 and domain = TComplexDomain() and realKind = 52 and extended = false
819825
}
820826

821827
/**

cpp/ql/lib/semmlecode.cpp.dbscheme

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,6 +610,8 @@ case @builtintype.kind of
610610
| 49 = @std_float128 // _Float128
611611
| 50 = @float128x // _Float128x
612612
| 51 = @char8_t
613+
| 52 = @float16 // _Float16
614+
| 53 = @complex_float16 // _Complex _Float16
613615
;
614616

615617
builtintypes(

cpp/ql/test/library-tests/templates/type_instantiations/types.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
| file://:0:0:0:0 | Cl<char, Sa, Sb> * |
2+
| file://:0:0:0:0 | _Complex _Float16 |
23
| file://:0:0:0:0 | _Complex __float128 |
34
| file://:0:0:0:0 | _Complex double |
45
| file://:0:0:0:0 | _Complex float |
56
| file://:0:0:0:0 | _Complex long double |
67
| file://:0:0:0:0 | _Decimal32 |
78
| file://:0:0:0:0 | _Decimal64 |
89
| file://:0:0:0:0 | _Decimal128 |
10+
| file://:0:0:0:0 | _Float16 |
911
| file://:0:0:0:0 | _Float32 |
1012
| file://:0:0:0:0 | _Float32x |
1113
| file://:0:0:0:0 | _Float64 |

cpp/ql/test/library-tests/type_sizes/type_sizes.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@
1919
| file://:0:0:0:0 | StructWithDef && | 8 |
2020
| file://:0:0:0:0 | UnionWithDef & | 8 |
2121
| file://:0:0:0:0 | UnionWithDef && | 8 |
22+
| file://:0:0:0:0 | _Complex _Float16 | 4 |
2223
| file://:0:0:0:0 | _Complex __float128 | 32 |
2324
| file://:0:0:0:0 | _Complex double | 16 |
2425
| file://:0:0:0:0 | _Complex float | 8 |
2526
| file://:0:0:0:0 | _Complex long double | 32 |
2627
| file://:0:0:0:0 | _Decimal32 | 4 |
2728
| file://:0:0:0:0 | _Decimal64 | 8 |
2829
| file://:0:0:0:0 | _Decimal128 | 16 |
30+
| file://:0:0:0:0 | _Float16 | 2 |
2931
| file://:0:0:0:0 | _Float32 | 4 |
3032
| file://:0:0:0:0 | _Float32x | 8 |
3133
| file://:0:0:0:0 | _Float64 | 8 |

cpp/ql/test/library-tests/unspecified_type/types/unspecified_type.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
| file://:0:0:0:0 | ..()(..) | ..()(..) |
22
| file://:0:0:0:0 | ..(*)(..) | ..(*)(..) |
33
| file://:0:0:0:0 | Tmpl<T> | Tmpl<T> |
4+
| file://:0:0:0:0 | _Complex _Float16 | _Complex _Float16 |
45
| file://:0:0:0:0 | _Complex __float128 | _Complex __float128 |
56
| file://:0:0:0:0 | _Complex double | _Complex double |
67
| file://:0:0:0:0 | _Complex float | _Complex float |
78
| file://:0:0:0:0 | _Complex long double | _Complex long double |
89
| file://:0:0:0:0 | _Decimal32 | _Decimal32 |
910
| file://:0:0:0:0 | _Decimal64 | _Decimal64 |
1011
| file://:0:0:0:0 | _Decimal128 | _Decimal128 |
12+
| file://:0:0:0:0 | _Float16 | _Float16 |
1113
| file://:0:0:0:0 | _Float32 | _Float32 |
1214
| file://:0:0:0:0 | _Float32x | _Float32x |
1315
| file://:0:0:0:0 | _Float64 | _Float64 |

cpp/ql/test/library-tests/variables/variables/types.expected

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
| ..()(..) | RoutineType | | | | |
22
| ..(*)(..) | FunctionPointerType | | ..()(..) | | |
3+
| _Complex _Float16 | BinaryFloatingPointType, ComplexNumberType | | | | |
34
| _Complex __float128 | BinaryFloatingPointType, ComplexNumberType | | | | |
45
| _Complex double | BinaryFloatingPointType, ComplexNumberType | | | | |
56
| _Complex float | BinaryFloatingPointType, ComplexNumberType | | | | |
67
| _Complex long double | BinaryFloatingPointType, ComplexNumberType | | | | |
78
| _Decimal32 | Decimal32Type | | | | |
89
| _Decimal64 | Decimal64Type | | | | |
910
| _Decimal128 | Decimal128Type | | | | |
11+
| _Float16 | BinaryFloatingPointType, RealNumberType | | | | |
1012
| _Float32 | BinaryFloatingPointType, RealNumberType | | | | |
1113
| _Float32x | BinaryFloatingPointType, RealNumberType | | | | |
1214
| _Float64 | BinaryFloatingPointType, RealNumberType | | | | |

0 commit comments

Comments
 (0)